From 1b17e766659d93d1e7bd6633bf78132e1abb3568 Mon Sep 17 00:00:00 2001
From: Elena Zannoni
Date: Sun, 9 Jul 2000 17:20:00 +0000
Subject: readline: 2000-07-09 Elena Zannoni
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
---
readline/CHANGELOG | 123 +
readline/CHANGES | 108 +
readline/COPYING | 4 +-
readline/ChangeLog.Cygnus | 13 +
readline/MANIFEST | 12 +-
readline/Makefile.in | 98 +-
readline/README | 2 +-
readline/aclocal.m4 | 172 +-
readline/ansi_stdlib.h | 2 +-
readline/bind.c | 472 ++--
readline/callback.c | 14 +-
readline/chardefs.h | 4 +-
readline/complete.c | 139 +-
readline/config.h.in | 3 +
readline/configure | 277 ++-
readline/configure.in | 23 +-
readline/display.c | 351 ++-
readline/doc/ChangeLog | 9 +
readline/doc/Makefile.in | 87 +-
readline/doc/hist.texinfo | 4 +-
readline/doc/history.dvi | Bin 49240 -> 0 bytes
readline/doc/history.html | 1195 ---------
readline/doc/history.info | 811 -------
readline/doc/history.ps | 1636 -------------
readline/doc/hstech.texinfo | 9 +-
readline/doc/hsuser.texinfo | 113 +-
readline/doc/inc-hist.texinfo | 117 +-
readline/doc/manvers.texinfo | 10 +-
readline/doc/readline.3 | 11 +-
readline/doc/readline.dvi | Bin 207200 -> 0 bytes
readline/doc/readline.html | 4327 ---------------------------------
readline/doc/readline.info | 3107 ------------------------
readline/doc/readline.ps | 4570 -----------------------------------
readline/doc/rlman.texinfo | 4 +-
readline/doc/rltech.texinfo | 51 +-
readline/doc/rluser.texinfo | 448 +++-
readline/doc/rluserman.dvi | Bin 61412 -> 0 bytes
readline/doc/rluserman.html | 1566 ------------
readline/doc/rluserman.info | 1189 ---------
readline/doc/rluserman.ps | 1897 ---------------
readline/doc/texinfo.tex | 4692 ------------------------------------
readline/emacs_keymap.c | 16 +-
readline/examples/ChangeLog.Cygnus | 6 +
readline/examples/Makefile.in | 38 +-
readline/examples/fileman.c | 26 +-
readline/examples/rl.c | 39 +-
readline/examples/rltest.c | 16 +-
readline/examples/rlversion.c | 8 +-
readline/funmap.c | 16 +-
readline/histexpand.c | 18 +-
readline/histfile.c | 89 +-
readline/histlib.h | 12 +-
readline/history.c | 6 +-
readline/history.h | 10 +-
readline/histsearch.c | 7 +-
readline/input.c | 92 +-
readline/isearch.c | 21 +-
readline/keymaps.c | 14 +-
readline/keymaps.h | 12 +-
readline/kill.c | 39 +-
readline/macro.c | 19 +-
readline/nls.c | 21 +-
readline/parens.c | 41 +-
readline/posixdir.h | 4 +-
readline/posixjmp.h | 18 +
readline/posixstat.h | 4 +-
readline/readline.c | 207 +-
readline/readline.h | 25 +-
readline/rlconf.h | 8 +-
readline/rldefs.h | 7 +-
readline/rlstdc.h | 52 +-
readline/rltty.c | 208 +-
readline/rltty.h | 25 +-
readline/rlwinsize.h | 5 +-
readline/savestring.c | 4 +-
readline/search.c | 182 +-
readline/shell.c | 50 +-
readline/shlib/Makefile.in | 61 +-
readline/signals.c | 54 +-
readline/support/config.guess | 382 ++-
readline/support/config.sub | 397 ++-
readline/support/shlib-install | 47 +-
readline/support/shobj-conf | 46 +-
readline/tcap.h | 4 +-
readline/terminal.c | 235 +-
readline/tilde.c | 55 +-
readline/tilde.h | 28 +-
readline/undo.c | 6 +-
readline/util.c | 24 +-
readline/vi_keymap.c | 4 +-
readline/vi_mode.c | 33 +-
readline/xmalloc.c | 27 +-
92 files changed, 3648 insertions(+), 26790 deletions(-)
delete mode 100644 readline/doc/history.dvi
delete mode 100644 readline/doc/history.html
delete mode 100644 readline/doc/history.info
delete mode 100644 readline/doc/history.ps
delete mode 100644 readline/doc/readline.dvi
delete mode 100644 readline/doc/readline.html
delete mode 100644 readline/doc/readline.info
delete mode 100644 readline/doc/readline.ps
delete mode 100644 readline/doc/rluserman.dvi
delete mode 100644 readline/doc/rluserman.html
delete mode 100644 readline/doc/rluserman.info
delete mode 100644 readline/doc/rluserman.ps
delete mode 100644 readline/doc/texinfo.tex
create mode 100644 readline/examples/ChangeLog.Cygnus
diff --git a/readline/CHANGELOG b/readline/CHANGELOG
index 479e6c0..9024bdf 100644
--- a/readline/CHANGELOG
+++ b/readline/CHANGELOG
@@ -214,3 +214,126 @@ Makefile.in,{doc,examples,shlib}/Makefile.in
- set SHELL from @MAKE_SHELL@
[readline-4.0 released]
+
+ 3/11
+ ----
+doc/Makefile.in
+ - removed references to HTMLTOC, since separate HTML table-of-contents
+ files are no longer created
+
+examples/Makefile.in
+ - remove `*.exe' in clean target for MS-DOS
+
+Makefile.in
+ - make `readline' target depend on ./libreadline.a
+ - configure now substitutes TERMCAP_LIB into Makefile.in
+ - use ${TERMCAP_LIB} instead of -ltermcap in recipe for `readline'
+ - clean target now removes readline and readline.exe in case they
+ get built
+
+configure.in
+ - use `pwd.exe' to set BUILD_DIR on MS-DOS DJGPP
+
+ 3/15
+ ----
+support/shlib-install
+ - Irix 5.x and Irix 6.x should install shared libraries like Solaris 2
+ - changes for installing on hp-ux 1[01].x
+
+ 3/23
+ ----
+configure.in
+ - make sure that the $CC argument to shobj-conf is quoted
+
+ 4/8
+ ---
+
+xmalloc.h, rlprivate.h, rlshell.h
+ - new files
+
+Makefile.in,shlib/Makefile.in
+ - add dependencies on xmalloc.h, rlshell.h
+ - add xmalloc.h, rlprivate.h, rlshell.h to list of header files
+
+MANIFEST
+ - add xmalloc.h, rlprivate.h, rlshell.h
+
+ 4/9
+ ---
+Makefile.in,shlib/Makefile.in
+ - add dependencies on rlprivate.h
+
+ 4/13
+ ----
+doc/Makefile.in
+ - add variable, PSDVI, which is the desired resolution of the
+ generated postscript files. Set to 300 because I don't have
+ any 600-dpi printers
+ - set LANGUAGE= before calling makeinfo, so messages are in English
+ - add rluserman.{info,dvi,ps,html} to appropriate variables
+ - add rules to create rluserman.{info,dvi,ps,html}
+ - install and uninstall rluserman.info, but don't update the directory
+ file in $(infodir) yet
+
+MANIFEST
+ - add doc/rluserman.{texinfo,info,dvi,ps,html}
+
+ 4/30
+ ----
+configure.in
+ - updated library version to 4.1
+
+ 5/3
+ ---
+configure.in
+ - SHLIB_MAJOR and SHLIB_MINOR shared library version numbers are
+ constructed from $LIBRARY_VERSION and substituted into Makefiles
+
+ 5/5
+ ---
+support/shlib-install
+ - OSF/1 installs shared libraries like Solaris
+
+Makefile.in
+ - broke the header file install and uninstall into two new targets:
+ install-headers and uninstall-headers
+ - install and uninstall depend on install-headers and uninstall-headers
+ respectively
+ - changed install-shared and uninstall-shared targets to depend on
+ install-headers and uninstall-headers, respectively, so users may
+ choose to install only the shared libraries. I'm not sure about
+ the uninstall one yet -- maybe it should check whether or not
+ the static libraries are installed and not remove the header files
+ if they are
+
+ 9/3
+ ---
+configure.in, config.h.in
+ - added test for memmove (for later use)
+ - changed version to 4.1-beta1
+
+ 9/13
+ ----
+examples/rlfe.c
+ - Per Bothner's `rlfe' readline front-end program
+
+examples/Makefile.in
+ - added rules to build rlfe
+
+ 9/21
+ ----
+support/shlib-install
+ - changes to handle FreeBSD-3.x elf or a.out shared libraries, which
+ have different semantics and need different naming conventions
+
+ 1/24/2000
+ ---------
+doc/Makefile.in
+ - remove *.bt and *.bts on `make clean'
+
+ 2/4
+ ---
+
+
+configure.in
+ - changed LIBVERSION to 4.1-beta5
diff --git a/readline/CHANGES b/readline/CHANGES
index 65339c2..d2929ab 100644
--- a/readline/CHANGES
+++ b/readline/CHANGES
@@ -1,3 +1,111 @@
+This document details the changes between this version, readline-4.1,
+and the previous version, readline-4.0.
+
+1. Changes to Readline
+
+a. Changed the HTML documents so that the table-of-contents is no longer
+ a separate file.
+
+b. Changes to the shared object configuration for: Irix 5.x, Irix 6.x,
+ OSF/1.
+
+c. The shared library major and minor versions are now constructed
+ automatically by configure and substituted into the makefiles.
+
+d. It's now possible to install the shared libraries separately from the
+ static libraries.
+
+e. The history library tries to truncate the history file only if it is a
+ regular file.
+
+f. A bug that caused _rl_dispatch to address negative array indices on
+ systems with signed chars was fixed.
+
+g. rl-yank-nth-arg now leaves the history position the same as when it was
+ called.
+
+h. Changes to the completion code to handle MS-DOS drive-letter:pathname
+ filenames.
+
+i. Completion is now case-insensitive by default on MS-DOS.
+
+j. Fixes to the history file manipulation code for MS-DOS.
+
+k. Readline attempts to bind the arrow keys to appropriate defaults on MS-DOS.
+
+l. Some fixes were made to the redisplay code for better operation on MS-DOS.
+
+m. The quoted-insert code will now insert tty special chars like ^C.
+
+n. A bug was fixed that caused the display code to reference memory before
+ the start of the prompt string.
+
+o. More support for __EMX__ (OS/2).
+
+p. A bug was fixed in readline's signal handling that could cause infinite
+ recursion in signal handlers.
+
+q. A bug was fixed that caused the point to be less than zero when rl_forward
+ was given a very large numeric argument.
+
+r. The vi-mode code now gets characters via the application-settable value
+ of rl_getc_function rather than calling rl_getc directly.
+
+s. The history file code now uses O_BINARY mode when reading and writing
+ the history file on cygwin32.
+
+t. Fixed a bug in the redisplay code for lines with more than 256 line
+ breaks.
+
+u. A bug was fixed which caused invisible character markers to not be
+ stripped from the prompt string if the terminal was in no-echo mode.
+
+v. Readline no longer tries to get the variables it needs for redisplay
+ from the termcap entry if the calling application has specified its
+ own redisplay function. Readline treats the terminal as `dumb' in
+ this case.
+
+w. Fixes to the SIGWINCH code so that a multiple-line prompt with escape
+ sequences is redrawn correctly.
+
+x. Changes to the install and install-shared targets so that the libraries
+ and header files are installed separately.
+
+2. New Features in Readline
+
+a. A new Readline `user manual' is in doc/rluserman.texinfo.
+
+b. Parentheses matching is now always compiled into readline, and enabled
+ or disabled when the value of the `blink-matching-paren' variable is
+ changed.
+
+c. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
+
+d. MS-DOS systems now use ~/_history as the default history file.
+
+e. history-search-{forward,backward} now leave the point at the end of the
+ line when the string to search for is empty, like
+ {reverse,forward}-search-history.
+
+f. history-search-{forward,backward} now leave the last history line found
+ in the readline buffer if the second or subsequent search fails.
+
+g. New function for use by applications: rl_on_new_line_with_prompt, used
+ when an application displays the prompt itself before calling readline().
+
+h. New variable for use by applications: rl_already_prompted. An application
+ that displays the prompt itself before calling readline() must set this to
+ a non-zero value.
+
+i. A new variable, rl_gnu_readline_p, always 1. The intent is that an
+ application can verify whether or not it is linked with the `real'
+ readline library or some substitute.
+
+j. Per Bothner's `rlfe' (pronounced `Ralphie') readline front-end program
+ is included in the examples subdirectory, though it is not built
+ by default.
+
+-------------------------------------------------------------------------------
This document details the changes between this version, readline-4.0,
and the previous version, readline-2.2.
diff --git a/readline/COPYING b/readline/COPYING
index a43ea21..1bf1526 100644
--- a/readline/COPYING
+++ b/readline/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
diff --git a/readline/ChangeLog.Cygnus b/readline/ChangeLog.Cygnus
index bc53a32..40baa98 100644
--- a/readline/ChangeLog.Cygnus
+++ b/readline/ChangeLog.Cygnus
@@ -1,3 +1,16 @@
+2000-07-09 Elena Zannoni
+
+ * Import of readline 4.1.
+
+ Locally modified files: Makefile.in, configure.in, configure
+ (regenerated), config.h.in (regenerated), readline.h, rltty.c,
+ shell.c signals.c.
+
+ Locally added files: acconfig.h, config/*, config.h.bot,
+ cross-build/*, doc/inc-hit.texinfo.
+
+ New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
+
2000-03-16 Eli Zaretskii
* support/shobj-conf: Shared libs are unsupported on MSDOS.
diff --git a/readline/MANIFEST b/readline/MANIFEST
index f23ff41..a51ca05 100644
--- a/readline/MANIFEST
+++ b/readline/MANIFEST
@@ -11,8 +11,8 @@ MANIFEST f
INSTALL f
CHANGELOG f
CHANGES f
+USAGE f
aclocal.m4 f
-acconfig.h f
config.h.in f
configure f
configure.in f
@@ -28,11 +28,14 @@ posixstat.h f
readline.h f
rlconf.h f
rldefs.h f
+rlprivate.h f
+rlshell.h f
rlstdc.h f
rltty.h f
rlwinsize.h f
tcap.h f
tilde.h f
+xmalloc.h f
bind.c f
complete.c f
display.c f
@@ -77,6 +80,7 @@ doc/manvers.texinfo f
doc/rlman.texinfo f
doc/rltech.texinfo f
doc/rluser.texinfo f
+doc/rluserman.texinfo f
doc/hist.texinfo f
doc/hstech.texinfo f
doc/hsuser.texinfo f
@@ -84,8 +88,10 @@ doc/readline.3 f
doc/texi2dvi f
doc/texi2html f
examples/Makefile.in f
+examples/excallback.c f
examples/fileman.c f
examples/manexamp.c f
+examples/rlfe.c f
examples/rltest.c f
examples/rl.c f
examples/rlversion.c f
@@ -94,10 +100,14 @@ examples/Inputrc f
# formatted documentation, from MANIFEST.doc
doc/readline.ps f
doc/history.ps f
+doc/rluserman.ps f
doc/readline.dvi f
doc/history.dvi f
+doc/rluserman.dvi f
doc/readline.info f
doc/history.info f
+doc/rluserman.info f
doc/readline.html f
doc/history.html f
+doc/rluserman.html f
doc/readline.0 f
diff --git a/readline/Makefile.in b/readline/Makefile.in
index 5c667ed..3069ff7 100644
--- a/readline/Makefile.in
+++ b/readline/Makefile.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
RL_LIBRARY_VERSION = @LIBVERSION@
RL_LIBRARY_NAME = readline
@@ -60,6 +60,8 @@ CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
+TERMCAP_LIB = @TERMCAP_LIB@
+
# For libraries which include headers from other libraries.
INCLUDES = -I. -I$(srcdir) -I$(includedir)
@@ -88,7 +90,7 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
- ansi_stdlib.h tcap.h rlstdc.h
+ ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h
HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
TILDEOBJ = tilde.o
@@ -115,6 +117,8 @@ INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
all: static
+everything: static shared examples
+
static: $(STATIC_LIBS)
libreadline.a: $(OBJECTS)
@@ -127,8 +131,8 @@ libhistory.a: $(HISTOBJ) xmalloc.o
$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
-test -n "$(RANLIB)" && $(RANLIB) $@
-readline: $(OBJECTS) readline.h rldefs.h chardefs.h
- $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
+readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
+ $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
Makefile makefile: config.status $(srcdir)/Makefile.in
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
@@ -147,9 +151,8 @@ stamp-h: config.status $(srcdir)/config.h.in
CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
echo > $@
-# CYGNUS LOCAL: Never run autoconf.
-#$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
-# cd $(srcdir) && autoconf Comment-me-out in distribution
+#$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
+# cd $(srcdir) && autoconf ## Comment-me-out in distribution
shared: force
-test -d shlib || mkdir shlib
@@ -165,6 +168,17 @@ examples: force
force:
+install-headers: installdirs ${INSTALLED_HEADERS}
+ for f in ${INSTALLED_HEADERS}; do \
+ $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
+ done
+
+uninstall-headers:
+ -test -n "$(includedir)" && cd $(includedir)/readline && \
+ ${RM} ${INSTALLED_HEADERS}
+
+maybe-uninstall-headers: uninstall-headers
+
## CYGNUS LOCAL
## Don't mess with people's installed readline's.
## This tries to install this version of readline over whatever
@@ -175,14 +189,11 @@ force:
install:
-#install: installdirs $(STATIC_LIBS)
-# for f in ${INSTALLED_HEADERS}; do \
-# $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
-# done
-# -( if test -f $(libdir)/libreadline.a ; then $(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old; fi )
+#install: installdirs $(STATIC_LIBS) install-headers
+# -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
# $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
# -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
-# -( if test -f $(libdir)/libhistory.a; then $(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old; fi )
+# -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
# $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
# -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
# -( if test -d doc ; then \
@@ -194,16 +205,14 @@ installdirs: $(srcdir)/support/mkdirs
-$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
$(includedir)/readline $(libdir) $(infodir) $(man3dir)
-uninstall:
- -test -n "$(includedir)" && cd $(includedir)/readline && \
- ${RM} ${INSTALLED_HEADERS}
+uninstall: uninstall-headers
-test -n "$(libdir)" && cd $(libdir) && \
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
-install-shared: installdirs shared
+install-shared: installdirs install-headers shared
-( cd shlib ; ${MAKE} ${MFLAGS} install )
-uninstall-shared:
+uninstall-shared: maybe-uninstall-headers
-( cd shlib; ${MAKE} ${MFLAGS} uninstall )
TAGS: force
@@ -214,6 +223,7 @@ tags: force
clean: force
$(RM) $(OBJECTS) $(STATIC_LIBS)
+ $(RM) readline readline.exe
-( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
@@ -241,7 +251,7 @@ installcheck:
dist: force
@echo Readline distributions are created using $(srcdir)/support/mkdist.
@echo Here is a sample of the necessary commands:
- @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION)
+ @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
@echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
@echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
@@ -300,6 +310,8 @@ macro.o: readline.h keymaps.h chardefs.h tilde.h
macro.o: history.h rlstdc.h
nls.o: ansi_stdlib.h
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
+nls.o: readline.h keymaps.h chardefs.h tilde.h
+nls.o: history.h rlstdc.h
parens.o: rlconf.h
parens.o: ${BUILD_DIR}/config.h
parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
@@ -338,6 +350,54 @@ vi_mode.o: history.h ansi_stdlib.h rlstdc.h
xmalloc.o: ${BUILD_DIR}/config.h
xmalloc.o: ansi_stdlib.h
+bind.o: rlshell.h
+histfile.o: rlshell.h
+nls.o: rlshell.h
+readline.o: rlshell.h
+shell.o: rlshell.h
+terminal.o: rlshell.h
+histexpand.o: rlshell.h
+
+bind.o: rlprivate.h
+callback.o: rlprivate.h
+complete.o: rlprivate.h
+display.o: rlprivate.h
+input.o: rlprivate.h
+isearch.o: rlprivate.h
+kill.o: rlprivate.h
+macro.o: rlprivate.h
+nls.o: rlprivate.h
+parens.o: rlprivate.h
+readline.o: rlprivate.h
+rltty.o: rlprivate.h
+search.o: rlprivate.h
+signals.o: rlprivate.h
+terminal.o: rlprivate.h
+undo.o: rlprivate.h
+util.o: rlprivate.h
+vi_mode.o: rlprivate.h
+
+bind.o: xmalloc.h
+complete.o: xmalloc.h
+display.o: xmalloc.h
+funmap.o: xmalloc.h
+histexpand.o: xmalloc.h
+histfile.o: xmalloc.h
+history.o: xmalloc.h
+input.o: xmalloc.h
+isearch.o: xmalloc.h
+keymaps.o: xmalloc.h
+kill.o: xmalloc.h
+macro.o: xmalloc.h
+readline.o: xmalloc.h
+savestring.o: xmalloc.h
+search.o: xmalloc.h
+shell.o: xmalloc.h
+tilde.o: xmalloc.h
+tilde.o: xmalloc.h
+util.o: xmalloc.h
+vi_mode.o: xmalloc.h
+
readline.o: $(srcdir)/readline.c
vi_mode.o: $(srcdir)/vi_mode.c
funmap.o: $(srcdir)/funmap.c
diff --git a/readline/README b/readline/README
index 56565b2..41a5d0c 100644
--- a/readline/README
+++ b/readline/README
@@ -1,7 +1,7 @@
Introduction
============
-This is the Gnu Readline library, version 4.0.
+This is the Gnu Readline library, version 4.1.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
diff --git a/readline/aclocal.m4 b/readline/aclocal.m4
index c277a0c..f8f5b74 100644
--- a/readline/aclocal.m4
+++ b/readline/aclocal.m4
@@ -316,13 +316,19 @@ AC_CACHE_VAL(bash_cv_opendir_not_robust,
main()
{
DIR *dir;
-int fd;
-unlink("/tmp/not_a_directory");
-fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
+int fd, err;
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror("mkdir");
+ exit(1);
+}
+unlink("/tmp/bash-aclocal/not_a_directory");
+fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
write(fd, "\n", 1);
close(fd);
-dir = opendir("/tmp/not_a_directory");
-unlink("/tmp/not_a_directory");
+dir = opendir("/tmp/bash-aclocal/not_a_directory");
+unlink("/tmp/bash-aclocal/not_a_directory");
+rmdir("/tmp/bash-aclocal");
exit (dir == 0);
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
[AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
@@ -354,25 +360,59 @@ AC_DEFINE(VOID_SIGHANDLER)
fi
])
-AC_DEFUN(BASH_TYPE_INT32_T,
+dnl
+dnl A signed 16-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS16_T,
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(bits16_t, short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(bits16_t, char)
+else
+ AC_CHECK_TYPE(bits16_t, short)
+fi
+])
+
+dnl
+dnl An unsigned 16-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_U_BITS16_T,
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned char)
+else
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+fi
+])
+
+dnl
+dnl A signed 32-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
- AC_CHECK_TYPE(int32_t, int)
+ AC_CHECK_TYPE(bits32_t, int)
elif test "$ac_cv_sizeof_long" = 4; then
- AC_CHECK_TYPE(int32_t, long)
+ AC_CHECK_TYPE(bits32_t, long)
else
- AC_CHECK_TYPE(int32_t, int)
+ AC_CHECK_TYPE(bits32_t, int)
fi
])
-AC_DEFUN(BASH_TYPE_U_INT32_T,
+dnl
+dnl An unsigned 32-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_U_BITS32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
- AC_CHECK_TYPE(u_int32_t, unsigned int)
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
elif test "$ac_cv_sizeof_long" = 4; then
- AC_CHECK_TYPE(u_int32_t, unsigned long)
+ AC_CHECK_TYPE(u_bits32_t, unsigned long)
else
- AC_CHECK_TYPE(u_int32_t, unsigned int)
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
fi
])
@@ -387,6 +427,9 @@ else
fi
])
+dnl
+dnl A signed 64-bit quantity
+dnl
AC_DEFUN(BASH_TYPE_BITS64_T,
[
if test "$ac_sv_sizeof_char_p" = 8; then
@@ -427,6 +470,20 @@ if test $bash_cv_func_lstat = yes; then
fi
])
+AC_DEFUN(BASH_FUNC_INET_ATON,
+[
+AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
+[AC_TRY_LINK([
+#include
+#include
+#include
+struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
+bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
+if test $bash_cv_func_inet_aton = yes; then
+ AC_DEFINE(HAVE_INET_ATON)
+fi
+])
+
AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
[AC_MSG_CHECKING([for a c_line member of struct termios])
AC_CACHE_VAL(bash_cv_termios_ldisc,
@@ -845,7 +902,7 @@ AC_CACHE_VAL(bash_cv_sys_named_pipes,
/* Add more tests in here as appropriate. */
main()
{
-int fd;
+int fd, err;
#if defined (HAVE_MKFIFO)
exit (0);
@@ -858,12 +915,19 @@ exit (1);
#if defined (NeXT)
exit (1);
#endif
-
-fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
-if (fd == -1)
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror ("mkdir");
+ exit(1);
+}
+fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
+if (fd == -1) {
+ rmdir ("/tmp/bash-aclocal");
exit (1);
+}
close(fd);
-unlink ("/tmp/sh-np-autoconf");
+unlink ("/tmp/bash-aclocal/sh-np-autoconf");
+rmdir ("/tmp/bash-aclocal");
exit(0);
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
[AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
@@ -1037,12 +1101,32 @@ elif test $bash_cv_dev_fd = "whacky"; then
fi
])
+AC_DEFUN(BASH_CHECK_DEV_STDIN,
+[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
+AC_CACHE_VAL(bash_cv_dev_stdin,
+[if test -d /dev/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ elif test -d /proc/self/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ else
+ bash_cv_dev_stdin=absent
+ fi
+])
+AC_MSG_RESULT($bash_cv_dev_stdin)
+if test $bash_cv_dev_stdin = "present"; then
+ AC_DEFINE(HAVE_DEV_STDIN)
+fi
+])
+
+dnl
+dnl Check for the presence of getpeername in libsocket.
+dnl If libsocket is present, check for libnsl and add it to LIBS if
+dnl it's there, since most systems with libsocket require linking
+dnl with libnsl as well. This should only be called if getpeername
+dnl was not found in libc.
dnl
-dnl Check for the presence of getpeername (the only networking function
-dnl bash currently requires) in libsocket. If libsocket is present,
-dnl check for libnsl and add it to LIBS if it's there, since most
-dnl systems with libsocket require linking with libnsl as well.
-dnl This should only be called if getpeername was not found in libc.
+dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
+dnl AS WELL
dnl
AC_DEFUN(BASH_CHECK_SOCKLIB,
[
@@ -1084,6 +1168,32 @@ if test $bash_cv_have_socklib = yes; then
fi
])
+dnl
+dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
+dnl system, we can't use AC_PREREQ
+dnl
+AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
+[if test "X$bash_cv_have_gethostbyname" = "X"; then
+_bash_needmsg=yes
+else
+AC_MSG_CHECKING(for gethostbyname in socket library)
+_bash_needmsg=
+fi
+AC_CACHE_VAL(bash_cv_have_gethostbyname,
+[AC_TRY_LINK([#include ],
+[ struct hostent *hp;
+ hp = gethostbyname("localhost");
+], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
+)
+if test "X$_bash_needmsg" = Xyes; then
+ AC_MSG_CHECKING(for gethostbyname in socket library)
+fi
+AC_MSG_RESULT($bash_cv_have_gethostbyname)
+if test "$bash_cv_have_gethostbyname" = yes; then
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+fi
+])
+
AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
[AC_MSG_CHECKING(for default mail directory)
AC_CACHE_VAL(bash_cv_mail_dir,
@@ -1299,3 +1409,19 @@ switch (0) case 0: case (sizeof (off_t) <= 4):;
if test $bash_cv_off_t_64 = yes; then
AC_DEFINE(HAVE_OFF_T_64)
fi])
+
+AC_DEFUN(BASH_STRUCT_TIMEVAL,
+[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
+AC_CACHE_VAL(bash_cv_struct_timeval,
+[
+AC_EGREP_HEADER(struct timeval, sys/time.h,
+ bash_cv_struct_timeval=yes,
+ AC_EGREP_HEADER(struct timeval, time.h,
+ bash_cv_struct_timeval=yes,
+ bash_cv_struct_timeval=no))
+])
+AC_MSG_RESULT($bash_cv_struct_timeval)
+if test $bash_cv_struct_timeval = yes; then
+ AC_DEFINE(HAVE_TIMEVAL)
+fi
+])
diff --git a/readline/ansi_stdlib.h b/readline/ansi_stdlib.h
index 52339da..a720cb9 100644
--- a/readline/ansi_stdlib.h
+++ b/readline/ansi_stdlib.h
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
- Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+ Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_STDLIB_H_)
#define _STDLIB_H_ 1
diff --git a/readline/bind.c b/readline/bind.c
index 73cd827..6a6424e 100644
--- a/readline/bind.c
+++ b/readline/bind.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -42,7 +42,6 @@
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
-#include
#include
#if !defined (errno)
@@ -58,65 +57,25 @@ extern int errno;
#include "readline.h"
#include "history.h"
+#include "rlprivate.h"
+#include "rlshell.h"
+#include "xmalloc.h"
+
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
-extern int _rl_horizontal_scroll_mode;
-extern int _rl_mark_modified_lines;
-extern int _rl_bell_preference;
-extern int _rl_meta_flag;
-extern int _rl_convert_meta_chars_to_ascii;
-extern int _rl_output_meta_chars;
-extern int _rl_complete_show_all;
-extern int _rl_complete_mark_directories;
-extern int _rl_print_completions_horizontally;
-extern int _rl_completion_case_fold;
-extern int _rl_enable_keypad;
-#if defined (PAREN_MATCHING)
-extern int rl_blink_matching_paren;
-#endif /* PAREN_MATCHING */
-#if defined (VISIBLE_STATS)
-extern int rl_visible_stats;
-#endif /* VISIBLE_STATS */
-extern int rl_complete_with_tilde_expansion;
-extern int rl_completion_query_items;
-extern int rl_inhibit_completion;
-extern char *_rl_comment_begin;
-extern unsigned char *_rl_isearch_terminators;
-
-extern int rl_explicit_arg;
-extern int rl_editing_mode;
-extern unsigned char _rl_parsing_conditionalized_out;
-extern Keymap _rl_keymap;
-
-extern char *possible_control_prefixes[], *possible_meta_prefixes[];
-
-/* Functions imported from funmap.c */
-extern char **rl_funmap_names ();
-extern int rl_add_funmap_entry ();
-
-/* Functions imported from util.c */
-extern char *_rl_strindex ();
-
-/* Functions imported from shell.c */
-extern char *get_env_value ();
-
/* Variables exported by this file. */
Keymap rl_binding_keymap;
-/* Forward declarations */
-void rl_set_keymap_from_edit_mode ();
+static int _rl_read_init_file __P((char *, int));
+static int glean_key_from_name __P((char *));
+static int substring_member_of_array __P((char *, char **));
-static int _rl_read_init_file ();
-static int glean_key_from_name ();
-static int substring_member_of_array ();
+static int currently_reading_init_file;
-extern char *xmalloc (), *xrealloc ();
+/* used only in this file */
+static int _rl_prefer_visible_bell = 1;
/* **************************************************************** */
/* */
@@ -650,7 +609,7 @@ _rl_read_file (filename, sizep)
char *buffer;
int i, file;
- if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY | O_BINARY, 0666)) < 0)
+ if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0)
return ((char *)NULL);
file_size = (size_t)finfo.st_size;
@@ -671,7 +630,7 @@ _rl_read_file (filename, sizep)
i = read (file, buffer, file_size);
close (file);
-#if 1
+#if 0
if (i < file_size)
#else
if (i < 0)
@@ -681,33 +640,16 @@ _rl_read_file (filename, sizep)
return ((char *)NULL);
}
+#if 0
buffer[file_size] = '\0';
-
-#if O_BINARY
- {
- /* Systems which distinguish between text and binary files need
- to strip the CR characters before each Newline, otherwise the
- parsing functions won't work. */
- char *s, *d;
- size_t removed = 0;
-
- for (s = buffer, d = buffer; s < buffer + file_size; s++)
- {
- if (removed)
- *d = *s;
- if (*s != '\r' || s[1] != '\n')
- d++;
- else
- removed++;
- }
-
- file_size -= removed;
- buffer[file_size] = '\0';
- }
-#endif
-
if (sizep)
*sizep = file_size;
+#else
+ buffer[i] = '\0';
+ if (sizep)
+ *sizep = i;
+#endif
+
return (buffer);
}
@@ -727,7 +669,6 @@ rl_re_read_init_file (count, ignore)
1. the filename used for the previous call
2. the value of the shell variable `INPUTRC'
3. ~/.inputrc
- 4. (for __MSDOS__ only) ~/_inputrc
If the file existed and could be opened and read, 0 is returned,
otherwise errno is returned. */
int
@@ -747,20 +688,11 @@ rl_read_init_file (filename)
if (*filename == 0)
filename = DEFAULT_INPUTRC;
-#ifdef __MSDOS__
- {
- /* DOS doesn't allow leading dots in file names. If the original
- name fails (it could work if we are on Windows), fall back to
- ~/_inputrc. */
- int retval = _rl_read_init_file (filename, 0);
-
- if (retval == 0)
- return retval;
- else if (strcmp (filename, "~/.inputrc") == 0)
- filename = "~/_inputrc";
- }
+#if defined (__MSDOS__)
+ if (_rl_read_init_file (filename, 0) == 0)
+ return 0;
+ filename = "~/_inputrc";
#endif
-
return (_rl_read_init_file (filename, 0));
}
@@ -789,6 +721,8 @@ _rl_read_init_file (filename, include_level)
last_readline_init_file = savestring (filename);
}
+ currently_reading_init_file = 1;
+
/* Loop over the lines in the file. Lines that start with `#' are
comments; all other lines are commands for readline initialization. */
current_readline_init_lineno = 1;
@@ -799,6 +733,12 @@ _rl_read_init_file (filename, include_level)
/* Find the end of this line. */
for (i = 0; line + i != end && line[i] != '\n'; i++);
+#if defined (__CYGWIN32__)
+ /* ``Be liberal in what you accept.'' */
+ if (line[i] == '\n' && line[i-1] == '\r')
+ line[i - 1] = '\0';
+#endif
+
/* Mark end of line. */
line[i] = '\0';
@@ -819,6 +759,7 @@ _rl_read_init_file (filename, include_level)
}
free (buffer);
+ currently_reading_init_file = 0;
return (0);
}
@@ -826,9 +767,11 @@ static void
_rl_init_file_error (msg)
char *msg;
{
- fprintf (stderr, "readline: %s: line %d: %s\n", current_readline_init_file,
- current_readline_init_lineno,
- msg);
+ if (currently_reading_init_file)
+ fprintf (stderr, "readline: %s: line %d: %s\n", current_readline_init_file,
+ current_readline_init_lineno, msg);
+ else
+ fprintf (stderr, "readline: %s\n", msg);
}
/* **************************************************************** */
@@ -1275,154 +1218,273 @@ rl_parse_and_bind (string)
have one of two values; either "On" or 1 for truth, or "Off" or 0 for
false. */
+#define V_SPECIAL 0x1
+
static struct {
char *name;
int *value;
+ int flags;
} boolean_varlist [] = {
-#if defined (PAREN_MATCHING)
- { "blink-matching-paren", &rl_blink_matching_paren },
-#endif
- { "completion-ignore-case", &_rl_completion_case_fold },
- { "convert-meta", &_rl_convert_meta_chars_to_ascii },
- { "disable-completion", &rl_inhibit_completion },
- { "enable-keypad", &_rl_enable_keypad },
- { "expand-tilde", &rl_complete_with_tilde_expansion },
- { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode },
- { "input-meta", &_rl_meta_flag },
- { "mark-directories", &_rl_complete_mark_directories },
- { "mark-modified-lines", &_rl_mark_modified_lines },
- { "meta-flag", &_rl_meta_flag },
- { "output-meta", &_rl_output_meta_chars },
- { "print-completions-horizontally", &_rl_print_completions_horizontally },
- { "show-all-if-ambiguous", &_rl_complete_show_all },
+ { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL },
+ { "completion-ignore-case", &_rl_completion_case_fold, 0 },
+ { "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 },
+ { "disable-completion", &rl_inhibit_completion, 0 },
+ { "enable-keypad", &_rl_enable_keypad, 0 },
+ { "expand-tilde", &rl_complete_with_tilde_expansion, 0 },
+ { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 },
+ { "input-meta", &_rl_meta_flag, 0 },
+ { "mark-directories", &_rl_complete_mark_directories, 0 },
+ { "mark-modified-lines", &_rl_mark_modified_lines, 0 },
+ { "meta-flag", &_rl_meta_flag, 0 },
+ { "output-meta", &_rl_output_meta_chars, 0 },
+ { "prefer-visible-bell", &_rl_prefer_visible_bell, V_SPECIAL },
+ { "print-completions-horizontally", &_rl_print_completions_horizontally, 0 },
+ { "show-all-if-ambiguous", &_rl_complete_show_all, 0 },
#if defined (VISIBLE_STATS)
- { "visible-stats", &rl_visible_stats },
+ { "visible-stats", &rl_visible_stats, 0 },
#endif /* VISIBLE_STATS */
{ (char *)NULL, (int *)NULL }
};
+static int
+find_boolean_var (name)
+ char *name;
+{
+ register int i;
+
+ for (i = 0; boolean_varlist[i].name; i++)
+ if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
+ return i;
+ return -1;
+}
+
+/* Hooks for handling special boolean variables, where a
+ function needs to be called or another variable needs
+ to be changed when they're changed. */
+static void
+hack_special_boolean_var (i)
+ int i;
+{
+ char *name;
+
+ name = boolean_varlist[i].name;
+
+ if (_rl_stricmp (name, "blink-matching-paren") == 0)
+ _rl_enable_paren_matching (rl_blink_matching_paren);
+ else if (_rl_stricmp (name, "prefer-visible-bell") == 0)
+ {
+ if (_rl_prefer_visible_bell)
+ _rl_bell_preference = VISIBLE_BELL;
+ else
+ _rl_bell_preference = AUDIBLE_BELL;
+ }
+}
+
+/* These *must* correspond to the array indices for the appropriate
+ string variable. (Though they're not used right now.) */
+#define V_BELLSTYLE 0
+#define V_COMBEGIN 1
+#define V_EDITMODE 2
+#define V_ISRCHTERM 3
+#define V_KEYMAP 4
+
+#define V_STRING 1
+#define V_INT 2
+
+/* Forward declarations */
+static int sv_bell_style __P((char *));
+static int sv_combegin __P((char *));
+static int sv_compquery __P((char *));
+static int sv_editmode __P((char *));
+static int sv_isrchterm __P((char *));
+static int sv_keymap __P((char *));
+
+static struct {
+ char *name;
+ int flags;
+ Function *set_func;
+} string_varlist[] = {
+ { "bell-style", V_STRING, sv_bell_style },
+ { "comment-begin", V_STRING, sv_combegin },
+ { "completion-query-items", V_INT, sv_compquery },
+ { "editing-mode", V_STRING, sv_editmode },
+ { "isearch-terminators", V_STRING, sv_isrchterm },
+ { "keymap", V_STRING, sv_keymap },
+ { (char *)NULL, 0 }
+};
+
+static int
+find_string_var (name)
+ char *name;
+{
+ register int i;
+
+ for (i = 0; string_varlist[i].name; i++)
+ if (_rl_stricmp (name, string_varlist[i].name) == 0)
+ return i;
+ return -1;
+}
+
+/* A boolean value that can appear in a `set variable' command is true if
+ the value is null or empty, `on' (case-insenstive), or "1". Any other
+ values result in 0 (false). */
+static int
+bool_to_int (value)
+ char *value;
+{
+ return (value == 0 || *value == '\0' ||
+ (_rl_stricmp (value, "on") == 0) ||
+ (value[0] == '1' && value[1] == '\0'));
+}
+
int
rl_variable_bind (name, value)
char *name, *value;
{
register int i;
+ int v;
/* Check for simple variables first. */
- for (i = 0; boolean_varlist[i].name; i++)
+ i = find_boolean_var (name);
+ if (i >= 0)
{
- if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
- {
- /* A variable is TRUE if the "value" is "on", "1" or "". */
- *boolean_varlist[i].value = *value == 0 ||
- _rl_stricmp (value, "on") == 0 ||
- (value[0] == '1' && value[1] == '\0');
- return 0;
- }
+ *boolean_varlist[i].value = bool_to_int (value);
+ if (boolean_varlist[i].flags & V_SPECIAL)
+ hack_special_boolean_var (i);
+ return 0;
}
- /* Not a boolean variable, so check for specials. */
+ i = find_string_var (name);
+
+ /* For the time being, unknown variable names or string names without a
+ handler function are simply ignored. */
+ if (i < 0 || string_varlist[i].set_func == 0)
+ return 0;
+
+ v = (*string_varlist[i].set_func) (value);
+ return v;
+}
- /* Editing mode change? */
- if (_rl_stricmp (name, "editing-mode") == 0)
+static int
+sv_editmode (value)
+ char *value;
+{
+ if (_rl_strnicmp (value, "vi", 2) == 0)
{
- if (_rl_strnicmp (value, "vi", 2) == 0)
- {
#if defined (VI_MODE)
- _rl_keymap = vi_insertion_keymap;
- rl_editing_mode = vi_mode;
+ _rl_keymap = vi_insertion_keymap;
+ rl_editing_mode = vi_mode;
#endif /* VI_MODE */
- }
- else if (_rl_strnicmp (value, "emacs", 5) == 0)
- {
- _rl_keymap = emacs_standard_keymap;
- rl_editing_mode = emacs_mode;
- }
+ return 0;
}
-
- /* Comment string change? */
- else if (_rl_stricmp (name, "comment-begin") == 0)
+ else if (_rl_strnicmp (value, "emacs", 5) == 0)
{
- if (*value)
- {
- if (_rl_comment_begin)
- free (_rl_comment_begin);
-
- _rl_comment_begin = savestring (value);
- }
+ _rl_keymap = emacs_standard_keymap;
+ rl_editing_mode = emacs_mode;
+ return 0;
}
- else if (_rl_stricmp (name, "completion-query-items") == 0)
+ return 1;
+}
+
+static int
+sv_combegin (value)
+ char *value;
+{
+ if (value && *value)
{
- int nval = 100;
- if (*value)
- {
- nval = atoi (value);
- if (nval < 0)
- nval = 0;
- }
- rl_completion_query_items = nval;
+ FREE (_rl_comment_begin);
+ _rl_comment_begin = savestring (value);
+ return 0;
}
- else if (_rl_stricmp (name, "keymap") == 0)
+ return 1;
+}
+
+static int
+sv_compquery (value)
+ char *value;
+{
+ int nval = 100;
+
+ if (value && *value)
{
- Keymap kmap;
- kmap = rl_get_keymap_by_name (value);
- if (kmap)
- rl_set_keymap (kmap);
+ nval = atoi (value);
+ if (nval < 0)
+ nval = 0;
}
- else if (_rl_stricmp (name, "bell-style") == 0)
+ rl_completion_query_items = nval;
+ return 0;
+}
+
+static int
+sv_keymap (value)
+ char *value;
+{
+ Keymap kmap;
+
+ kmap = rl_get_keymap_by_name (value);
+ if (kmap)
{
- if (!*value)
- _rl_bell_preference = AUDIBLE_BELL;
- else
- {
- if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0)
- _rl_bell_preference = NO_BELL;
- else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0)
- _rl_bell_preference = AUDIBLE_BELL;
- else if (_rl_stricmp (value, "visible") == 0)
- _rl_bell_preference = VISIBLE_BELL;
- }
+ rl_set_keymap (kmap);
+ return 0;
}
- else if (_rl_stricmp (name, "prefer-visible-bell") == 0)
+ return 1;
+}
+
+#define _SET_BELL(v) do { _rl_bell_preference = v; return 0; } while (0)
+
+static int
+sv_bell_style (value)
+ char *value;
+{
+ if (value == 0 || *value == '\0')
+ _SET_BELL (AUDIBLE_BELL);
+ else if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0)
+ _SET_BELL (NO_BELL);
+ else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0)
+ _SET_BELL (AUDIBLE_BELL);
+ else if (_rl_stricmp (value, "visible") == 0)
+ _SET_BELL (VISIBLE_BELL);
+ else
+ return 1;
+}
+#undef _SET_BELL
+
+static int
+sv_isrchterm (value)
+ char *value;
+{
+ int beg, end, delim;
+ char *v;
+
+ if (value == 0)
+ return 1;
+
+ /* Isolate the value and translate it into a character string. */
+ v = savestring (value);
+ FREE (_rl_isearch_terminators);
+ if (v[0] == '"' || v[0] == '\'')
{
- /* Backwards compatibility. */
- if (*value && (_rl_stricmp (value, "on") == 0 ||
- (*value == '1' && !value[1])))
- _rl_bell_preference = VISIBLE_BELL;
- else
- _rl_bell_preference = AUDIBLE_BELL;
+ delim = v[0];
+ for (beg = end = 1; v[end] && v[end] != delim; end++)
+ ;
}
- else if (_rl_stricmp (name, "isearch-terminators") == 0)
+ else
{
- /* Isolate the value and translate it into a character string. */
- int beg, end;
- char *v;
+ for (beg = end = 0; whitespace (v[end]) == 0; end++)
+ ;
+ }
- v = savestring (value);
- FREE (_rl_isearch_terminators);
- if (v[0] == '"' || v[0] == '\'')
- {
- int delim = v[0];
- for (beg = end = 1; v[end] && v[end] != delim; end++)
- ;
- }
- else
- {
- for (beg = end = 0; whitespace (v[end]) == 0; end++)
- ;
- }
+ v[end] = '\0';
- v[end] = '\0';
- /* The value starts at v + beg. Translate it into a character string. */
- _rl_isearch_terminators = (unsigned char *)xmalloc (2 * strlen (v) + 1);
- rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end);
- _rl_isearch_terminators[end] = '\0';
- free (v);
- }
-
- /* For the time being, unknown variable names are simply ignored. */
+ /* The value starts at v + beg. Translate it into a character string. */
+ _rl_isearch_terminators = (unsigned char *)xmalloc (2 * strlen (v) + 1);
+ rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end);
+ _rl_isearch_terminators[end] = '\0';
+
+ free (v);
return 0;
}
-
+
/* Return the character which matches NAME.
For example, `Space' returns ' '. */
diff --git a/readline/callback.c b/readline/callback.c
index 6915be4..1172356 100644
--- a/readline/callback.c
+++ b/readline/callback.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -35,15 +35,7 @@
/* System-specific feature definitions and include files. */
#include "rldefs.h"
#include "readline.h"
-
-extern void readline_internal_setup ();
-extern char *readline_internal_teardown ();
-extern int readline_internal_char ();
-extern void _rl_init_line_state ();
-
-extern int _rl_meta_flag;
-extern char *rl_prompt;
-extern int rl_visible_prompt_length;
+#include "rlprivate.h"
/* **************************************************************** */
/* */
diff --git a/readline/chardefs.h b/readline/chardefs.h
index 3e9e273..664c1e4 100644
--- a/readline/chardefs.h
+++ b/readline/chardefs.h
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _CHARDEFS_H_
#define _CHARDEFS_H_
diff --git a/readline/complete.c b/readline/complete.c
index 1188120..fb48712 100644
--- a/readline/complete.c
+++ b/readline/complete.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -70,20 +70,14 @@ extern struct passwd *getpwent ();
/* Some standard library routines. */
#include "readline.h"
+#include "xmalloc.h"
+#include "rlprivate.h"
-extern char *tilde_expand ();
-extern char *rl_copy_text ();
-extern void _rl_abort_internal ();
-extern int _rl_qsort_string_compare ();
-extern void _rl_replace_text ();
-
-extern Function *rl_last_func;
-extern int rl_editing_mode;
-extern int screenwidth;
-
-extern void _rl_move_vert ();
-extern int _rl_vis_botlin;
-extern int rl_display_fixed;
+#ifdef __STDC__
+typedef int QSFUNC (const void *, const void *);
+#else
+typedef int QSFUNC ();
+#endif
/* If non-zero, then this is the address of a function to call when
completing a word would normally display the list of possible matches.
@@ -95,27 +89,25 @@ extern int rl_display_fixed;
VFunction *rl_completion_display_matches_hook = (VFunction *)NULL;
/* Forward declarations for functions defined and used in this file. */
-char *filename_completion_function ();
-char **completion_matches ();
+char *filename_completion_function __P((char *, int));
+char **completion_matches __P((char *, CPFunction *));
#if defined (VISIBLE_STATS)
# if !defined (X_OK)
# define X_OK 1
# endif
-static int stat_char ();
+static int stat_char __P((char *));
#endif
-static char *rl_quote_filename ();
-static char *rl_strpbrk ();
-
-static char **remove_duplicate_matches ();
-static void insert_match ();
-static int append_to_match ();
-static void insert_all_matches ();
-static void display_matches ();
-static int compute_lcd_of_matches ();
+static char *rl_quote_filename __P((char *, int, char *));
+static char *rl_strpbrk __P((char *, char *));
-extern char *xmalloc (), *xrealloc ();
+static char **remove_duplicate_matches __P((char **));
+static void insert_match __P((char *, int, int, char *));
+static int append_to_match __P((char *, int, int));
+static void insert_all_matches __P((char **, int, char *));
+static void display_matches __P((char **));
+static int compute_lcd_of_matches __P((char **, int, char *));
/* **************************************************************** */
/* */
@@ -136,7 +128,11 @@ int _rl_complete_mark_directories = 1;
int _rl_print_completions_horizontally;
/* Non-zero means that case is not significant in filename completion. */
+#if defined (__MSDOS__) && !defined (__DJGPP__)
+int _rl_completion_case_fold = 1;
+#else
int _rl_completion_case_fold;
+#endif
/* Global variables available to applications using readline. */
@@ -417,6 +413,10 @@ printable_part (pathname)
char *temp;
temp = rl_filename_completion_desired ? strrchr (pathname, '/') : (char *)NULL;
+#if defined (__MSDOS__)
+ if (rl_filename_completion_desired && temp == 0 && isalpha (pathname[0]) && pathname[1] == ':')
+ temp = pathname + 1;
+#endif
return (temp ? ++temp : pathname);
}
@@ -477,7 +477,12 @@ print_filename (to_print, full_pathname)
c = to_print[-1];
to_print[-1] = '\0';
- s = tilde_expand (full_pathname);
+ /* If setting the last slash in full_pathname to a NUL results in
+ full_pathname being the empty string, we are trying to complete
+ files in the root directory. If we pass a null string to the
+ bash directory completion hook, for example, it will expand it
+ to the current directory. We just want the `/'. */
+ s = tilde_expand (full_pathname && *full_pathname ? full_pathname : "/");
if (rl_directory_completion_hook)
(*rl_directory_completion_hook) (&s);
@@ -627,25 +632,31 @@ find_completion_word (fp, dp)
/* If there is an application-specific function to say whether or not
a character is quoted and we found a quote character, let that
function decide whether or not a character is a word break, even
- if it is found in rl_completer_word_break_characters. */
- if (rl_char_is_quoted_p)
- isbrk = (found_quote == 0 ||
- (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) &&
- strchr (rl_completer_word_break_characters, scan) != 0;
- else
- isbrk = strchr (rl_completer_word_break_characters, scan) != 0;
-
- if (isbrk)
+ if it is found in rl_completer_word_break_characters. Don't bother
+ if we're at the end of the line, though. */
+ if (scan)
{
- /* If the character that caused the word break was a quoting
- character, then remember it as the delimiter. */
- if (rl_basic_quote_characters && strchr (rl_basic_quote_characters, scan) && (end - rl_point) > 1)
- delimiter = scan;
-
- /* If the character isn't needed to determine something special
- about what kind of completion to perform, then advance past it. */
- if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0)
- rl_point++;
+ if (rl_char_is_quoted_p)
+ isbrk = (found_quote == 0 ||
+ (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) &&
+ strchr (rl_completer_word_break_characters, scan) != 0;
+ else
+ isbrk = strchr (rl_completer_word_break_characters, scan) != 0;
+
+ if (isbrk)
+ {
+ /* If the character that caused the word break was a quoting
+ character, then remember it as the delimiter. */
+ if (rl_basic_quote_characters &&
+ strchr (rl_basic_quote_characters, scan) &&
+ (end - rl_point) > 1)
+ delimiter = scan;
+
+ /* If the character isn't needed to determine something special
+ about what kind of completion to perform, then advance past it. */
+ if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0)
+ rl_point++;
+ }
}
if (fp)
@@ -715,7 +726,7 @@ remove_duplicate_matches (matches)
/* Sort the array without matches[0], since we need it to
stay in place no matter what. */
if (i)
- qsort (matches+1, i-1, sizeof (char *), _rl_qsort_string_compare);
+ qsort (matches+1, i-1, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
/* Remember the lowest common denominator for it may be unique. */
lowest_common = savestring (matches[0]);
@@ -908,7 +919,7 @@ rl_display_match_list (matches, len, max)
/* Sort the items if they are not already sorted. */
if (rl_ignore_completion_duplicates == 0)
- qsort (matches + 1, len, sizeof (char *), _rl_qsort_string_compare);
+ qsort (matches + 1, len, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
crlf ();
@@ -1409,7 +1420,7 @@ username_completion_function (text, state)
{
#if defined (__WIN32__) || defined (__OPENNT)
return (char *)NULL;
-#else /* !__WIN32__ && !__OPENNT */
+#else /* !__WIN32__ && !__OPENNT) */
static char *username = (char *)NULL;
static struct passwd *entry;
static int namelen, first_char, first_char_loc;
@@ -1452,7 +1463,7 @@ username_completion_function (text, state)
return (value);
}
-#endif /* !__GO32__ */
+#endif /* !__WIN32__ && !__OPENNT */
}
/* Okay, now we write the entry_function for filename completion. In the
@@ -1494,18 +1505,24 @@ filename_completion_function (text, state)
temp = strrchr (dirname, '/');
+#if defined (__MSDOS__)
+ /* special hack for //X/... */
+ if (dirname[0] == '/' && dirname[1] == '/' && isalpha (dirname[2]) && dirname[3] == '/')
+ temp = strrchr (dirname + 3, '/');
+#endif
+
if (temp)
{
strcpy (filename, ++temp);
*temp = '\0';
}
-#if defined (__WIN32__) || defined (__OPENNT) || defined (__MSDOS__)
- /* Handle the drive-relative names "d:foo/bar". */
- else if (dirname[1] == ':')
- {
- strcpy (filename, dirname + 2);
- dirname[2] = '\0';
- }
+#if defined (__MSDOS__)
+ /* searches from current directory on the drive */
+ else if (isalpha (dirname[0]) && dirname[1] == ':')
+ {
+ strcpy (filename, dirname + 2);
+ dirname[2] = '\0';
+ }
#endif
else
{
@@ -1668,11 +1685,7 @@ rl_menu_complete (count, ignore)
/* Clean up from previous call, if any. */
FREE (orig_text);
if (matches)
- {
- for (match_list_index = 0; matches[match_list_index]; match_list_index++)
- free (matches[match_list_index]);
- free (matches);
- }
+ free_match_list (matches);
match_list_index = match_list_size = 0;
matches = (char **)NULL;
diff --git a/readline/config.h.in b/readline/config.h.in
index 87f807f..569e53d 100644
--- a/readline/config.h.in
+++ b/readline/config.h.in
@@ -57,6 +57,9 @@
/* Define if you have the lstat function. */
#undef HAVE_LSTAT
+/* Define if you have the memmove function. */
+#undef HAVE_MEMMOVE
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
diff --git a/readline/configure b/readline/configure
index cdcdf88..ae9bf94 100755
--- a/readline/configure
+++ b/readline/configure
@@ -1,7 +1,19 @@
#! /bin/sh
-# From configure.in for Readline 4.0, version 2.14, from autoconf version 2.13
-LIBVERSION=4.0
+# From configure.in for Readline 4.1, version 2.22, from autoconf version 2.13
+LIBVERSION=4.1
+
+
+
+
+
+
+
+
+
+
+
+
@@ -121,7 +133,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -236,7 +247,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -407,11 +417,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -577,16 +582,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -656,7 +657,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:660: checking host system type" >&5
+echo "configure:661: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -697,7 +698,7 @@ test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:701: checking for $ac_word" >&5
+echo "configure:702: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -727,7 +728,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:731: checking for $ac_word" >&5
+echo "configure:732: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -778,7 +779,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:782: checking for $ac_word" >&5
+echo "configure:783: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -810,7 +811,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -821,12 +822,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 825 "configure"
+#line 826 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -852,12 +853,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:856: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:857: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:861: checking whether we are using GNU C" >&5
+echo "configure:862: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -866,7 +867,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -885,7 +886,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:889: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:890: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -917,7 +918,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:921: checking how to run the C preprocessor" >&5
+echo "configure:922: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -932,13 +933,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -949,13 +950,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -966,13 +967,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -998,17 +999,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1002: checking for minix/config.h" >&5
+echo "configure:1003: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1085,13 +1086,13 @@ test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1089: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1090: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <
Autoconf TIOCGETP
@@ -1109,7 +1110,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <
Autoconf TCGETA
@@ -1142,7 +1143,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1146: checking for a BSD compatible install" >&5
+echo "configure:1147: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1197,7 +1198,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1201: checking for $ac_word" >&5
+echo "configure:1202: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1227,7 +1228,7 @@ test -n "$ARFLAGS" || ARFLAGS="cr"
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1231: checking for $ac_word" >&5
+echo "configure:1232: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1259,12 +1260,12 @@ MAKE_SHELL=/bin/sh
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1263: checking return type of signal handlers" >&5
+echo "configure:1264: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1281,7 +1282,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1301,12 +1302,12 @@ EOF
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1305: checking whether stat file-mode macros are broken" >&5
+echo "configure:1306: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1361,12 +1362,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1365: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1366: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include <$ac_hdr>
@@ -1374,7 +1375,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1399,7 +1400,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1403: checking for opendir in -ldir" >&5
+echo "configure:1404: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1407,7 +1408,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1440,7 +1441,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1444: checking for opendir in -lx" >&5
+echo "configure:1445: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1448,7 +1449,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1482,15 +1483,16 @@ fi
fi
-for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat
+for ac_func in lstat memmove putenv select setenv setlocale \
+ strcasecmp tcgetattr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1489: checking for $ac_func" >&5
+echo "configure:1491: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1539,7 +1541,7 @@ done
echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:1543: checking for working strcoll" >&5
+echo "configure:1545: checking for working strcoll" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1547,7 +1549,7 @@ else
ac_cv_func_strcoll_works=no
else
cat > conftest.$ac_ext <
main ()
@@ -1557,7 +1559,7 @@ main ()
strcoll ("123", "456") >= 0);
}
EOF
-if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strcoll_works=yes
else
@@ -1586,17 +1588,17 @@ for ac_hdr in unistd.h stdlib.h varargs.h stdarg.h string.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1590: checking for $ac_hdr" >&5
+echo "configure:1592: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1625,13 +1627,13 @@ done
echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
-echo "configure:1629: checking for type of signal functions" >&5
+echo "configure:1631: checking for type of signal functions" >&5
if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
int main() {
@@ -1644,7 +1646,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=posix
else
@@ -1653,7 +1655,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <
int main() {
@@ -1663,7 +1665,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=4.2bsd
else
@@ -1672,7 +1674,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <
@@ -1685,7 +1687,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=svr3
else
@@ -1726,7 +1728,7 @@ fi
echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
-echo "configure:1730: checking if signal handlers must be reinstalled when invoked" >&5
+echo "configure:1732: checking if signal handlers must be reinstalled when invoked" >&5
if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1736,7 +1738,7 @@ else
else
cat > conftest.$ac_ext <
@@ -1783,7 +1785,7 @@ main()
}
EOF
-if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_must_reinstall_sighandlers=no
else
@@ -1808,7 +1810,7 @@ fi
echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
-echo "configure:1812: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
+echo "configure:1814: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1818,7 +1820,7 @@ else
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_sigsetjmp=present
else
@@ -1882,12 +1884,12 @@ EOF
fi
echo $ac_n "checking for lstat""... $ac_c" 1>&6
-echo "configure:1886: checking for lstat" >&5
+echo "configure:1888: checking for lstat" >&5
if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
@@ -1897,7 +1899,7 @@ int main() {
lstat(".",(struct stat *)0);
; return 0; }
EOF
-if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_func_lstat=yes
else
@@ -1918,12 +1920,12 @@ EOF
fi
echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
-echo "configure:1922: checking whether programs are able to redeclare getpw functions" >&5
+echo "configure:1924: checking whether programs are able to redeclare getpw functions" >&5
if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1934,7 +1936,7 @@ int main() {
struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
; return 0; }
EOF
-if { (eval echo configure:1938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_can_redecl_getpw=yes
else
@@ -1956,7 +1958,7 @@ fi
echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
-echo "configure:1960: checking whether or not strcoll and strcmp differ" >&5
+echo "configure:1962: checking whether or not strcoll and strcmp differ" >&5
if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1966,7 +1968,7 @@ else
else
cat > conftest.$ac_ext <
@@ -2005,7 +2007,7 @@ char *v[];
}
EOF
-if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_strcoll_broken=yes
else
@@ -2029,12 +2031,12 @@ fi
echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
-echo "configure:2033: checking whether signal handlers are of type void" >&5
+echo "configure:2035: checking whether signal handlers are of type void" >&5
if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2049,7 +2051,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_void_sighandler=yes
else
@@ -2069,12 +2071,12 @@ EOF
fi
echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2073: checking for TIOCGWINSZ in sys/ioctl.h" >&5
+echo "configure:2075: checking for TIOCGWINSZ in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2082,7 +2084,7 @@ int main() {
int x = TIOCGWINSZ;
; return 0; }
EOF
-if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocgwinsz_in_ioctl=yes
else
@@ -2103,12 +2105,12 @@ EOF
fi
echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2107: checking for TIOCSTAT in sys/ioctl.h" >&5
+echo "configure:2109: checking for TIOCSTAT in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2116,7 +2118,7 @@ int main() {
int x = TIOCSTAT;
; return 0; }
EOF
-if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocstat_in_ioctl=yes
else
@@ -2137,12 +2139,12 @@ EOF
fi
echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2141: checking for FIONREAD in sys/ioctl.h" >&5
+echo "configure:2143: checking for FIONREAD in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2150,7 +2152,7 @@ int main() {
int x = FIONREAD;
; return 0; }
EOF
-if { (eval echo configure:2154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_fionread_in_ioctl=yes
else
@@ -2171,19 +2173,19 @@ EOF
fi
echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2175: checking for speed_t in sys/types.h" >&5
+echo "configure:2177: checking for speed_t in sys/types.h" >&5
if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
int main() {
speed_t x;
; return 0; }
EOF
-if { (eval echo configure:2187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_speed_t_in_sys_types=yes
else
@@ -2204,12 +2206,12 @@ EOF
fi
echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
-echo "configure:2208: checking for struct winsize in sys/ioctl.h and termios.h" >&5
+echo "configure:2210: checking for struct winsize in sys/ioctl.h and termios.h" >&5
if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2217,7 +2219,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=ioctl_h
else
@@ -2225,7 +2227,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <
#include
@@ -2233,7 +2235,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=termios_h
else
@@ -2266,12 +2268,12 @@ fi
echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
-echo "configure:2270: checking if struct dirent has a d_ino member" >&5
+echo "configure:2272: checking if struct dirent has a d_ino member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
@@ -2300,7 +2302,7 @@ struct dirent d; int z; z = d.d_ino;
; return 0; }
EOF
-if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_dino=yes
else
@@ -2322,12 +2324,12 @@ fi
echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
-echo "configure:2326: checking if struct dirent has a d_fileno member" >&5
+echo "configure:2328: checking if struct dirent has a d_fileno member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
@@ -2356,7 +2358,7 @@ struct dirent d; int z; z = d.d_fileno;
; return 0; }
EOF
-if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_d_fileno=yes
else
@@ -2385,14 +2387,14 @@ if test "X$bash_cv_termcap_lib" = "X"; then
_bash_needmsg=yes
else
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2389: checking which library has the termcap functions" >&5
+echo "configure:2391: checking which library has the termcap functions" >&5
_bash_needmsg=
fi
if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:2396: checking for tgetent in -ltermcap" >&5
+echo "configure:2398: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2400,7 +2402,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2430,7 +2432,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:2434: checking for tgetent in -lcurses" >&5
+echo "configure:2436: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2438,7 +2440,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2468,7 +2470,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:2472: checking for tgetent in -lncurses" >&5
+echo "configure:2474: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2476,7 +2478,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2516,7 +2518,7 @@ fi
if test "X$_bash_needmsg" = "Xyes"; then
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2520: checking which library has the termcap functions" >&5
+echo "configure:2522: checking which library has the termcap functions" >&5
fi
echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
@@ -2553,8 +2555,8 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
echo $ac_n "checking configuration for building shared libraries""... $ac_c" 1>&6
-echo "configure:2557: checking configuration for building shared libraries" >&5
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+echo "configure:2559: checking configuration for building shared libraries" >&5
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
@@ -2568,9 +2570,20 @@ echo "configure:2557: checking configuration for building shared libraries" >&5
echo "$ac_t""$SHLIB_STATUS" 1>&6
+
+ # shared library versioning
+ # quoted for m4 so I can use character classes
+ SHLIB_MAJOR=`expr "$LIBVERSION" : '\([0-9]\)\..*'`
+ SHLIB_MINOR=`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`
+
+
fi
-BUILD_DIR=`pwd`
+case "$host_os" in
+msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
+*) BUILD_DIR=`pwd` ;;
+esac
+
@@ -2748,6 +2761,8 @@ s%@SHLIB_XLDFLAGS@%$SHLIB_XLDFLAGS%g
s%@SHLIB_LIBSUFF@%$SHLIB_LIBSUFF%g
s%@SHLIB_LIBVERSION@%$SHLIB_LIBVERSION%g
s%@SHLIB_LIBS@%$SHLIB_LIBS%g
+s%@SHLIB_MAJOR@%$SHLIB_MAJOR%g
+s%@SHLIB_MINOR@%$SHLIB_MINOR%g
s%@BUILD_DIR@%$BUILD_DIR%g
s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g
s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
diff --git a/readline/configure.in b/readline/configure.in
index 9afdaa7..780b4df 100644
--- a/readline/configure.in
+++ b/readline/configure.in
@@ -4,8 +4,8 @@ dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION)
-LIBVERSION=4.0
+AC_REVISION([for Readline 4.1, version 2.22, from autoconf version] AC_ACVERSION)
+LIBVERSION=4.1
AC_INIT(readline.h)
AC_CONFIG_HEADER(config.h)
@@ -32,6 +32,7 @@ fi
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_CC
+dnl AC_AIX
AC_MINIX
dnl BEGIN changes for CYGNUS cross-building for Cygwin
@@ -91,7 +92,8 @@ AC_RETSIGTYPE
AC_HEADER_STAT
AC_HEADER_DIRENT
-AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
+AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
+ strcasecmp tcgetattr)
AC_FUNC_STRCOLL
@@ -140,7 +142,7 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
@@ -154,9 +156,20 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
+
+ # shared library versioning
+ # quoted for m4 so I can use character classes
+ SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
+ SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
+ AC_SUBST(SHLIB_MAJOR)
+ AC_SUBST(SHLIB_MINOR)
fi
-BUILD_DIR=`pwd`
+case "$host_os" in
+msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
+*) BUILD_DIR=`pwd` ;;
+esac
+
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
diff --git a/readline/display.c b/readline/display.c
index 3215a94..4487004 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -41,11 +41,6 @@
#include
-#if defined (__GO32__)
-# include
-# include
-#endif /* __GO32__ */
-
/* System-specific feature definitions and include files. */
#include "rldefs.h"
@@ -56,48 +51,25 @@
#include "readline.h"
#include "history.h"
+#include "rlprivate.h"
+#include "xmalloc.h"
+
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
-/* Global and pseudo-global variables and functions
- imported from readline.c. */
-extern char *rl_prompt;
-extern int readline_echoing_p;
-
-extern int _rl_output_meta_chars;
-extern int _rl_horizontal_scroll_mode;
-extern int _rl_mark_modified_lines;
-extern int _rl_prefer_visible_bell;
-
-/* Variables and functions imported from terminal.c */
-extern void _rl_output_some_chars ();
-#ifdef _MINIX
-extern void _rl_output_character_function ();
-#else
-extern int _rl_output_character_function ();
+#if defined (HACK_TERMCAP_MOTION)
+extern char *term_forward_char;
#endif
-extern int _rl_backspace ();
-
-extern char *term_clreol, *term_clrpag;
-extern char *term_im, *term_ic, *term_ei, *term_DC;
-extern char *term_up, *term_dc, *term_cr, *term_IC;
-extern int screenheight, screenwidth, screenchars;
-extern int terminal_can_insert, _rl_term_autowrap;
-/* Pseudo-global functions (local to the readline library) exported
- by this file. */
-void _rl_move_cursor_relative (), _rl_output_some_chars ();
-void _rl_move_vert ();
-void _rl_clear_to_eol (), _rl_clear_screen ();
-
-static void update_line (), space_to_eol ();
-static void delete_chars (), insert_some_chars ();
-static void cr ();
+static void update_line __P((char *, char *, int, int, int, int));
+static void space_to_eol __P((int));
+static void delete_chars __P((int));
+static void insert_some_chars __P((char *, int));
+static void cr __P((void));
static int *inv_lbreaks, *vis_lbreaks;
-
-extern char *xmalloc (), *xrealloc ();
+static int inv_lbsize, vis_lbsize;
/* Heuristic used to decide whether it is faster to move from CUR to NEW
by backing up or outputting a carriage return and moving forward. */
@@ -190,7 +162,7 @@ static int visible_first_line_len;
/* Expand the prompt string S and return the number of visible
characters in *LP, if LP is not null. This is currently more-or-less
a placeholder for expansion. LIP, if non-null is a place to store the
- index of the last invisible character in ther eturned string. */
+ index of the last invisible character in the returned string. */
/* Current implementation:
\001 (^A) start non-visible characters
@@ -250,6 +222,18 @@ expand_prompt (pmt, lp, lip)
return ret;
}
+/* Just strip out RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE from
+ PMT and return the rest of PMT. */
+char *
+_rl_strip_prompt (pmt)
+ char *pmt;
+{
+ char *ret;
+
+ ret = expand_prompt (pmt, (int *)NULL, (int *)NULL);
+ return ret;
+}
+
/*
* Expand the prompt string into the various display components, if
* necessary.
@@ -307,6 +291,49 @@ rl_expand_prompt (prompt)
}
}
+/* Initialize the VISIBLE_LINE and INVISIBLE_LINE arrays, and their associated
+ arrays of line break markers. MINSIZE is the minimum size of VISIBLE_LINE
+ and INVISIBLE_LINE; if it is greater than LINE_SIZE, LINE_SIZE is
+ increased. If the lines have already been allocated, this ensures that
+ they can hold at least MINSIZE characters. */
+static void
+init_line_structures (minsize)
+ int minsize;
+{
+ register int n;
+
+ if (invisible_line == 0) /* initialize it */
+ {
+ if (line_size < minsize)
+ line_size = minsize;
+ visible_line = xmalloc (line_size);
+ invisible_line = xmalloc (line_size);
+ }
+ else if (line_size < minsize) /* ensure it can hold MINSIZE chars */
+ {
+ line_size *= 2;
+ if (line_size < minsize)
+ line_size = minsize;
+ visible_line = xrealloc (visible_line, line_size);
+ invisible_line = xrealloc (invisible_line, line_size);
+ }
+
+ for (n = minsize; n < line_size; n++)
+ {
+ visible_line[n] = 0;
+ invisible_line[n] = 1;
+ }
+
+ if (vis_lbreaks == 0)
+ {
+ /* should be enough. */
+ inv_lbsize = vis_lbsize = 256;
+ inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
+ vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
+ inv_lbreaks[0] = vis_lbreaks[0] = 0;
+ }
+}
+
/* Basic redisplay algorithm. */
void
rl_redisplay ()
@@ -325,19 +352,7 @@ rl_redisplay ()
if (invisible_line == 0)
{
- visible_line = xmalloc (line_size);
- invisible_line = xmalloc (line_size);
- for (in = 0; in < line_size; in++)
- {
- visible_line[in] = 0;
- invisible_line[in] = 1;
- }
-
- /* should be enough, but then again, this is just for testing. */
- inv_lbreaks = (int *)malloc (256 * sizeof (int));
- vis_lbreaks = (int *)malloc (256 * sizeof (int));
- inv_lbreaks[0] = vis_lbreaks[0] = 0;
-
+ init_line_structures (0);
rl_on_new_line ();
}
@@ -395,12 +410,13 @@ rl_redisplay ()
else
{
prompt_this_line++;
+ pmtlen = prompt_this_line - rl_display_prompt; /* temp var */
if (forced_display)
{
- _rl_output_some_chars (rl_display_prompt, prompt_this_line - rl_display_prompt);
+ _rl_output_some_chars (rl_display_prompt, pmtlen);
/* Make sure we are at column zero even after a newline,
regardless of the state of terminal output processing. */
- if (prompt_this_line[-2] != '\r')
+ if (pmtlen < 2 || prompt_this_line[-2] != '\r')
cr ();
}
}
@@ -419,11 +435,25 @@ rl_redisplay ()
wrap_offset = 0;
}
+#define CHECK_INV_LBREAKS() \
+ do { \
+ if (newlines >= (inv_lbsize - 2)) \
+ { \
+ inv_lbsize *= 2; \
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ } \
+ } while (0)
+
#define CHECK_LPOS() \
do { \
lpos++; \
if (lpos >= screenwidth) \
{ \
+ if (newlines >= (inv_lbsize - 2)) \
+ { \
+ inv_lbsize *= 2; \
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ } \
inv_lbreaks[++newlines] = out; \
lpos = 0; \
} \
@@ -437,14 +467,13 @@ rl_redisplay ()
contents of the command line? */
while (lpos >= screenwidth)
{
-#if 0
- temp = ((newlines + 1) * screenwidth) - ((newlines == 0) ? wrap_offset : 0);
-#else
/* XXX - possible fix from Darin Johnson for prompt
string with invisible characters that is longer than the screen
- width. */
+ width. XXX - this doesn't work right if invisible characters have
+ to be put on the second screen line -- it adds too much (the number
+ of invisible chars after the screenwidth). */
temp = ((newlines + 1) * screenwidth) + ((newlines == 0) ? wrap_offset : 0);
-#endif
+
inv_lbreaks[++newlines] = temp;
lpos -= screenwidth;
}
@@ -477,6 +506,7 @@ rl_redisplay ()
if (lpos + 4 >= screenwidth)
{
temp = screenwidth - lpos;
+ CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out + temp;
lpos = 4 - temp;
}
@@ -506,6 +536,7 @@ rl_redisplay ()
{
register int temp2;
temp2 = screenwidth - lpos;
+ CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out + temp2;
lpos = temp - temp2;
while (out < newout)
@@ -522,6 +553,7 @@ rl_redisplay ()
else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
{
line[out++] = '\0'; /* XXX - sentinel */
+ CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out;
lpos = 0;
}
@@ -546,6 +578,7 @@ rl_redisplay ()
}
inv_botlin = lb_botlin = newlines;
+ CHECK_INV_LBREAKS ();
inv_lbreaks[newlines+1] = out;
cursor_linenum = lb_linenum;
@@ -776,11 +809,17 @@ rl_redisplay ()
/* Swap visible and non-visible lines. */
{
char *temp = visible_line;
- int *itemp = vis_lbreaks;
+ int *itemp = vis_lbreaks, ntemp = vis_lbsize;
+
visible_line = invisible_line;
invisible_line = temp;
+
vis_lbreaks = inv_lbreaks;
inv_lbreaks = itemp;
+
+ vis_lbsize = inv_lbsize;
+ inv_lbsize = ntemp;
+
rl_display_fixed = 0;
/* If we are displaying on a single line, and last_lmargin is > 0, we
are not displaying any invisible characters, so set visible_wrap_offset
@@ -907,7 +946,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif /* !__MSDOS__ */
+#endif
_rl_output_some_chars (local_prompt, lendiff);
_rl_last_c_pos = lendiff;
}
@@ -1037,6 +1076,58 @@ rl_on_new_line ()
return 0;
}
+/* Tell the update routines that we have moved onto a new line with the
+ prompt already displayed. Code originally from the version of readline
+ distributed with CLISP. */
+int
+rl_on_new_line_with_prompt ()
+{
+ int prompt_size, i, l, real_screenwidth, newlines;
+ char *prompt_last_line;
+
+ /* Initialize visible_line and invisible_line to ensure that they can hold
+ the already-displayed prompt. */
+ prompt_size = strlen (rl_prompt) + 1;
+ init_line_structures (prompt_size);
+
+ /* Make sure the line structures hold the already-displayed prompt for
+ redisplay. */
+ strcpy (visible_line, rl_prompt);
+ strcpy (invisible_line, rl_prompt);
+
+ /* If the prompt contains newlines, take the last tail. */
+ prompt_last_line = strrchr (rl_prompt, '\n');
+ if (!prompt_last_line)
+ prompt_last_line = rl_prompt;
+
+ l = strlen (prompt_last_line);
+ _rl_last_c_pos = l;
+
+ /* Dissect prompt_last_line into screen lines. Note that here we have
+ to use the real screenwidth. Readline's notion of screenwidth might be
+ one less, see terminal.c. */
+ real_screenwidth = screenwidth + (_rl_term_autowrap ? 0 : 1);
+ _rl_last_v_pos = l / real_screenwidth;
+ /* If the prompt length is a multiple of real_screenwidth, we don't know
+ whether the cursor is at the end of the last line, or already at the
+ beginning of the next line. Output a newline just to be safe. */
+ if (l > 0 && (l % real_screenwidth) == 0)
+ _rl_output_some_chars ("\n", 1);
+ last_lmargin = 0;
+
+ newlines = 0; i = 0;
+ while (i <= l)
+ {
+ _rl_vis_botlin = newlines;
+ vis_lbreaks[newlines++] = i;
+ i += real_screenwidth;
+ }
+ vis_lbreaks[newlines] = l;
+ visible_wrap_offset = 0;
+
+ return 0;
+}
+
/* Actually update the display, period. */
int
rl_forced_update_display ()
@@ -1094,8 +1185,6 @@ _rl_move_cursor_relative (new, data)
That kind of control is for people who don't know what the
data is underneath the cursor. */
#if defined (HACK_TERMCAP_MOTION)
- extern char *term_forward_char;
-
if (term_forward_char)
for (i = _rl_last_c_pos; i < new; i++)
tputs (term_forward_char, 1, _rl_output_character_function);
@@ -1122,22 +1211,15 @@ _rl_move_vert (to)
if (_rl_last_v_pos == to || to > screenheight)
return;
-#if defined (__GO32__)
- {
- int row, col;
-
- i = fflush (rl_outstream); /* make sure the cursor pos is current! */
- ScreenGetCursor (&row, &col);
- ScreenSetCursor ((row + to - _rl_last_v_pos), col);
- delta = i;
- }
-#else /* !__GO32__ */
-
if ((delta = to - _rl_last_v_pos) > 0)
{
for (i = 0; i < delta; i++)
putc ('\n', rl_outstream);
+#if defined (__MSDOS__)
+ putc ('\r', rl_outstream);
+#else
tputs (term_cr, 1, _rl_output_character_function);
+#endif
_rl_last_c_pos = 0;
}
else
@@ -1146,7 +1228,7 @@ _rl_move_vert (to)
for (i = 0; i < -delta; i++)
tputs (term_up, 1, _rl_output_character_function);
}
-#endif /* !__GO32__ */
+
_rl_last_v_pos = to; /* Now TO is here */
}
@@ -1354,11 +1436,9 @@ void
_rl_clear_to_eol (count)
int count;
{
-#if !defined (__GO32__)
if (term_clreol)
tputs (term_clreol, 1, _rl_output_character_function);
else if (count)
-#endif /* !__GO32__ */
space_to_eol (count);
}
@@ -1379,14 +1459,9 @@ space_to_eol (count)
void
_rl_clear_screen ()
{
-#if defined (__GO32__)
- ScreenClear (); /* FIXME: only works in text modes */
- ScreenSetCursor (0, 0); /* term_clrpag is "cl" which homes the cursor */
-#else
if (term_clrpag)
tputs (term_clrpag, 1, _rl_output_character_function);
else
-#endif /* !__GO32__ */
crlf ();
}
@@ -1396,21 +1471,6 @@ insert_some_chars (string, count)
char *string;
int count;
{
-#if defined (__GO32__)
-#ifndef __DJGPP__
- int row, col, width;
- char *row_start;
-
- ScreenGetCursor (&row, &col);
- width = ScreenCols ();
- row_start = ScreenPrimary + (row * width);
-
- memcpy (row_start + col + count, row_start + col, width - col - count);
-#endif /* !__DJGPP__ */
- /* Place the text on the screen. */
- _rl_output_some_chars (string, count);
-#else /* !_GO32 */
-
/* If IC is defined, then we do not have to "enter" insert mode. */
if (term_IC)
{
@@ -1443,7 +1503,6 @@ insert_some_chars (string, count)
if (term_ei && *term_ei)
tputs (term_ei, 1, _rl_output_character_function);
}
-#endif /* !__GO32__ */
}
/* Delete COUNT characters from the display line. */
@@ -1451,19 +1510,6 @@ static void
delete_chars (count)
int count;
{
-#if !defined (__DJGPP__)
-#if defined (__GO32__)
- int row, col, width;
- char *row_start;
-
- ScreenGetCursor (&row, &col);
- width = ScreenCols ();
- row_start = ScreenPrimary + (row * width);
-
- memcpy (row_start + col, row_start + col + count, width - col - count);
- memset (row_start + width - count, 0, count * 2);
-#else /* !_GO32 */
-
if (count > screenwidth) /* XXX */
return;
@@ -1479,8 +1525,6 @@ delete_chars (count)
while (count--)
tputs (term_dc, 1, _rl_output_character_function);
}
-#endif /* !__GO32__ */
-#endif /* !__DJGPP__ */
}
void
@@ -1502,7 +1546,11 @@ _rl_update_final ()
if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == screenwidth))
{
char *last_line;
+#if 0
last_line = &visible_line[inv_lbreaks[_rl_vis_botlin]];
+#else
+ last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]];
+#endif
_rl_move_cursor_relative (screenwidth - 1, last_line);
_rl_clear_to_eol (0);
putc (last_line[screenwidth - 1], rl_outstream);
@@ -1523,16 +1571,47 @@ cr ()
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif /* !__MSDOS__ */
+#endif
_rl_last_c_pos = 0;
}
}
+/* Redraw the last line of a multi-line prompt that may possibly contain
+ terminal escape sequences. Called with the cursor at column 0 of the
+ line to draw the prompt on. */
+static void
+redraw_prompt (t)
+ char *t;
+{
+ char *oldp, *oldl, *oldlprefix;
+ int oldlen, oldlast, oldplen;
+
+ /* Geez, I should make this a struct. */
+ oldp = rl_display_prompt;
+ oldl = local_prompt;
+ oldlprefix = local_prompt_prefix;
+ oldlen = visible_length;
+ oldplen = prefix_length;
+ oldlast = last_invisible;
+
+ rl_display_prompt = t;
+ local_prompt = expand_prompt (t, &visible_length, &last_invisible);
+ local_prompt_prefix = (char *)NULL;
+ rl_forced_update_display ();
+
+ rl_display_prompt = oldp;
+ local_prompt = oldl;
+ local_prompt_prefix = oldlprefix;
+ visible_length = oldlen;
+ prefix_length = oldplen;
+ last_invisible = oldlast;
+}
+
/* Redisplay the current line after a SIGWINCH is received. */
void
_rl_redisplay_after_sigwinch ()
{
- char *t, *oldp, *oldl, *oldlprefix;
+ char *t;
/* Clear the current line and put the cursor at column 0. Make sure
the right thing happens if we have wrapped to a new screen line. */
@@ -1542,7 +1621,7 @@ _rl_redisplay_after_sigwinch ()
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif /* !__MSDOS__ */
+#endif
_rl_last_c_pos = 0;
#if defined (__MSDOS__)
space_to_eol (screenwidth);
@@ -1565,17 +1644,7 @@ _rl_redisplay_after_sigwinch ()
/* Redraw only the last line of a multi-line prompt. */
t = strrchr (rl_display_prompt, '\n');
if (t)
- {
- oldp = rl_display_prompt;
- oldl = local_prompt;
- oldlprefix = local_prompt_prefix;
- rl_display_prompt = ++t;
- local_prompt = local_prompt_prefix = (char *)NULL;
- rl_forced_update_display ();
- rl_display_prompt = oldp;
- local_prompt = oldl;
- local_prompt_prefix = oldlprefix;
- }
+ redraw_prompt (++t);
else
rl_forced_update_display ();
}
@@ -1600,3 +1669,25 @@ _rl_erase_entire_line ()
cr ();
fflush (rl_outstream);
}
+
+/* return the `current display line' of the cursor -- the number of lines to
+ move up to get to the first screen line of the current readline line. */
+int
+_rl_current_display_line ()
+{
+ int ret, nleft;
+
+ /* Find out whether or not there might be invisible characters in the
+ editing buffer. */
+ if (rl_display_prompt == rl_prompt)
+ nleft = _rl_last_c_pos - screenwidth - rl_visible_prompt_length;
+ else
+ nleft = _rl_last_c_pos - screenwidth;
+
+ if (nleft > 0)
+ ret = 1 + nleft / screenwidth;
+ else
+ ret = 0;
+
+ return ret;
+}
diff --git a/readline/doc/ChangeLog b/readline/doc/ChangeLog
index 3c26ae5..995c43a 100644
--- a/readline/doc/ChangeLog
+++ b/readline/doc/ChangeLog
@@ -1,3 +1,12 @@
+2000-07-09 Elena Zannoni
+
+ * Import of readline 4.1.
+
+ Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
+ inclusion in the gdb manual.
+
+ New file: rluserman.texinfo
+
Tue Apr 18 15:43:52 2000 Andrew Cagney
* readline.0: Delete. Generated by Makefile, deleted by distclean
diff --git a/readline/doc/Makefile.in b/readline/doc/Makefile.in
index 1031472..4a38563 100644
--- a/readline/doc/Makefile.in
+++ b/readline/doc/Makefile.in
@@ -1,6 +1,23 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
-top_srcdir = @top_srcdir@
+
+# Copyright (C) 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+
+topdir = @top_srcdir@
srcdir = @srcdir@
VPATH = .:@srcdir@
@@ -8,25 +25,33 @@ prefix = @prefix@
infodir = @infodir@
mandir = @mandir@
-man3dir = $(mandir)/man3
+manpfx = man
+
+man1ext = 1
+man1dir = $(mandir)/$(manpfx)$(man1ext)
+man3ext = 3
+man3dir = $(mandir)/$(manpfx)$(man3ext)
SHELL = @MAKE_SHELL@
RM = rm -f
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+BUILD_DIR = @BUILD_DIR@
TEXINPUTDIR = $(srcdir)
-MAKEINFO = makeinfo
+MAKEINFO = LANGUAGE= makeinfo
TEXI2DVI = $(srcdir)/texi2dvi
TEXI2HTML = $(srcdir)/texi2html
QUIETPS = #set this to -q to shut up dvips
-DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
+PAPERSIZE = letter
+PSDPI = 300 # I don't have any 600-dpi printers
+DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
- $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo
+ $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo \
+ $(srcdir)/rluserman.texinfo
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
$(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo
@@ -36,16 +61,15 @@ NROFF = groff -Tascii
# This should be a program that converts troff to postscript
GROFF = groff
-DVIOBJ = readline.dvi history.dvi
-INFOOBJ = readline.info history.info
-PSOBJ = readline.ps history.ps
-HTMLOBJ = readline.html history.html
-HTMLTOC = readline_toc.html history_toc.html
+DVIOBJ = readline.dvi history.dvi rluserman.dvi
+INFOOBJ = readline.info history.info rluserman.info
+PSOBJ = readline.ps history.ps rluserman.ps
+HTMLOBJ = readline.html history.html rluserman.html
TEXTOBJ = readline.0
-INTERMEDIATE_OBJ = rlman.dvi hist.dvi
+INTERMEDIATE_OBJ = rlman.dvi hist.dvi rluserman.dvi
-CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
+CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(TEXTOBJ)
.SUFFIXES: .0 .3 .ps .txt .dvi
@@ -63,6 +87,12 @@ readline.dvi: $(RLSRC)
readline.info: $(RLSRC)
$(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texinfo
+rluserman.dvi: $(RLSRC)
+ TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rluserman.texinfo
+
+rluserman.info: $(RLSRC)
+ $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rluserman.texinfo
+
history.dvi: ${HISTSRC}
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/hist.texinfo
mv hist.dvi history.dvi
@@ -74,18 +104,25 @@ readline.ps: readline.dvi
$(RM) $@
$(DVIPS) readline.dvi
+rluserman.ps: rluserman.dvi
+ $(RM) $@
+ $(DVIPS) rluserman.dvi
+
history.ps: history.dvi
$(RM) $@
$(DVIPS) history.dvi
readline.html: ${RLSRC}
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
- sed -e 's:rlman.html:readline.html:' rlman.html > readline.html
+ sed -e 's:rlman.html:readline.html:g' rlman.html > readline.html
$(RM) rlman.html
+rluserman.html: ${RLSRC}
+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rluserman.texinfo
+
history.html: ${HISTSRC}
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
- sed -e 's:hist.html:history.html:' hist.html > history.html
+ sed -e 's:hist.html:history.html:g' hist.html > history.html
$(RM) hist.html
info: $(INFOOBJ)
@@ -98,7 +135,7 @@ readline.0: readline.3
clean:
$(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \
- *.fns *.kys *.tps *.vrs *.o core
+ *.fns *.kys *.tps *.vrs *.bt *.bts *.o core
distclean: clean
$(RM) $(CREATED_DOCS)
@@ -112,8 +149,8 @@ maintainer-clean: clean
$(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
-installdirs: $(top_srcdir)/support/mkdirs
- -$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
+installdirs: $(topdir)/support/mkdirs
+ -$(SHELL) $(topdir)/support/mkdirs $(infodir) $(man3dir)
install: installdirs
if test -f readline.info; then \
@@ -121,12 +158,17 @@ install: installdirs
else \
${INSTALL_DATA} $(srcdir)/readline.info $(infodir)/readline.info; \
fi
+ if test -f rluserman.info; then \
+ ${INSTALL_DATA} rluserman.info $(infodir)/rluserman.info; \
+ else \
+ ${INSTALL_DATA} $(srcdir)/rluserman.info $(infodir)/rluserman.info; \
+ fi
if test -f history.info; then \
${INSTALL_DATA} history.info $(infodir)/history.info; \
else \
${INSTALL_DATA} $(srcdir)/history.info $(infodir)/history.info; \
fi
- if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir $(infodir)/readline.info ; \
install-info --dir-file=$(infodir)/dir $(infodir)/history.info ; \
else true; fi
@@ -134,5 +176,6 @@ install: installdirs
uninstall:
$(RM) $(infodir)/readline.info
+ $(RM) $(infodir)/rluserman.info
$(RM) $(infodir)/history.info
$(RM) $(man3dir)/readline.3
diff --git a/readline/doc/hist.texinfo b/readline/doc/hist.texinfo
index 31a0ba0..8a9c941 100644
--- a/readline/doc/hist.texinfo
+++ b/readline/doc/hist.texinfo
@@ -55,8 +55,8 @@ provides a consistent user interface for recalling lines of previously
typed input.
Published by the Free Software Foundation @*
-675 Massachusetts Avenue, @*
-Cambridge, MA 02139 USA
+59 Temple Place, Suite 330, @*
+Boston, MA 02111 USA
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
diff --git a/readline/doc/history.dvi b/readline/doc/history.dvi
deleted file mode 100644
index a8b30bf..0000000
Binary files a/readline/doc/history.dvi and /dev/null differ
diff --git a/readline/doc/history.html b/readline/doc/history.html
deleted file mode 100644
index d380ff4..0000000
--- a/readline/doc/history.html
+++ /dev/null
@@ -1,1195 +0,0 @@
-
-
-
-
-GNU History Library
-
-
-GNU History Library
-Edition 4.1, for History Library
Version 4.1.
-January 2000
-Brian Fox, Free Software Foundation
-Chet Ramey, Case Western Reserve University
-
-
-
Table of Contents
-
-
-
-
-This document describes the GNU History library, a programming tool that
-provides a consistent user interface for recalling lines of previously
-typed input.
-
-
-
-Published by the Free Software Foundation
-59 Temple Place, Suite 330,
-Boston, MA 02111 USA
-
-
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-
-
-
-Copyright (C) 1988-1999 Free Software Foundation, Inc.
-
-
-
-
-
-
-
-
-This chapter describes how to use the GNU History Library interactively,
-from a user's standpoint. It should be considered a user's guide. For
-information on using the GNU History Library in your own programs,
-see section Programming with GNU History.
-
-
-
-
-
-
-
-
-
-
-
-
-
-The History library provides a history expansion feature that is similar
-to the history expansion provided by csh
. This section
-describes the syntax used to manipulate the history information.
-
-
-
-History expansions introduce words from the history list into
-the input stream, making it easy to repeat commands, insert the
-arguments to a previous command into the current input line, or
-fix errors in previous commands quickly.
-
-
-
-History expansion takes place in two parts. The first is to determine
-which line from the history list should be used during substitution.
-The second is to select portions of that line for inclusion into the
-current one. The line selected from the history is called the
-event, and the portions of that line that are acted upon are
-called words. Various modifiers are available to manipulate
-the selected words. The line is broken into words in the same fashion
-that Bash does, so that several words
-surrounded by quotes are considered one word.
-History expansions are introduced by the appearance of the
-history expansion character, which is `!' by default.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-An event designator is a reference to a command line entry in the
-history list.
-
-
-
-
-
-!
--
-Start a history substitution, except when followed by a space, tab,
-the end of the line, `=' or `('.
-
-
!n
--
-Refer to command line n.
-
-
!-n
--
-Refer to the command n lines back.
-
-
!!
--
-Refer to the previous command. This is a synonym for `!-1'.
-
-
!string
--
-Refer to the most recent command starting with string.
-
-
!?string[?]
--
-Refer to the most recent command containing string. The trailing
-`?' may be omitted if the string is followed immediately by
-a newline.
-
-
^string1^string2^
--
-Quick Substitution. Repeat the last command, replacing string1
-with string2. Equivalent to
-
!!:s/string1/string2/
.
-
- !#
--
-The entire command line typed so far.
-
-
-
-
-
-
-
-
-Word designators are used to select desired words from the event.
-A `:' separates the event specification from the word designator. It
-may be omitted if the word designator begins with a `^', `$',
-`*', `-', or `%'. Words are numbered from the beginning
-of the line, with the first word being denoted by 0 (zero). Words are
-inserted into the current line separated by single spaces.
-
-
-
-For example,
-
-
-
-
-!!
--
-designates the preceding command. When you type this, the preceding
-command is repeated in toto.
-
-
!!:$
--
-designates the last argument of the preceding command. This may be
-shortened to
!$
.
-
- !fi:2
--
-designates the second argument of the most recent command starting with
-the letters
fi
.
-
-
-
-Here are the word designators:
-
-
-
-0 (zero)
--
-The
0
th word. For many applications, this is the command word.
-
- n
--
-The nth word.
-
-
^
--
-The first argument; that is, word 1.
-
-
$
--
-The last argument.
-
-
%
--
-The word matched by the most recent `?string?' search.
-
-
x-y
--
-A range of words; `-y' abbreviates `0-y'.
-
-
*
--
-All of the words, except the
0
th. This is a synonym for `1-$'.
-It is not an error to use `*' if there is just one word in the event;
-the empty string is returned in that case.
-
- x*
--
-Abbreviates `x-$'
-
-
x-
--
-Abbreviates `x-$' like `x*', but omits the last word.
-
-
-
-
-If a word designator is supplied without an event specification, the
-previous command is used as the event.
-
-
-
-
-
-
-
-After the optional word designator, you can add a sequence of one or more
-of the following modifiers, each preceded by a `:'.
-
-
-
-
-h
--
-Remove a trailing pathname component, leaving only the head.
-
-
t
--
-Remove all leading pathname components, leaving the tail.
-
-
r
--
-Remove a trailing suffix of the form `.suffix', leaving
-the basename.
-
-
e
--
-Remove all but the trailing suffix.
-
-
p
--
-Print the new command but do not execute it.
-
-
s/old/new/
--
-Substitute new for the first occurrence of old in the
-event line. Any delimiter may be used in place of `/'.
-The delimiter may be quoted in old and new
-with a single backslash. If `&' appears in new,
-it is replaced by old. A single backslash will quote
-the `&'. The final delimiter is optional if it is the last
-character on the input line.
-
-
&
--
-Repeat the previous substitution.
-
-
g
--
-Cause changes to be applied over the entire event line. Used in
-conjunction with `s', as in
gs/old/new/
,
-or with `&'.
-
-
-
-
-
-
-
-
-This chapter describes how to interface programs that you write
-with the GNU History Library.
-It should be considered a technical guide.
-For information on the interactive use of GNU History, see section Using History Interactively.
-
-
-
-
-
-
-
-
-
-
-Many programs read input from the user a line at a time. The GNU History
-library is able to keep track of those lines, associate arbitrary data with
-each line, and utilize information from previous lines in composing new
-ones.
-
-
-
-The programmer using the History library has available functions
-for remembering lines on a history list, associating arbitrary data
-with a line, removing lines from the list, searching through the list
-for a line containing an arbitrary text string, and referencing any line
-in the list directly. In addition, a history expansion function
-is available which provides for a consistent user interface across
-different programs.
-
-
-
-The user using programs written with the History library has the
-benefit of a consistent user interface with a set of well-known
-commands for manipulating the text of previous lines and using that text
-in new commands. The basic history manipulation commands are similar to
-the history substitution provided by csh
.
-
-
-
-If the programmer desires, he can use the Readline library, which
-includes some history manipulation by default, and has the added
-advantage of command line editing.
-
-
-
-Before declaring any functions using any functionality the History
-library provides in other code, an application writer should include
-the file <readline/history.h>
in any file that uses the
-History library's features. It supplies extern declarations for all
-of the library's public functions and variables, and declares all of
-the public data structures.
-
-
-
-
-
-
-
-The history list is an array of history entries. A history entry is
-declared as follows:
-
-
-
-
-typedef struct _hist_entry {
- char *line;
- char *data;
-} HIST_ENTRY;
-
-
-
-The history list itself might therefore be declared as
-
-
-
-
-HIST_ENTRY **the_history_list;
-
-
-
-The state of the History library is encapsulated into a single structure:
-
-
-
-
-/* A structure used to pass the current state of the history stuff around. */
-typedef struct _hist_state {
- HIST_ENTRY **entries; /* Pointer to the entries themselves. */
- int offset; /* The location pointer within this array. */
- int length; /* Number of elements within this array. */
- int size; /* Number of slots allocated to this array. */
- int flags;
-} HISTORY_STATE;
-
-
-
-If the flags member includes HS_STIFLED
, the history has been
-stifled.
-
-
-
-
-
-
-
-This section describes the calling sequence for the various functions
-present in GNU History.
-
-
-
-
-
-
-
-
-
-
-This section describes functions used to initialize and manage
-the state of the History library when you want to use the history
-functions in your program.
-
-
-
-
-- Function: void using_history ()
-
-
-Begin a session in which the history functions might be used. This
-initializes the interactive variables.
-
-
-
-
-
-- Function: HISTORY_STATE * history_get_history_state ()
-
-
-Return a structure describing the current state of the input history.
-
-
-
-
-
-- Function: void history_set_history_state (HISTORY_STATE *state)
-
-
-Set the state of the history list according to state.
-
-
-
-
-
-
-
-
-These functions manage individual entries on the history list, or set
-parameters managing the list itself.
-
-
-
-
-- Function: void add_history (char *string)
-
-
-Place string at the end of the history list. The associated data
-field (if any) is set to
NULL
.
-
-
-
-
-
-- Function: HIST_ENTRY * remove_history (int which)
-
-
-Remove history entry at offset which from the history. The
-removed element is returned so you can free the line, data,
-and containing structure.
-
-
-
-
-
-- Function: HIST_ENTRY * replace_history_entry (int which, char *line, char *data)
-
-
-Make the history entry at offset which have line and data.
-This returns the old entry so you can dispose of the data. In the case
-of an invalid which, a
NULL
pointer is returned.
-
-
-
-
-
-- Function: void clear_history ()
-
-
-Clear the history list by deleting all the entries.
-
-
-
-
-
-- Function: void stifle_history (int max)
-
-
-Stifle the history list, remembering only the last max entries.
-
-
-
-
-
-- Function: int unstifle_history ()
-
-
-Stop stifling the history. This returns the previous amount the
-history was stifled. The value is positive if the history was
-stifled, negative if it wasn't.
-
-
-
-
-
-- Function: int history_is_stifled ()
-
-
-Returns non-zero if the history is stifled, zero if it is not.
-
-
-
-
-
-
-
-
-These functions return information about the entire history list or
-individual list entries.
-
-
-
-
-- Function: HIST_ENTRY ** history_list ()
-
-
-Return a
NULL
terminated array of HIST_ENTRY
which is the
-current input history. Element 0 of this list is the beginning of time.
-If there is no history, return NULL
.
-
-
-
-
-
-- Function: int where_history ()
-
-
-Returns the offset of the current history element.
-
-
-
-
-
-- Function: HIST_ENTRY * current_history ()
-
-
-Return the history entry at the current position, as determined by
-
where_history ()
. If there is no entry there, return a NULL
-pointer.
-
-
-
-
-
-- Function: HIST_ENTRY * history_get (int offset)
-
-
-Return the history entry at position offset, starting from
-
history_base
. If there is no entry there, or if offset
-is greater than the history length, return a NULL
pointer.
-
-
-
-
-
-- Function: int history_total_bytes ()
-
-
-Return the number of bytes that the primary history entries are using.
-This function returns the sum of the lengths of all the lines in the
-history.
-
-
-
-
-
-
-
-
-These functions allow the current index into the history list to be
-set or changed.
-
-
-
-
-- Function: int history_set_pos (int pos)
-
-
-Set the position in the history list to pos, an absolute index
-into the list.
-
-
-
-
-
-- Function: HIST_ENTRY * previous_history ()
-
-
-Back up the current history offset to the previous history entry, and
-return a pointer to that entry. If there is no previous entry, return
-a
NULL
pointer.
-
-
-
-
-
-- Function: HIST_ENTRY * next_history ()
-
-
-Move the current history offset forward to the next history entry, and
-return the a pointer to that entry. If there is no next entry, return
-a
NULL
pointer.
-
-
-
-
-
-
-
-
-
-
-
-These functions allow searching of the history list for entries containing
-a specific string. Searching may be performed both forward and backward
-from the current history position. The search may be anchored,
-meaning that the string must match at the beginning of the history entry.
-
-
-
-
-
-- Function: int history_search (char *string, int direction)
-
-
-Search the history for string, starting at the current history
-offset. If direction < 0, then the search is through previous entries,
-else through subsequent. If string is found, then
-the current history index is set to that history entry, and the value
-returned is the offset in the line of the entry where
-string was found. Otherwise, nothing is changed, and a -1 is
-returned.
-
-
-
-
-
-- Function: int history_search_prefix (char *string, int direction)
-
-
-Search the history for string, starting at the current history
-offset. The search is anchored: matching lines must begin with
-string. If direction < 0, then the search is through previous
-entries, else through subsequent. If string is found, then the
-current history index is set to that entry, and the return value is 0.
-Otherwise, nothing is changed, and a -1 is returned.
-
-
-
-
-
-- Function: int history_search_pos (char *string, int direction, int pos)
-
-
-Search for string in the history list, starting at pos, an
-absolute index into the list. If direction is negative, the search
-proceeds backward from pos, otherwise forward. Returns the absolute
-index of the history element where string was found, or -1 otherwise.
-
-
-
-
-
-
-
-
-The History library can read the history from and write it to a file.
-This section documents the functions for managing a history file.
-
-
-
-
-- Function: int read_history (char *filename)
-
-
-Add the contents of filename to the history list, a line at a
-time. If filename is
NULL
, then read from
-`~/.history'. Returns 0 if successful, or errno if not.
-
-
-
-
-
-- Function: int read_history_range (char *filename, int from, int to)
-
-
-Read a range of lines from filename, adding them to the history list.
-Start reading at line from and end at to. If
-from is zero, start at the beginning. If to is less than
-from, then read until the end of the file. If filename is
-
NULL
, then read from `~/.history'. Returns 0 if successful,
-or errno
if not.
-
-
-
-
-
-- Function: int write_history (char *filename)
-
-
-Write the current history to filename, overwriting filename
-if necessary. If filename is
-
NULL
, then write the history list to `~/.history'. Values
-returned are as in read_history ()
.
-
-
-
-
-
-- Function: int append_history (int nelements, char *filename)
-
-
-Append the last nelements of the history list to filename.
-
-
-
-
-
-- Function: int history_truncate_file (char *filename, int nlines)
-
-
-Truncate the history file filename, leaving only the last
-nlines lines.
-
-
-
-
-
-
-
-
-These functions implement csh
-like history expansion.
-
-
-
-
-- Function: int history_expand (char *string, char **output)
-
-
-Expand string, placing the result into output, a pointer
-to a string (see section History Expansion). Returns:
-
-
-0
--
-If no expansions took place (or, if the only change in
-the text was the de-slashifying of the history expansion
-character);
-
1
--
-if expansions did take place;
-
-1
--
-if there was an error in expansion;
-
2
--
-if the returned line should be displayed, but not executed,
-as with the
:p
modifier (see section Modifiers).
-
-
-
-If an error ocurred in expansion, then output contains a descriptive
-error message.
-
-
-
-
-
-- Function: char * history_arg_extract (int first, int last, char *string)
-
-
-Extract a string segment consisting of the first through last
-arguments present in string. Arguments are broken up as in Bash.
-
-
-
-
-
-- Function: char * get_history_event (char *string, int *cindex, int qchar)
-
-
-Returns the text of the history event beginning at string +
-*cindex. *cindex is modified to point to after the event
-specifier. At function entry, cindex points to the index into
-string where the history event specification begins. qchar
-is a character that is allowed to end the event specification in addition
-to the "normal" terminating characters.
-
-
-
-
-
-- Function: char ** history_tokenize (char *string)
-
-
-Return an array of tokens parsed out of string, much as the
-shell might. The tokens are split on white space and on the
-characters
()<>;&|$
, and shell quoting conventions are
-obeyed.
-
-
-
-
-
-
-
-
-This section describes the externally visible variables exported by
-the GNU History Library.
-
-
-
-
-- Variable: int history_base
-
-
-The logical offset of the first entry in the history list.
-
-
-
-
-
-- Variable: int history_length
-
-
-The number of entries currently stored in the history list.
-
-
-
-
-
-- Variable: int max_input_history
-
-
-The maximum number of history entries. This must be changed using
-
stifle_history ()
.
-
-
-
-
-
-- Variable: char history_expansion_char
-
-
-The character that starts a history event. The default is `!'.
-
-
-
-
-
-- Variable: char history_subst_char
-
-
-The character that invokes word substitution if found at the start of
-a line. The default is `^'.
-
-
-
-
-
-- Variable: char history_comment_char
-
-
-During tokenization, if this character is seen as the first character
-of a word, then it and all subsequent characters up to a newline are
-ignored, suppressing history expansion for the remainder of the line.
-This is disabled by default.
-
-
-
-
-
-- Variable: char * history_no_expand_chars
-
-
-The list of characters which inhibit history expansion if found immediately
-following history_expansion_char. The default is whitespace and
-`='.
-
-
-
-
-
-- Variable: char * history_search_delimiter_chars
-
-
-The list of additional characters which can delimit a history search
-string, in addition to whitespace, `:' and `?' in the case of
-a substring search. The default is empty.
-
-
-
-
-
-- Variable: int history_quotes_inhibit_expansion
-
-
-If non-zero, single-quoted words are not scanned for the history expansion
-character. The default value is 0.
-
-
-
-
-
-- Variable: Function * history_inhibit_expansion_function
-
-
-This should be set to the address of a function that takes two arguments:
-a
char *
(string) and an integer index into that string (i).
-It should return a non-zero value if the history expansion starting at
-string[i] should not be performed; zero if the expansion should
-be done.
-It is intended for use by applications like Bash that use the history
-expansion character for additional purposes.
-By default, this variable is set to NULL.
-
-
-
-
-
-
-
-
-The following program demonstrates simple use of the GNU History Library.
-
-
-
-
-main ()
-{
- char line[1024], *t;
- int len, done = 0;
-
- line[0] = 0;
-
- using_history ();
- while (!done)
- {
- printf ("history$ ");
- fflush (stdout);
- t = fgets (line, sizeof (line) - 1, stdin);
- if (t && *t)
- {
- len = strlen (t);
- if (t[len - 1] == '\n')
- t[len - 1] = '\0';
- }
-
- if (!t)
- strcpy (line, "quit");
-
- if (line[0])
- {
- char *expansion;
- int result;
-
- result = history_expand (line, &expansion);
- if (result)
- fprintf (stderr, "%s\n", expansion);
-
- if (result < 0 || result == 2)
- {
- free (expansion);
- continue;
- }
-
- add_history (expansion);
- strncpy (line, expansion, sizeof (line) - 1);
- free (expansion);
- }
-
- if (strcmp (line, "quit") == 0)
- done = 1;
- else if (strcmp (line, "save") == 0)
- write_history ("history_file");
- else if (strcmp (line, "read") == 0)
- read_history ("history_file");
- else if (strcmp (line, "list") == 0)
- {
- register HIST_ENTRY **the_list;
- register int i;
-
- the_list = history_list ();
- if (the_list)
- for (i = 0; the_list[i]; i++)
- printf ("%d: %s\n", i + history_base, the_list[i]->line);
- }
- else if (strncmp (line, "delete", 6) == 0)
- {
- int which;
- if ((sscanf (line + 6, "%d", &which)) == 1)
- {
- HIST_ENTRY *entry = remove_history (which);
- if (!entry)
- fprintf (stderr, "No such entry %d\n", which);
- else
- {
- free (entry->line);
- free (entry);
- }
- }
- else
- {
- fprintf (stderr, "non-numeric arg given to `delete'\n");
- }
- }
- }
-}
-
-
-
-
-
-
-Jump to:
-a
--
-e
--
-h
-
-
-
-anchored search
-
-
-
-event designators
-
-
-
-history events
-history expansion
-History Searching
-
-
-
-
-
-
-
-Jump to:
-a
--
-c
--
-g
--
-h
--
-m
--
-n
--
-p
--
-r
--
-s
--
-u
--
-w
-
-
-
-add_history
-append_history
-
-
-
-clear_history
-current_history
-
-
-
-get_history_event
-
-
-
-history_arg_extract
-history_base
-history_comment_char
-history_expand
-history_expansion_char
-history_get
-history_get_history_state
-history_inhibit_expansion_function
-history_is_stifled
-history_length
-history_list
-history_no_expand_chars
-history_quotes_inhibit_expansion
-history_search
-history_search_delimiter_chars
-history_search_pos
-history_search_prefix
-history_set_history_state
-history_set_pos
-history_subst_char
-history_tokenize
-history_total_bytes
-history_truncate_file
-
-
-
-max_input_history
-
-
-
-next_history
-
-
-
-previous_history
-
-
-
-read_history
-read_history_range
-remove_history
-replace_history_entry
-
-
-
-stifle_history
-
-
-
-unstifle_history
-using_history
-
-
-
-where_history
-write_history
-
-
-
-
-This document was generated on 19 January 2000 using the
-texi2html
-translator version 1.52.
-
-
diff --git a/readline/doc/history.info b/readline/doc/history.info
deleted file mode 100644
index e73cd63..0000000
--- a/readline/doc/history.info
+++ /dev/null
@@ -1,811 +0,0 @@
-This is Info file history.info, produced by Makeinfo version 1.68 from
-the input file /usr/homes/chet/src/bash/readline-src/doc/hist.texinfo.
-
-INFO-DIR-SECTION Libraries
-START-INFO-DIR-ENTRY
-* History: (history). The GNU history library API
-END-INFO-DIR-ENTRY
-
- This document describes the GNU History library, a programming tool
-that provides a consistent user interface for recalling lines of
-previously typed input.
-
- Copyright (C) 1988-1999 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice pare
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-
-File: history.info, Node: Top, Next: Using History Interactively, Up: (dir)
-
-GNU History Library
-*******************
-
- This document describes the GNU History library, a programming tool
-that provides a consistent user interface for recalling lines of
-previously typed input.
-
-* Menu:
-
-* Using History Interactively:: GNU History User's Manual.
-* Programming with GNU History:: GNU History Programmer's Manual.
-* Concept Index:: Index of concepts described in this manual.
-* Function and Variable Index:: Index of externally visible functions
- and variables.
-
-
-File: history.info, Node: Using History Interactively, Next: Programming with GNU History, Prev: Top, Up: Top
-
-Using History Interactively
-***************************
-
- This chapter describes how to use the GNU History Library
-interactively, from a user's standpoint. It should be considered a
-user's guide. For information on using the GNU History Library in your
-own programs, *note Programming with GNU History::..
-
-* Menu:
-
-* History Interaction:: What it feels like using History as a user.
-
-
-File: history.info, Node: History Interaction, Up: Using History Interactively
-
-History Expansion
-=================
-
- The History library provides a history expansion feature that is
-similar to the history expansion provided by `csh'. This section
-describes the syntax used to manipulate the history information.
-
- History expansions introduce words from the history list into the
-input stream, making it easy to repeat commands, insert the arguments
-to a previous command into the current input line, or fix errors in
-previous commands quickly.
-
- History expansion takes place in two parts. The first is to
-determine which line from the history list should be used during
-substitution. The second is to select portions of that line for
-inclusion into the current one. The line selected from the history is
-called the "event", and the portions of that line that are acted upon
-are called "words". Various "modifiers" are available to manipulate
-the selected words. The line is broken into words in the same fashion
-that Bash does, so that several words surrounded by quotes are
-considered one word. History expansions are introduced by the
-appearance of the history expansion character, which is `!' by default.
-
-* Menu:
-
-* Event Designators:: How to specify which history line to use.
-* Word Designators:: Specifying which words are of interest.
-* Modifiers:: Modifying the results of substitution.
-
-
-File: history.info, Node: Event Designators, Next: Word Designators, Up: History Interaction
-
-Event Designators
------------------
-
- An event designator is a reference to a command line entry in the
-history list.
-
-`!'
- Start a history substitution, except when followed by a space, tab,
- the end of the line, `=' or `('.
-
-`!N'
- Refer to command line N.
-
-`!-N'
- Refer to the command N lines back.
-
-`!!'
- Refer to the previous command. This is a synonym for `!-1'.
-
-`!STRING'
- Refer to the most recent command starting with STRING.
-
-`!?STRING[?]'
- Refer to the most recent command containing STRING. The trailing
- `?' may be omitted if the STRING is followed immediately by a
- newline.
-
-`^STRING1^STRING2^'
- Quick Substitution. Repeat the last command, replacing STRING1
- with STRING2. Equivalent to `!!:s/STRING1/STRING2/'.
-
-`!#'
- The entire command line typed so far.
-
-
-File: history.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction
-
-Word Designators
-----------------
-
- Word designators are used to select desired words from the event. A
-`:' separates the event specification from the word designator. It may
-be omitted if the word designator begins with a `^', `$', `*', `-', or
-`%'. Words are numbered from the beginning of the line, with the first
-word being denoted by 0 (zero). Words are inserted into the current
-line separated by single spaces.
-
- For example,
-
-`!!'
- designates the preceding command. When you type this, the
- preceding command is repeated in toto.
-
-`!!:$'
- designates the last argument of the preceding command. This may be
- shortened to `!$'.
-
-`!fi:2'
- designates the second argument of the most recent command starting
- with the letters `fi'.
-
- Here are the word designators:
-
-`0 (zero)'
- The `0'th word. For many applications, this is the command word.
-
-`N'
- The Nth word.
-
-`^'
- The first argument; that is, word 1.
-
-`$'
- The last argument.
-
-`%'
- The word matched by the most recent `?STRING?' search.
-
-`X-Y'
- A range of words; `-Y' abbreviates `0-Y'.
-
-`*'
- All of the words, except the `0'th. This is a synonym for `1-$'.
- It is not an error to use `*' if there is just one word in the
- event; the empty string is returned in that case.
-
-`X*'
- Abbreviates `X-$'
-
-`X-'
- Abbreviates `X-$' like `X*', but omits the last word.
-
- If a word designator is supplied without an event specification, the
-previous command is used as the event.
-
-
-File: history.info, Node: Modifiers, Prev: Word Designators, Up: History Interaction
-
-Modifiers
----------
-
- After the optional word designator, you can add a sequence of one or
-more of the following modifiers, each preceded by a `:'.
-
-`h'
- Remove a trailing pathname component, leaving only the head.
-
-`t'
- Remove all leading pathname components, leaving the tail.
-
-`r'
- Remove a trailing suffix of the form `.SUFFIX', leaving the
- basename.
-
-`e'
- Remove all but the trailing suffix.
-
-`p'
- Print the new command but do not execute it.
-
-`s/OLD/NEW/'
- Substitute NEW for the first occurrence of OLD in the event line.
- Any delimiter may be used in place of `/'. The delimiter may be
- quoted in OLD and NEW with a single backslash. If `&' appears in
- NEW, it is replaced by OLD. A single backslash will quote the
- `&'. The final delimiter is optional if it is the last character
- on the input line.
-
-`&'
- Repeat the previous substitution.
-
-`g'
- Cause changes to be applied over the entire event line. Used in
- conjunction with `s', as in `gs/OLD/NEW/', or with `&'.
-
-
-File: history.info, Node: Programming with GNU History, Next: Concept Index, Prev: Using History Interactively, Up: Top
-
-Programming with GNU History
-****************************
-
- This chapter describes how to interface programs that you write with
-the GNU History Library. It should be considered a technical guide.
-For information on the interactive use of GNU History, *note Using
-History Interactively::..
-
-* Menu:
-
-* Introduction to History:: What is the GNU History library for?
-* History Storage:: How information is stored.
-* History Functions:: Functions that you can use.
-* History Variables:: Variables that control behaviour.
-* History Programming Example:: Example of using the GNU History Library.
-
-
-File: history.info, Node: Introduction to History, Next: History Storage, Up: Programming with GNU History
-
-Introduction to History
-=======================
-
- Many programs read input from the user a line at a time. The GNU
-History library is able to keep track of those lines, associate
-arbitrary data with each line, and utilize information from previous
-lines in composing new ones.
-
- The programmer using the History library has available functions for
-remembering lines on a history list, associating arbitrary data with a
-line, removing lines from the list, searching through the list for a
-line containing an arbitrary text string, and referencing any line in
-the list directly. In addition, a history "expansion" function is
-available which provides for a consistent user interface across
-different programs.
-
- The user using programs written with the History library has the
-benefit of a consistent user interface with a set of well-known
-commands for manipulating the text of previous lines and using that text
-in new commands. The basic history manipulation commands are similar to
-the history substitution provided by `csh'.
-
- If the programmer desires, he can use the Readline library, which
-includes some history manipulation by default, and has the added
-advantage of command line editing.
-
- Before declaring any functions using any functionality the History
-library provides in other code, an application writer should include
-the file `' in any file that uses the History
-library's features. It supplies extern declarations for all of the
-library's public functions and variables, and declares all of the
-public data structures.
-
-
-File: history.info, Node: History Storage, Next: History Functions, Prev: Introduction to History, Up: Programming with GNU History
-
-History Storage
-===============
-
- The history list is an array of history entries. A history entry is
-declared as follows:
-
- typedef struct _hist_entry {
- char *line;
- char *data;
- } HIST_ENTRY;
-
- The history list itself might therefore be declared as
-
- HIST_ENTRY **the_history_list;
-
- The state of the History library is encapsulated into a single
-structure:
-
- /* A structure used to pass the current state of the history stuff around. */
- typedef struct _hist_state {
- HIST_ENTRY **entries; /* Pointer to the entries themselves. */
- int offset; /* The location pointer within this array. */
- int length; /* Number of elements within this array. */
- int size; /* Number of slots allocated to this array. */
- int flags;
- } HISTORY_STATE;
-
- If the flags member includes `HS_STIFLED', the history has been
-stifled.
-
-
-File: history.info, Node: History Functions, Next: History Variables, Prev: History Storage, Up: Programming with GNU History
-
-History Functions
-=================
-
- This section describes the calling sequence for the various functions
-present in GNU History.
-
-* Menu:
-
-* Initializing History and State Management:: Functions to call when you
- want to use history in a
- program.
-* History List Management:: Functions used to manage the list
- of history entries.
-* Information About the History List:: Functions returning information about
- the history list.
-* Moving Around the History List:: Functions used to change the position
- in the history list.
-* Searching the History List:: Functions to search the history list
- for entries containing a string.
-* Managing the History File:: Functions that read and write a file
- containing the history list.
-* History Expansion:: Functions to perform csh-like history
- expansion.
-
-
-File: history.info, Node: Initializing History and State Management, Next: History List Management, Up: History Functions
-
-Initializing History and State Management
------------------------------------------
-
- This section describes functions used to initialize and manage the
-state of the History library when you want to use the history functions
-in your program.
-
- - Function: void using_history ()
- Begin a session in which the history functions might be used. This
- initializes the interactive variables.
-
- - Function: HISTORY_STATE * history_get_history_state ()
- Return a structure describing the current state of the input
- history.
-
- - Function: void history_set_history_state (HISTORY_STATE *state)
- Set the state of the history list according to STATE.
-
-
-File: history.info, Node: History List Management, Next: Information About the History List, Prev: Initializing History and State Management, Up: History Functions
-
-History List Management
------------------------
-
- These functions manage individual entries on the history list, or set
-parameters managing the list itself.
-
- - Function: void add_history (char *string)
- Place STRING at the end of the history list. The associated data
- field (if any) is set to `NULL'.
-
- - Function: HIST_ENTRY * remove_history (int which)
- Remove history entry at offset WHICH from the history. The
- removed element is returned so you can free the line, data, and
- containing structure.
-
- - Function: HIST_ENTRY * replace_history_entry (int which, char *line,
- char *data)
- Make the history entry at offset WHICH have LINE and DATA. This
- returns the old entry so you can dispose of the data. In the case
- of an invalid WHICH, a `NULL' pointer is returned.
-
- - Function: void clear_history ()
- Clear the history list by deleting all the entries.
-
- - Function: void stifle_history (int max)
- Stifle the history list, remembering only the last MAX entries.
-
- - Function: int unstifle_history ()
- Stop stifling the history. This returns the previous amount the
- history was stifled. The value is positive if the history was
- stifled, negative if it wasn't.
-
- - Function: int history_is_stifled ()
- Returns non-zero if the history is stifled, zero if it is not.
-
-
-File: history.info, Node: Information About the History List, Next: Moving Around the History List, Prev: History List Management, Up: History Functions
-
-Information About the History List
-----------------------------------
-
- These functions return information about the entire history list or
-individual list entries.
-
- - Function: HIST_ENTRY ** history_list ()
- Return a `NULL' terminated array of `HIST_ENTRY' which is the
- current input history. Element 0 of this list is the beginning of
- time. If there is no history, return `NULL'.
-
- - Function: int where_history ()
- Returns the offset of the current history element.
-
- - Function: HIST_ENTRY * current_history ()
- Return the history entry at the current position, as determined by
- `where_history ()'. If there is no entry there, return a `NULL'
- pointer.
-
- - Function: HIST_ENTRY * history_get (int offset)
- Return the history entry at position OFFSET, starting from
- `history_base'. If there is no entry there, or if OFFSET is
- greater than the history length, return a `NULL' pointer.
-
- - Function: int history_total_bytes ()
- Return the number of bytes that the primary history entries are
- using. This function returns the sum of the lengths of all the
- lines in the history.
-
-
-File: history.info, Node: Moving Around the History List, Next: Searching the History List, Prev: Information About the History List, Up: History Functions
-
-Moving Around the History List
-------------------------------
-
- These functions allow the current index into the history list to be
-set or changed.
-
- - Function: int history_set_pos (int pos)
- Set the position in the history list to POS, an absolute index
- into the list.
-
- - Function: HIST_ENTRY * previous_history ()
- Back up the current history offset to the previous history entry,
- and return a pointer to that entry. If there is no previous
- entry, return a `NULL' pointer.
-
- - Function: HIST_ENTRY * next_history ()
- Move the current history offset forward to the next history entry,
- and return the a pointer to that entry. If there is no next
- entry, return a `NULL' pointer.
-
-
-File: history.info, Node: Searching the History List, Next: Managing the History File, Prev: Moving Around the History List, Up: History Functions
-
-Searching the History List
---------------------------
-
- These functions allow searching of the history list for entries
-containing a specific string. Searching may be performed both forward
-and backward from the current history position. The search may be
-"anchored", meaning that the string must match at the beginning of the
-history entry.
-
- - Function: int history_search (char *string, int direction)
- Search the history for STRING, starting at the current history
- offset. If DIRECTION < 0, then the search is through previous
- entries, else through subsequent. If STRING is found, then the
- current history index is set to that history entry, and the value
- returned is the offset in the line of the entry where STRING was
- found. Otherwise, nothing is changed, and a -1 is returned.
-
- - Function: int history_search_prefix (char *string, int direction)
- Search the history for STRING, starting at the current history
- offset. The search is anchored: matching lines must begin with
- STRING. If DIRECTION < 0, then the search is through previous
- entries, else through subsequent. If STRING is found, then the
- current history index is set to that entry, and the return value
- is 0. Otherwise, nothing is changed, and a -1 is returned.
-
- - Function: int history_search_pos (char *string, int direction, int
- pos)
- Search for STRING in the history list, starting at POS, an
- absolute index into the list. If DIRECTION is negative, the search
- proceeds backward from POS, otherwise forward. Returns the
- absolute index of the history element where STRING was found, or
- -1 otherwise.
-
-
-File: history.info, Node: Managing the History File, Next: History Expansion, Prev: Searching the History List, Up: History Functions
-
-Managing the History File
--------------------------
-
- The History library can read the history from and write it to a file.
-This section documents the functions for managing a history file.
-
- - Function: int read_history (char *filename)
- Add the contents of FILENAME to the history list, a line at a
- time. If FILENAME is `NULL', then read from `~/.history'.
- Returns 0 if successful, or errno if not.
-
- - Function: int read_history_range (char *filename, int from, int to)
- Read a range of lines from FILENAME, adding them to the history
- list. Start reading at line FROM and end at TO. If FROM is zero,
- start at the beginning. If TO is less than FROM, then read until
- the end of the file. If FILENAME is `NULL', then read from
- `~/.history'. Returns 0 if successful, or `errno' if not.
-
- - Function: int write_history (char *filename)
- Write the current history to FILENAME, overwriting FILENAME if
- necessary. If FILENAME is `NULL', then write the history list to
- `~/.history'. Values returned are as in `read_history ()'.
-
- - Function: int append_history (int nelements, char *filename)
- Append the last NELEMENTS of the history list to FILENAME.
-
- - Function: int history_truncate_file (char *filename, int nlines)
- Truncate the history file FILENAME, leaving only the last NLINES
- lines.
-
-
-File: history.info, Node: History Expansion, Prev: Managing the History File, Up: History Functions
-
-History Expansion
------------------
-
- These functions implement `csh'-like history expansion.
-
- - Function: int history_expand (char *string, char **output)
- Expand STRING, placing the result into OUTPUT, a pointer to a
- string (*note History Interaction::.). Returns:
- `0'
- If no expansions took place (or, if the only change in the
- text was the de-slashifying of the history expansion
- character);
-
- `1'
- if expansions did take place;
-
- `-1'
- if there was an error in expansion;
-
- `2'
- if the returned line should be displayed, but not executed,
- as with the `:p' modifier (*note Modifiers::.).
-
- If an error ocurred in expansion, then OUTPUT contains a
- descriptive error message.
-
- - Function: char * history_arg_extract (int first, int last, char
- *string)
- Extract a string segment consisting of the FIRST through LAST
- arguments present in STRING. Arguments are broken up as in Bash.
-
- - Function: char * get_history_event (char *string, int *cindex, int
- qchar)
- Returns the text of the history event beginning at STRING +
- *CINDEX. *CINDEX is modified to point to after the event
- specifier. At function entry, CINDEX points to the index into
- STRING where the history event specification begins. QCHAR is a
- character that is allowed to end the event specification in
- addition to the "normal" terminating characters.
-
- - Function: char ** history_tokenize (char *string)
- Return an array of tokens parsed out of STRING, much as the shell
- might. The tokens are split on white space and on the characters
- `()<>;&|$', and shell quoting conventions are obeyed.
-
-
-File: history.info, Node: History Variables, Next: History Programming Example, Prev: History Functions, Up: Programming with GNU History
-
-History Variables
-=================
-
- This section describes the externally visible variables exported by
-the GNU History Library.
-
- - Variable: int history_base
- The logical offset of the first entry in the history list.
-
- - Variable: int history_length
- The number of entries currently stored in the history list.
-
- - Variable: int max_input_history
- The maximum number of history entries. This must be changed using
- `stifle_history ()'.
-
- - Variable: char history_expansion_char
- The character that starts a history event. The default is `!'.
-
- - Variable: char history_subst_char
- The character that invokes word substitution if found at the start
- of a line. The default is `^'.
-
- - Variable: char history_comment_char
- During tokenization, if this character is seen as the first
- character of a word, then it and all subsequent characters up to a
- newline are ignored, suppressing history expansion for the
- remainder of the line. This is disabled by default.
-
- - Variable: char * history_no_expand_chars
- The list of characters which inhibit history expansion if found
- immediately following HISTORY_EXPANSION_CHAR. The default is
- whitespace and `='.
-
- - Variable: char * history_search_delimiter_chars
- The list of additional characters which can delimit a history
- search string, in addition to whitespace, `:' and `?' in the case
- of a substring search. The default is empty.
-
- - Variable: int history_quotes_inhibit_expansion
- If non-zero, single-quoted words are not scanned for the history
- expansion character. The default value is 0.
-
- - Variable: Function * history_inhibit_expansion_function
- This should be set to the address of a function that takes two
- arguments: a `char *' (STRING) and an integer index into that
- string (I). It should return a non-zero value if the history
- expansion starting at STRING[I] should not be performed; zero if
- the expansion should be done. It is intended for use by
- applications like Bash that use the history expansion character
- for additional purposes. By default, this variable is set to NULL.
-
-
-File: history.info, Node: History Programming Example, Prev: History Variables, Up: Programming with GNU History
-
-History Programming Example
-===========================
-
- The following program demonstrates simple use of the GNU History
-Library.
-
- main ()
- {
- char line[1024], *t;
- int len, done = 0;
-
- line[0] = 0;
-
- using_history ();
- while (!done)
- {
- printf ("history$ ");
- fflush (stdout);
- t = fgets (line, sizeof (line) - 1, stdin);
- if (t && *t)
- {
- len = strlen (t);
- if (t[len - 1] == '\n')
- t[len - 1] = '\0';
- }
-
- if (!t)
- strcpy (line, "quit");
-
- if (line[0])
- {
- char *expansion;
- int result;
-
- result = history_expand (line, &expansion);
- if (result)
- fprintf (stderr, "%s\n", expansion);
-
- if (result < 0 || result == 2)
- {
- free (expansion);
- continue;
- }
-
- add_history (expansion);
- strncpy (line, expansion, sizeof (line) - 1);
- free (expansion);
- }
-
- if (strcmp (line, "quit") == 0)
- done = 1;
- else if (strcmp (line, "save") == 0)
- write_history ("history_file");
- else if (strcmp (line, "read") == 0)
- read_history ("history_file");
- else if (strcmp (line, "list") == 0)
- {
- register HIST_ENTRY **the_list;
- register int i;
-
- the_list = history_list ();
- if (the_list)
- for (i = 0; the_list[i]; i++)
- printf ("%d: %s\n", i + history_base, the_list[i]->line);
- }
- else if (strncmp (line, "delete", 6) == 0)
- {
- int which;
- if ((sscanf (line + 6, "%d", &which)) == 1)
- {
- HIST_ENTRY *entry = remove_history (which);
- if (!entry)
- fprintf (stderr, "No such entry %d\n", which);
- else
- {
- free (entry->line);
- free (entry);
- }
- }
- else
- {
- fprintf (stderr, "non-numeric arg given to `delete'\n");
- }
- }
- }
- }
-
-
-File: history.info, Node: Concept Index, Next: Function and Variable Index, Prev: Programming with GNU History, Up: Top
-
-Concept Index
-*************
-
-* Menu:
-
-* anchored search: Searching the History List.
-* event designators: Event Designators.
-* history events: Event Designators.
-* history expansion: History Interaction.
-* History Searching: Searching the History List.
-
-
-File: history.info, Node: Function and Variable Index, Prev: Concept Index, Up: Top
-
-Function and Variable Index
-***************************
-
-* Menu:
-
-* add_history: History List Management.
-* append_history: Managing the History File.
-* clear_history: History List Management.
-* current_history: Information About the History List.
-* get_history_event: History Expansion.
-* history_arg_extract: History Expansion.
-* history_base: History Variables.
-* history_comment_char: History Variables.
-* history_expand: History Expansion.
-* history_expansion_char: History Variables.
-* history_get: Information About the History List.
-* history_get_history_state: Initializing History and State Management.
-* history_inhibit_expansion_function: History Variables.
-* history_is_stifled: History List Management.
-* history_length: History Variables.
-* history_list: Information About the History List.
-* history_no_expand_chars: History Variables.
-* history_quotes_inhibit_expansion: History Variables.
-* history_search: Searching the History List.
-* history_search_delimiter_chars: History Variables.
-* history_search_pos: Searching the History List.
-* history_search_prefix: Searching the History List.
-* history_set_history_state: Initializing History and State Management.
-* history_set_pos: Moving Around the History List.
-* history_subst_char: History Variables.
-* history_tokenize: History Expansion.
-* history_total_bytes: Information About the History List.
-* history_truncate_file: Managing the History File.
-* max_input_history: History Variables.
-* next_history: Moving Around the History List.
-* previous_history: Moving Around the History List.
-* read_history: Managing the History File.
-* read_history_range: Managing the History File.
-* remove_history: History List Management.
-* replace_history_entry: History List Management.
-* stifle_history: History List Management.
-* unstifle_history: History List Management.
-* using_history: Initializing History and State Management.
-* where_history: Information About the History List.
-* write_history: Managing the History File.
-
-
-
-Tag Table:
-Node: Top1162
-Node: Using History Interactively1742
-Node: History Interaction2250
-Node: Event Designators3669
-Node: Word Designators4596
-Node: Modifiers6225
-Node: Programming with GNU History7363
-Node: Introduction to History8089
-Node: History Storage9774
-Node: History Functions10867
-Node: Initializing History and State Management11838
-Node: History List Management12630
-Node: Information About the History List14151
-Node: Moving Around the History List15457
-Node: Searching the History List16342
-Node: Managing the History File18174
-Node: History Expansion19680
-Node: History Variables21519
-Node: History Programming Example23837
-Node: Concept Index26441
-Node: Function and Variable Index26927
-
-End Tag Table
diff --git a/readline/doc/history.ps b/readline/doc/history.ps
deleted file mode 100644
index abd7810..0000000
--- a/readline/doc/history.ps
+++ /dev/null
@@ -1,1636 +0,0 @@
-%!PS-Adobe-2.0
-%%Creator: dvips(k) 5.82 Copyright 1998 Radical Eye Software
-%%Title: history.dvi
-%%Pages: 20
-%%PageOrder: Ascend
-%%BoundingBox: 0 0 612 792
-%%EndComments
-%DVIPSWebPage: (www.radicaleye.com)
-%DVIPSCommandLine: dvips -D 300 -t letter -o history.ps history.dvi
-%DVIPSParameters: dpi=300, compressed
-%DVIPSSource: TeX output 2000.01.19:1217
-%%BeginProcSet: texc.pro
-%!
-/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
-N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
-mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
-0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
-landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
-mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
-matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
-exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
-statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
-N/FBB[0 0 0 0]N/nn 0 N/IE 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
-/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
-/BitMaps X/BuildChar{CharBuilder}N/Encoding IE N end A{/foo setfont}2
-array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
-df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
-definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
-}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
-B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
-1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3
-1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx
-0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx
-sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{
-rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp
-gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B
-/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{
-/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{
-A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy
-get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse}
-ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp
-fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17
-{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add
-chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{
-1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop}
-forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
-/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
-}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
-bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
-mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
-SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
-userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
-1000 div/DVImag X/IE 256 array N 2 string 0 1 255{IE S A 360 add 36 4
-index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
-/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
-/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
-(LaserWriter 16/600)]{A length product length le{A length product exch 0
-exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
-end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
-grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
-imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
-exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
-fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
-delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
-B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
-p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
-rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
-
-%%EndProcSet
-TeXDict begin 40258431 52099146 1000 300 300 (history.dvi)
-@start
-%DVIPSBitmapFont: Fa cmti10 10.95 1
-/Fa 1 47 df<127012F8A212F012E005057B840E>46 D E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fb cmbxti10 14.4 1
-/Fb 1 47 df<120E123FEA7F80A212FFA21300127E123C0909798815>46
-D E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fc cmtt9 9 26
-/Fc 26 123 df95 D97
-D<12FCA2121CA513F8EA1DFEEA1F07EA1E03001C1380EB01C0A6EB0380001E1300EA1F0E
-EA1DFCEA0CF81217809614>II<137EA2130EA5EA07CEEA0FFEEA1C3EEA
-301EEA700E12E0A61270EA301EEA383E381FEFC0EA07CF12177F9614>II<13FCEA01FEEA038EEA07041300A3EA7FFE12FFEA0700ACEAFFF8A20F17
-7F9614>II<12FCA2121CA51378EA1DFEEA1F86EA1E07121CAA38FF8FE0A21317809614>I<1206
-120FA21206C7FCA4B4FCA21207ACEAFFF8A20D187C9714>I<12FCA2121CA5EBFF80A2EB
-1C005B5B5BEA1DC0EA1FE0A2EA1E70EA1C38133C131C7F38FF1F80A21117809614>107
-DII
-IIIII
-I<1206120EA4EA7FFC12FFEA0E00A8130EA3131CEA07F8EA01F00F157F9414>II<38FE3F80A2383C1E00EA1C1CA36C5A
-A3EA0630EA0770A36C5AA311107F8F14>I<38FE3F80A238700700EA380EA3EA39CEA3EA
-1B6C121AA3EA1E7CA2EA0E3811107F8F14>II<38FE3F80A2381C0E005B
-A2120E5BA212071330A2EA0370A25B1201A25BA3485A12730077C7FC127E123C11187F8F
-14>II E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fd cmsl9 9 1
-/Fd 1 47 df<1270A212F0126004047D830B>46 D E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fe cmr9 9 24
-/Fe 24 122 df48 D<12035AB4FC1207B3A2EA7FF80D187D
-9713>I54
-D<1240EA7FFF13FEA2EA4004EA80081310A2EA00201340A21380120113005AA25A1206A2
-120EA5120410197E9813>II
-I<39FFE1FFC0390E001C00AB380FFFFC380E001CAC39FFE1FFC01A1A7F991D>72
-D83
-D97 D99 D<133F1307A9EA03E7EA0C17EA180F487E127012E0A6126012706C
-5AEA1C373807C7E0131A7F9915>II103 D<12FC121CA9137CEA1D87381E0380A2121CAB38FF9FF014
-1A809915>I<1218123CA212181200A612FC121CAE12FF081A80990A>I110 DII<
-EAFC78EA1D9CEA1E1C1308EA1C00ABEAFF800E10808F0F>114 DI<1208A41218A21238EAFFC0EA3800A81320A41218EA1C40EA07800B177F960F>I<38
-FF0F80383C0700EA1C061304A26C5AA26C5AA3EA03A0A2EA01C0A36C5A11107F8F14>
-118 D<38FE3F80383C1E00EA1C086C5AEA0F306C5A6C5A12017F1203EA0270487E1208EA
-181CEA381E38FC3FC012107F8F14>120 D<38FF0F80383C0700EA1C061304A26C5AA26C
-5AA3EA03A0A2EA01C0A36C5AA248C7FCA212E112E212E4127811177F8F14>I
-E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Ff cmss10 10.95 2
-/Ff 2 42 df<13E0EA01C0EA0380120713005A121EA2121C123CA212381278A3127012F0
-AE12701278A31238123CA2121C121EA27E7E13801203EA01C0EA00E00B2E7CA112>40
-D<12E012707E123C121C121E7EA27E1380A2120313C0A3120113E0AE13C01203A3138012
-07A213005AA2121E121C123C12385A5A0B2E7EA112>I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fg cmbx10 12 27
-/Fg 27 123 df12 D<90380FFF80137F3801FC1F
-3803F03FEA07E0EA0FC0141FA7B6FCA2380FC01FB2397FF8FFF0A21C237FA220>I97 DII<49B4FC
-A2EB003FAB13FE3807FFBF380FC1FF48C67E003E7F127E127CA212FCA7127C127E123E6C
-5B380F81FF3907FF3FE0EA01FC1B237EA220>I<13FE3807FF80380F83C0381E01E0383E
-00F0127E007C13F8147812FCB512F8A200FCC7FCA3127CA26C1318A26C1330380F80E038
-03FFC0C6130015167E951A>II<9038FE0F803903FF9FC0380F83E338
-1F01F3391E00F000003E7FA5001E5BEA1F01380F83E0380BFF80D808FEC7FC0018C8FCA2
-121C381FFFE014FC6C13FF7E001F1480397C001FC00078130F00F81307A3007CEB0F806C
-EB1F00381F807E6CB45A000113E01A217F951D>II<121E123FEA7F80A4EA3F00121E
-C7FCA6EAFF80A2121FB2EAFFF0A20C247EA30F>I107 DI<3AFF03F8
-03F890390FFE0FFE3A1F183F183F9039201F201F014001C01380A201801380AE3BFFF0FF
-F0FFF0A22C167D9531>I<38FF03F0EB0FFC381F187EEB203EEB403FA21380AE39FFF1FF
-E0A21B167D9520>I<13FF000713E0380F81F0381F00F8003E137C48133EA300FC133FA7
-007C133E007E137E003E137C6C13F8380F81F03807FFE0C6130018167E951D>I<38FF87
-F0EBBFFC381FF07EEBC01F9038800F8015C0A2EC07E0A715C0140FA2EC1F8001C01300EB
-F07EEBBFFCEB8FE00180C7FCA8EAFFF0A21B207E9520>II<38FF0F80EB1FE0381F33F013631343A2EBC1E0EB8000AD
-EAFFF8A214167E9518>I<3807F980EA1FFFEA3807EA7003EAF001A26CC7FCB4FC13F8EA
-7FFE6C7E6C1380120738003FC0EAC007130312E0A200F0138038FC0F00EAEFFEEAC3F812
-167E9517>I<487EA41203A21207A2120F123FB5FCA2EA1F80ABEB8180A5380F830013C3
-EA07FEEA01F811207F9F16>I<38FF81FFA2381F803FAF5C5C380FC1BF3907FF3FE0EA01
-FC1B167D9520>I<39FFF01FE0A2391FC00700000F1306EBE00E0007130C13F000035BA2
-6C6C5AA26C6C5AA2EBFEE0EB7EC0137F6D5AA26DC7FCA2130EA21B167F951E>I<3AFFF3
-FF83FCA23A1F807C00E0D80FC014C08001E013010007017F1380A2D803F0EB0300ECCF83
-01F81387D801F913C61487D800FD13ECEBFF0315FC017F5BEB7E01013E5BEB3C00A20118
-136026167F9529>I<39FFF07FC0A2390FC01C006C6C5A6D5A00035B6C6C5A3800FD8013
-7F91C7FC7F6D7E497EEB37E0EB67F013C33801C1F8380380FC48487E000E137F39FF81FF
-E0A21B167F951E>I<39FFF01FE0A2391FC00700000F1306EBE00E0007130C13F000035B
-A26C6C5AA26C6C5AA2EBFEE0EB7EC0137F6D5AA26DC7FCA2130EA2130CA25B1278EAFC38
-13305BEA69C0EA7F80001FC8FC1B207F951E>I<387FFFF0A2387C07E038700FC0EA601F
-00E0138038C03F005B137EC65A1201485AEBF030EA07E0120FEBC070EA1F80003F1360EB
-00E0EA7E03B5FCA214167E9519>I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fh cmtt10 12 24
-/Fh 24 119 df<13E0A538F0E1E0EAFCE7387EEFC0381FFF00EA07FCEA01F0EA07FCEA1F
-FF387EEFC038FCE7E0EAF0E13800E000A513157D991A>42 D<1338137CA2136C13EEA313
-C6A2EA01C7A438038380A4380701C0A213FFA24813E0EA0E00A4481370387F01FC38FF83
-FE387F01FC171E7F9D1A>65 D69 D<387FFFFCB5FC7E380E001CA51400A2EB03
-80A3EA0FFFA3EA0E03A390C7FCA8EA7FE012FF127F161E7F9D1A>I<38FF83FEA3381C00
-70AA381FFFF0A3381C0070AB38FF83FEA3171E7F9D1A>72 DI<38FE03FE12FFA2381D8070A213C0121CA213E0A213601370A213
-301338A21318131CA2130C130EA21306A213071303A238FF81F0A21380171E7F9D1A>78
-DI82 D<3803F1C0EA0FFDEA3FFFEA7C0FEA700312E01301A390C7FC12
-701278123FEA1FF0EA07FE3800FF80EB0FC0EB01E013001470A2126012E0A214E0EAF001
-38FC03C0B5128000EF1300EAE3FC141E7D9D1A>I<387FFFFEB5FCA238E0380EA5000013
-00B33803FF80A3171E7F9D1A>I<38FF01FEA3381C00706C13E0A2380701C0A213830003
-138013C700011300A2EA00EEA2137CA21338AA48B4FCA3171E7F9D1A>89
-D<387FFFC0B512E0A26C13C013047D7E1A>95 D97 D99
-DI<12FEA3120EA6133EEBFF80000F
-13C013C1EB80E01300120EAC38FFE3FE13E713E3171E7F9D1A>104
-DI<
-EAFE3EEBFF80B512C0EA0FC1EB80E01300120EAC38FFE3FE13E713E317157F941A>110
-DI<387F81F838FF8FFC38
-7F9FFE3803FE1EEBF80CEBE000A25B5BAAEA7FFFB5FC7E17157F941A>114
-D<487E1203A6387FFFE0B5FCA238038000AA1470A43801C1E013FF6C1380EB3F00141C7F
-9B1A>116 D<38FE0FE0A3EA0E00AD1301EA0F033807FFFE7EEA00FC17157F941A>I<387F
-C7FC00FF13FE007F13FC380E00E0A3380701C0A338038380A33801C700A3EA00EEA3137C
-A2133817157F941A>I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fi cmbx12 13.14 41
-/Fi 41 123 df12
-D<123C127E12FFA4127E123C08087C8711>46 D<131C133C13FC12FFA21200B3AA387FFF
-FCA216237CA21F>49 D<48B4FC000713C0381E07F0383803F8386001FC387C00FE12FE14
-FF147FA2127C003813FFC7FC14FEA2EB01FC14F8EB03F0EB07E01480EB0F00131E5B1370
-EBE003EA01C038038007380700061206380FFFFE5A5A4813FCB5FCA218237DA21F>I<48
-B4FC000713E0381E03F0383801F8003C13FC387E00FEA3123EEA1C01000013FCA2EB03F8
-EB07F0EB0FC03801FF00A2380007E0EB01F014F8EB00FC14FE14FFA21210127C12FEA214
-FEA2387C01FC007013F8383E07F0380FFFC00001130018237DA21F>I<14381478A214F8
-1301130313071306130C131C13381330136013E0EA01C01380EA03005A120E5A12185A12
-705AB612C0A2390001F800A790387FFFC0A21A237EA21F>I<0018130C001F137CEBFFF8
-14F014E014C01480EBFC000018C7FCA513FF001B13E0381F03F0381C00F8000813FCC712
-7EA3147FA2127812FCA3147E5A006013FC1270383801F8381E07E03807FFC03801FE0018
-237DA21F>II<1230123C003FB512C0A2
-15804814005C5C38600018A200E05B485B5CC6485AA249C7FC1306130EA25BA2133CA25B
-A213F8A41201A66C5A13601A257DA41F>I<141CA2143EA3147FA24A7EA39038019FC0A2
-9038031FE0140F01077FEB0607A2010C7F1403011C7FEB1801A2496C7EA2017FB5FCA290
-39E0007F8049133FA2484880151F00038190C7120FA2486E7ED8FFF090B51280A229257E
-A42E>65 D68
-DII72 DI76 D
-I<01FF1380000713E3380F80F7381E001F48130F481307140312F81401A27E91C7FCB4FC
-EA7FE013FE383FFFE014F86C13FE00077F6C1480C67E010313C0EB003FEC0FE01407A200
-C01303A315C07E6C13076C14806CEB0F0038FFC03E38E3FFF838803FE01B257DA422>83
-D87
-D97
-DIII<137F3803FFC03807C1F0380F80F8EA1F0048137C127E147E
-12FEA2B512FEA248C7FCA3127EA214067E6C130C380F80183807E0703803FFE038007F80
-17187E971C>II<3901FF07C00007EBDFE0380F83F1EA1F01393E00F800
-007E7FA6003E5B6C485A380F83E0EBFFC0001190C7FC0030C8FCA21238123C383FFFE06C
-13FC806C7F481480383C003F48EB0FC000F81307A4007CEB0F806CEB1F00381F807E3807
-FFF8C613C01B247E971F>II<120FEA1F80EA3FC0A4EA1F80EA0F00
-C7FCA7EA7FC0A2120FB3A2EAFFF8A20D277EA611>I108 D<26FF80FE137F903A83FF81FFC03B0F8E0FC707E0019813CC903A9007E8
-03F001A013F0A201C013E0AF3BFFFC7FFE3FFFA230187E9733>I<38FF80FE903883FF80
-390F8E0FC0139890389007E013A0A213C0AF39FFFC7FFEA21F187E9722>II<38FFC1FCEBCFFF390FFC1FC09038F0
-07E001C013F0140315F8140115FCA8EC03F8A215F0EBE0079038F00FE09038DC1F809038
-CFFF00EBC3F801C0C7FCA9EAFFFCA21E237F9722>I<38FF83E0EB8FF8380F8C7CEB90FC
-13B013A01478EBE0005BAEEAFFFEA216187F9719>114 D<3807F8C0EA1FFFEA3C07EA70
-01EAF000A300FC1300B47EEA7FFC7F383FFF80000F13C0120338001FE01303EAC001A212
-E014C0EAF00338FC078038EFFF00EAC3FC13187E9718>I<13C0A41201A312031207120F
-121FB512C0A2380FC000AC1460A63807E0C013E13801FF8038007E0013237FA218>I<39
-FFC07FE0A2000F1307B0140FA200071317EBE0673903FFC7FE38007F071F187E9722>I<
-39FFF80FF8A2390FC001C015803907E00300A26D5A00031306EBF80E0001130C13FC0000
-5B13FEEB7E30A26D5AA214E06D5AA26D5AA26DC7FCA21D187F9720>I<39FFF83FF0A239
-0FC00F003807E00E6C6C5A6D5A6C6C5A00001360EB7EC06D5AA2131F6D7E497E80EB33F8
-1361EBE0FC3801C07E3803807F3907003F8048131F39FFC07FF8A21D187F9720>120
-D<39FFF80FF8A2390FC001C015803907E00300A26D5A00031306EBF80E0001130C13FC00
-005B13FEEB7E30A26D5AA214E06D5AA26D5AA26DC7FCA21306A25B1230EA781CEAFC185B
-1370EA68E0EA7FC0001FC8FC1D237F9720>I<387FFFF8A2387C03F0EA700738600FE000
-E013C0EB1F80EAC03F1400137EEA00FE5B485A0003130C13F0EA07E0120FEBC01C381F80
-18003F1338387F0078387E01F8B5FCA216187E971B>I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fj cmsl10 10.95 30
-/Fj 30 122 df<903803F07C90381E0DC69038380F0FEB701E01E0130EEC0C003801C01C
-A548485A007FB512C03903803800A448485AA6000E5BA648485A001E7F38FF8FFC20207E
-9F1B>11 DI<903803F03F9039
-1E09E0809039380F80C09039701F01E0EBE03E021E13C02601C01CC7FCA548485A007FB6
-12803903803803A43A0700700700A6000EEBE00EA64848485A001EEBE01E3AFF8FF8FFC0
-23207E9F26>14 D<13201360A4383061C0383C4380380E4E00EA0778EA01E0A2EA07B8EA
-1C9CEA708FEAE083EA0180A490C7FC12147AA117>42 D<13181338EA01F8EA0E701200A5
-13E0A6EA01C0A6EA0380A6EA07001380EAFFFC0E1E7B9D17>49 DI<13
-FFEA01FE1380A5EA0300A61206A65AA65AA65AA65AA6B4FCA2102D7EA10D>91
-D<13FFEA01FEEA0006A5130CA61318A61330A61360A613C0A6EA0180A6EAFF00A2102D82
-A10D>93 D97 D<13FEEA0383380E0780121C00
-38130090C7FC12785AA45AA37E5BEA70026C5AEA1C18EA07E011147D9314>99
-D<1438EB01F8EB00781438A21470A614E013FCEA0382EA0601121CEA3C00383801C01278
-12F0A438E00380A412F0EA700738380F00381C37803807C7E015207D9F19>I<13F8EA07
-0EEA0E07121C383803801278127012F0A2B5FC00F0C7FC5AA46C5AEA7002EA3004EA1C18
-EA07E011147D9314>II<140EEB3E11EBE1A33801C1C238
-0381E0EA07801301120FA3380703C01480EB8700EA04FC48C7FCA21218121CEA0FFF14C0
-14E0381800F04813305A5AA3006013606C13C0381C0700EA07FC181F809417>I<13E012
-0712011200A2485AA6485AEB8F80EB90E013A0EBC0601380000713E01300A5380E01C0A6
-381C0380001E13C038FF8FF014207E9F19>II<13E0120712011200
-A2EA01C0A6EA0380A6EA0700A6120EA65A121EEAFF800B207F9F0C>108
-D<390387C07C391F9861863907A072073903C03403EB80380007EB7807EB0070A5000EEB
-E00EA64848485A001EEBE01E3AFFCFFCFFC022147E9326>I<38038F80381F90E0EA07A0
-3803C0601380000713E01300A5380E01C0A6381C0380001E13C038FF8FF014147E9319>
-I<13FCEA0387380E0180381C00C04813E0A24813F012F0A438E001E0A214C0130300F013
-8038700700EA380E6C5AEA07E014147D9317>IIIII<1380EA0100
-A35A5A5A121EEAFFF8EA0E00A45AA65A1310A41320A2EA1840EA0F800D1C7C9B12>I<38
-1C0380EAFC1FEA3C07EA1C03A238380700A6EA700EA4131EA25BEA305E381F9F8011147B
-9319>I<38FF83F8381E00E0001C13C01480121E380E01005B13025B12075BA25BEA0390
-13A013E05B5B120190C7FC15147C9318>I<39FF9FE1FC393C078070391C030060148015
-401580EA0E0790380D81001309EB19C21311380F21C4EA0720EB40C814E8EB80F0A26C48
-5A1460000213401E147C9321>I<381FF0FF3803C0780001137014403800E0C0EBE180EB
-73001376133CA2131C132E134E1387EA0107380203801204380C01C0383C03E038FE07FC
-18147F9318>I<390FF83F803901E00E00EBC00C140813E000005B143014205C13705CA2
-0171C7FC1339133A133E133C133813181310A25BA25BEA70C0EAF08000F1C8FC12E61278
-191D809318>I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fk cmbx12 17.28 36
-/Fk 36 122 df49 DI<1578A215FCA34A7E
-A24A7EA24A7FA34A7FEC0E7F021E7FEC1C3FA202387F151F02787FEC700FA202E07F1507
-010180ECC003A249486C7EA201078191C7FC498191B6FCA24981011CC7123F013C810138
-141FA24981160F01F081491407A2484881486C1403B549B512FCA336317DB03D>65
-DI<913A03FF800180023F
-EBF00349B5EAFC0701079038003F0FD91FF8EB079FD93FC0EB01FFD9FF807F4848C8127F
-4848153F0007161F49150F485A001F1607A2485A1703127FA24992C7FCA212FFA9127FA2
-7FEF0380123FA26C7E1707000F17006C7E6D150E0003161E6C6C151C6C6C6C1478D93FC0
-5CD91FF8EB03E0D907FFEB3F800101D9FFFEC7FCD9003F13F80203138031317CB03A>I<
-B812E0A3C6903880007FEE0FF016031601A21600A21770A31738A21507A21700A35D5D5D
-91B5FCA3EC803F818181A592C8FCACB612C0A32D317EB033>70 DIII78
-D80
-D<007FB8FCA39039C00FF801D87E00EC003F007C82007882A200708200F01780A3481603
-A5C792C7FCB3AA017FB6FCA331307DAF38>84 DII97 DIIIII<90391FF007C09039FFFE3F
-E03A01F83F79F03907E00FC3000F14E19039C007E0E0001FECF000A2003F80A5001F5CA2
-000F5CEBE00F00075C2603F83FC7FC3806FFFE380E1FF090C9FC121EA2121F7F90B57E6C
-14F015FC6C806C801680000F15C0003FC7127F007EEC1FE0007C140F00FC1407A4007EEC
-0FC0003E1580003F141FD80FC0EB7E003907F803FC0001B512F0D8001F90C7FC242F7E9F
-28>III108 D<2703F007F8EB1FE000FFD93FFEEBFFF8913A783F01
-E0FC02C090388300FE280FF1801FC6137F2607F30013CC01F602F8148001FC5CA3495CB3
-B500C3B5380FFFFCA33E207D9F43>I<3903F007F800FFEB3FFEEC783F02C013803A0FF1
-801FC03807F30001F614E013FCA35BB3B500C3B5FCA328207D9F2D>II<3901F83FE000FFEBFFFC9038FBE07F9039FF00
-3F80D80FFEEB1FC06C48EB0FE04914F0ED07F8A216FC1503A216FEA816FC1507A216F8A2
-ED0FF06D14E06DEB1FC06DEB3F809039FBC0FE009038F8FFF8EC3FC091C8FCABB512C0A3
-272E7E9F2D>I<3803F03F00FFEB7FC09038F1C3E01487390FF30FF0EA07F6A29038FC07
-E0EC03C091C7FCA25BB2B512E0A31C207E9F21>114 D<3801FF86000713FEEA1F00003C
-133E48131E140E12F8A36C90C7FCB47E13FC387FFFC06C13F0806C7F00077F00017FEA00
-3F01001380143F0060131F00E0130FA27E15007E6C131E6C131C38FF807838F3FFF038C0
-7F8019207D9F20>I<131CA5133CA3137CA213FC120112031207381FFFFEB5FCA2D803FC
-C7FCB0EC0380A71201EC0700EA00FEEB7F0EEB3FFCEB07F0192E7FAD1F>IIII<3A7FFF807FFCA33A03FC000F006C6C131E6C6C5BEC803890387FC078013F5B90
-381FE1E090380FF3C0ECFF806D90C7FC6D5A13016D7E81815B903803DFE09038078FF081
-90380F07FC90381E03FEEB3C01496C7E4914804848EB7FC00003EC3FE026FFFC01B5FCA3
-28207F9F2B>II E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fl cmsy10 10.95 1
-/Fl 1 14 df<14FF010713E090381F00F80178131E01E01307D80180EB018048C812C000
-061560481530A248151848150CA2481506A4481503A900601506A46C150CA26C15186C15
-30A26C15606C15C06C6CEB0180D800E0EB07000178131E011F13F8903807FFE0010090C7
-FC282B7EA02D>13 D E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fm cmbx12 14.4 45
-/Fm 45 122 df<123C127FEAFF80A213C0A3127F123E1200A2EA0180A3EA0300A2120612
-0E5A5A12100A157B8813>44 D<121C127FA2EAFF80A3EA7F00A2121C09097B8813>46
-D<130E131E137EEA07FE12FFA212F81200B3ABB512FEA317277BA622>49
-DII<140FA25C5C5C5C5BA2EB03
-BFEB073F130E131C133C1338137013E0EA01C0EA038012071300120E5A5A5A12F0B612F8
-A3C7EA7F00A890381FFFF8A31D277EA622>I<00181303381F801FEBFFFE5C5C5C14C091
-C7FC001CC8FCA7EB7FC0381DFFF8381F80FC381E003F1208C7EA1F8015C0A215E0A21218
-127C12FEA315C05A0078EB3F80A26CEB7F00381F01FE6CB45A000313F0C613801B277DA6
-22>I65 DI<91387FE003903907FFFC07011FEBFF0F90397FF0
-0F9F9039FF0001FFD801FC7F4848147F4848143F4848141F485A160F485A1607127FA290
-C9FC5AA97E7F1607123FA26C7E160E6C7E6C6C141C6C6C143C6C6C14786CB4EB01F09039
-7FF007C0011FB512800107EBFE009038007FF028297CA831>I69
-DI<91387FE003903907
-FFFC07011FEBFF0F90397FF00F9F9039FF0001FFD801FC7F484880484880484880485A82
-485A82127FA290CAFC5AA892B512F87E7F03001300123FA26C7EA26C7E6C7E6C7E6C7E6C
-B45B90387FF007011FB5129F0107EBFE0F9039007FF0032D297CA835>III77
-DI80
-D82 D<9038FF80600003EBF0E0000F13F8381F80FD383F
-001F003E1307481303A200FC1301A214007EA26C140013C0EA7FFCEBFFE06C13F86C13FE
-80000714806C14C0C6FC010F13E0EB007FEC1FF0140F140700E01303A46C14E0A26C1307
-6C14C0B4EB0F80EBE03F39E3FFFE0000E15B38C01FF01C297CA825>I85 DII<3803FF80000F13F0381F01FC383F80
-FE147F801580EA1F00C7FCA4EB3FFF3801FC3FEA0FE0EA1F80EA3F00127E5AA4145F007E
-13DF393F839FFC381FFE0F3803FC031E1B7E9A21>97 DIIII<
-EB07F8EB3FFCEB7E3E3801FC7FEA03F813F01207143E1400A7B512C0A33807F000B3A338
-7FFF80A3182A7EA915>I<9038FF80F00003EBE3F8390FC1FE1C391F007C7C48137E003E
-EB3E10007EEB3F00A6003E133E003F137E6C137C380FC1F8380BFFE00018138090C8FC12
-38A2123C383FFFF814FF6C14C06C14E06C14F0121F383C0007007CEB01F8481300A4007C
-EB01F0A2003FEB07E0390FC01F806CB5120038007FF01E287E9A22>II<1207EA0F80EA1FC0EA3FE0A3EA1FC0EA0F80EA0700C7FCA7EAFFE0A3120F
-B3A3EAFFFEA30F2B7EAA12>I108
-D<26FFC07FEB1FC0903AC1FFC07FF0903AC307E0C1F8D80FC49038F101FC9039C803F200
-01D801FE7F01D05BA201E05BB03CFFFE3FFF8FFFE0A3331B7D9A38>I<38FFC07E9038C1
-FF809038C30FC0D80FC413E0EBC80701D813F013D0A213E0B039FFFE3FFFA3201B7D9A25
->II<38FFE1FE9038EFFF809038FE0FE0390FF803F09038F001F801E013FC
-140015FEA2157FA8157E15FEA215FC140101F013F89038F807F09038FC0FE09038EFFF80
-9038E1FC0001E0C7FCA9EAFFFEA320277E9A25>I<38FFC1F0EBC7FCEBC63E380FCC7F13
-D813D0A2EBF03EEBE000B0B5FCA3181B7F9A1B>114 D<3803FE30380FFFF0EA3E03EA78
-00127000F01370A27E00FE1300EAFFE06CB4FC14C06C13E06C13F0000713F8C6FCEB07FC
-130000E0137C143C7E14387E6C137038FF01E038E7FFC000C11300161B7E9A1B>I<13E0
-A41201A31203A21207120F381FFFE0B5FCA2380FE000AD1470A73807F0E0000313C03801
-FF8038007F0014267FA51A>I<39FFE07FF0A3000F1307B2140FA2000713173903F067FF
-3801FFC738007F87201B7D9A25>I<39FFFC03FFA3390FF000F0000714E07F0003EB01C0
-A2EBFC0300011480EBFE070000140013FFEB7F0EA2149EEB3F9C14FC6D5AA26D5AA36D5A
-A26D5AA2201B7F9A23>I<3BFFFC7FFC1FFCA33B0FE00FE001C02607F007EB0380A201F8
-EBF00700031600EC0FF801FC5C0001150EEC1FFC2600FE1C5B15FE9039FF387E3C017F14
-38EC787F6D486C5A16F0ECE01F011F5CA26D486C5AA2EC800701075CA22E1B7F9A31>I<
-39FFFC1FFEA33907F003803803F8079038FC0F003801FE1E00005BEB7F3814F86D5A6D5A
-130F806D7E130F497EEB3CFEEB38FFEB787F9038F03F803901E01FC0D803C013E0EB800F
-39FFF03FFFA3201B7F9A23>I<39FFFC03FFA3390FF000F0000714E07F0003EB01C0A2EB
-FC0300011480EBFE070000140013FFEB7F0EA2149EEB3F9C14FC6D5AA26D5AA36D5AA26D
-5AA25CA21307003890C7FCEA7C0FEAFE0E131E131C5BEA74F0EA3FE0EA0F8020277F9A23
->I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fn cmtt10 10.95 75
-/Fn 75 127 df<127012F8B012701200A5127012F8A31270051C779B18>33
-DI
-I<13C01201A3EA03F0EA0FFCEA3FFEEA7DCFEA71C738E1C38013C7A338F1C0001279123F
-6C7EEA0FF8EA01FC13DE13CF13C73861C38012F1A212E1EBC7001271EA79DEEA3FFEEA1F
-F8EA07E0EA01C0A3120011247D9F18>III<1238127CA2127E
-123E120EA3121CA2123812F812F012C0070E789B18>I<137013F0EA01E0EA03C0EA0780
-EA0F00121E121C5AA25AA45AA81270A47EA27E121E7EEA0780EA03C0EA01F0120013700C
-24799F18>I<126012F012787E7E7EEA07801203EA01C0A2EA00E0A41370A813E0A4EA01
-C0A2EA03801207EA0F00121E5A5A5A12600C247C9F18>II<136013F0A7387FFFC0B512E0A26C13C03800F000A7136013147E9718>I<121C
-123E127E127F123F121F1207120E121E127C12F81260080C788518>I<387FFFC0B512E0
-A26C13C013047E8F18>I<1230127812FCA2127812300606778518>I<1303EB0780A2130F
-14005B131EA2133E133C137C1378A213F85B12015B12035BA212075B120F90C7FCA25A12
-1E123E123CA2127C127812F85AA2126011247D9F18>IIII<131F5B1377A213E7120113C7EA038712
-071307120E121E123C1238127812F0B512F8A338000700A6EB7FF0A3151C7F9B18>52
-D<137E48B4FC00071380380F83C0EA1E03121C3838018090C7FC5AA2EAE1F8EAE7FEB5FC
-38FE078038F803C0EAF001EB00E05AA21270A3383801C0EA3C03381E0780380FFF006C5A
-EA01F8131C7E9B18>54 D<1230127812FCA2127812301200A81230127812FCA212781230
-0614779318>58 D<1218123C127EA2123C12181200A81218123C127EA2123E121E120E12
-1C123C127812F01260071A789318>I<14C0EB03E01307EB1FC0EB3F80EBFE00485AEA07
-F0485AEA3F8048C7FC12FCA2127F6C7EEA0FE06C7EEA01FC6C7EEB3F80EB1FC0EB07E013
-03EB00C013187E9918>I<387FFFC0B512E0A26C13C0C8FCA4387FFFC0B512E0A26C13C0
-130C7E9318>I<126012F87E127F6C7EEA0FE06C7EEA01FC6C7EEB3F80EB1FC0EB07E0A2
-EB1FC0EB3F80EBFE00485AEA07F0485AEA3F8048C7FC12FC5A126013187E9918>II<137013F8A213D8A2EA01DCA3138CEA038EA4EA0707
-A5380FFF80A3EA0E03381C01C0A3387F07F000FF13F8007F13F0151C7F9B18>65
-D68 DII<387F07F038FF
-8FF8387F07F0381C01C0A9EA1FFFA3EA1C01AA387F07F038FF8FF8387F07F0151C7F9B18
->72 DI76 D<387E07F038FF0FF8387F07F0381D81C0
-A313C1121CA213E1A313611371A213311339A31319A2131D130DA3EA7F07EAFF87EA7F03
-151C7F9B18>78 DII<
-EA7FF8EAFFFE6C7E381C0F80130314C01301A313031480130F381FFF005BA2EA1C0F7FEB
-0380A5149CA3387F01F8EAFF81387F00F0161C7F9B18>82 D<3803F1C0EA1FFF5AEA7C0F
-EA7003EAE001A390C7FC12701278123FEA1FF0EA07FEC67EEB0F80EB03C01301EB00E0A2
-126012E0130100F013C038F80780B5FCEBFE00EAE7F8131C7E9B18>I<387FFFF8B5FCA2
-38E07038A400001300B2EA07FFA3151C7F9B18>I<38FF83FEA3381C0070B36C13E0EA0F
-01380783C03803FF806C1300EA007C171C809B18>I<38FE03F8EAFF07EAFE03381C01C0
-EA1E03000E1380EA0F0700071300A2EA038EA2EA01DCA3EA00F8A21370A9EA01FC487E6C
-5A151C7F9B18>89 D91
-D<126012F0A27E1278127C123CA2123E121E121F7EA27F12077F1203A27F12017F12007F
-1378A2137C133C133E131EA2131F7F14801307A2EB030011247D9F18>III<387FFFC0B512E0A26C13C013047E7F18>I<1206121E123E12381270A212E0A312F8
-12FC127CA21238070E789E18>II<127E
-12FE127E120EA5133EEBFF80000F13C0EBC1E01380EB0070120E1438A6000F1370A2EB80
-E013C1EBFFC0000E138038063E00151C809B18>II<
-EB1F80133F131F1303A5EA03E3EA0FFBEA1FFFEA3C1FEA380FEA7007130312E0A6EA7007
-A2EA380FEA3C1F381FFFF0380FFBF83803E3F0151C7E9B18>III<3801E1F03807FFF85A381E1E30381C0E00
-487EA5EA1C0EEA1E1EEA1FFC5BEA39E00038C7FC7EEA1FFEEBFFC04813E0387801F03870
-0070481338A4007813F0EA7E03381FFFC06C13803801FC00151F7F9318>I<127E12FE12
-7E120EA5133EEBFF80000F13C013C1EB80E01300120EAB387FC7FC38FFE7FE387FC7FC17
-1C809B18>II108 D<38F9C1C038FFF7F013FF383E3E
-38EA3C3CA2EA3838AB38FE3E3EEB7E7EEB3E3E1714809318>IIII<3801F380EA07FBEA1FFFEA3E1FEA380FEA7007A2EAE003A6EA7007A2
-EA380FEA3C1FEA1FFFEA0FFBEA03E3EA0003A7EB1FF0EB3FF8EB1FF0151E7E9318>I<38
-FF0FC0EB3FE0EB7FF0EA07F0EBE060EBC0005BA290C7FCA9EAFFFC7F5B14147E9318>I<
-EA07F7EA3FFF5AEA780FEAE007A3007CC7FCEA7FE0EA1FFCEA03FEEA001F38600780EAE0
-03A212F038F80F00B5FC13FCEAE7F011147D9318>I<487E1203A4387FFFC0B5FCA23803
-8000A9144014E0A33801C1C013FF6C1380EB3E0013197F9818>I<387E07E0EAFE0FEA7E
-07EA0E00AC1301EA0F033807FFFC6C13FE3801FCFC1714809318>I<387F8FF000FF13F8
-007F13F0381C01C0380E0380A338070700A3138FEA038EA3EA01DCA3EA00F8A213701514
-7F9318>I<38FF07F8138F1307383800E0A4381C01C0137113F9A213D9EA1DDD000D1380
-A3138DEA0F8FA23807070015147F9318>I<387F8FF0139F138F380F0700EA078EEA039E
-EA01DC13F81200137013F07FEA01DCEA039E138EEA0707000E1380387F8FF000FF13F800
-7F13F015147F9318>I<387F8FF000FF13F8007F13F0380E01C0EB0380A21207EB0700A2
-EA0387A2138EEA01CEA213CC120013DC1378A31370A313F05B1279EA7BC0EA7F806CC7FC
-121E151E7F9318>I<383FFFF05AA2387001E0EB03C0EB078038000F00131E5B13F8485A
-EA03C0485A380F0070121E5A5AB512F0A314147F9318>II<126012
-F0B3B012600424769F18>I<127CB4FC13C01203C67EAB7FEB7FC0EB3FE0A2EB7FC0EBF0
-005BABEA03C012FF90C7FC127C13247E9F18>II E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fo cmr10 10.95 75
-/Fo 75 123 df<90381F83E09038F06E303901C07878380380F8903800F03048EB7000A7
-B612803907007000B2383FE3FF1D20809F1B>11 D<133FEBE0C0EA01C0380381E0EA0701
-A290C7FCA6B512E0EA0700B2383FC3FC1620809F19>II<90381F81F89038F04F043901C07C063903
-80F80FEB00F05A0270C7FCA6B7FC3907007007B23A3FE3FE3FE02320809F26>I34
-D<127012F812FCA212741204A31208A21210A212201240060E7C9F0D>39
-D<13401380EA01005A12061204120C5AA212381230A212701260A412E0AC1260A4127012
-30A212381218A27E120412067E7EEA008013400A2E7BA112>I<7E12407E12307E120812
-0C7EA212077EA213801201A413C0AC1380A412031300A25A1206A25A120812185A12205A
-5A0A2E7EA112>I<127012F012F8A212781208A31210A31220A21240050E7C840D>44
-DI<127012F8A3127005057C840D>I48 D<13801203120F12F31203B3A6EA07C0EAFFFE0F1E7C9D17>III<1306A2130EA2131E132EA2134E138EA2EA010E1202A212041208A212101220A2
-124012C0B512F038000E00A7EBFFE0141E7F9D17>II<137CEA0182EA0701380E0380EA0C07121838
-38030090C7FC12781270A2EAF1F0EAF21CEAF406EAF807EB0380A200F013C0A51270A214
-801238EB07001218EA0C0E6C5AEA01F0121F7E9D17>I<1240387FFFE014C0A238400080
-38800100A21302485AA25B5BA25BA21360A213E05B1201A41203A76C5A131F7E9D17>I<
-EA03F0EA0C0CEA1006EA3003382001801260A3127038780300123EEA3F06EA1FC8EA0FF0
-EA03F8487EEA0C7EEA103F38300F80EA6007EB01C012C01300A31480EA600100201300EA
-1002EA0C0CEA03F0121F7E9D17>II<127012F8A312701200AA127012F8A3127005147C93
-0D>I<127012F8A312701200AA127012F012F8A212781208A31210A31220A21240051D7C
-930D>I<5B497EA3497EA3EB09E0A3EB10F0A3EB2078A3497EA2EBC03EEB801EA248B5FC
-EB000FA20002EB0780A348EB03C0A2120C001E14E039FF801FFE1F207F9F22>65
-DI<90380FE0109038381C30
-9038E002703803C00139078000F048C71270121E15305A1510127C127800F81400A91278
-007C1410123CA26C1420A27E6C6C13406C6C13803900E00300EB380CEB0FF01C217E9F21
->IIII<90380FE01090
-38381C309038E002703803C00139078000F048C71270121E15305A1510127C127800F814
-00A7EC3FFEEC01F000781300127C123CA27EA27E6C7E3903C001703900E002309038380C
-1090380FF0001F217E9F24>I<39FFF07FF8390F000780AD90B5FCEB0007AF39FFF07FF8
-1D1F7E9E22>II<3807FFC038003E00131EB3A3
-122012F8A3EAF01CEA403CEA6038EA1070EA0FC012207F9E17>I76 DIIIIII<3803F040
-380C0CC0EA1803EA3001EA6000A212E01440A36C13007E127CEA7F80EA3FF86CB4FC0007
-1380C613C0EB1FE013031301EB00F014707EA46C136014E06C13C038F8018038C60300EA
-81FC14217E9F19>I<007FB512E038780F010060EB006000401420A200C0143000801410
-A400001400B3497E3803FFFC1C1F7E9E21>I<39FFF00FF8390F0003E0EC0080B3A46CEB
-01001380120314026C6C5A6C6C5AEB3830EB0FC01D207E9E22>I<39FFF003FE391F8000
-F86CC7126015206C6C1340A36C6C1380A2EBE00100011400A23800F002A213F8EB7804A2
-6D5AA36D5AA2131F6D5AA2EB07C0A36D5AA36DC7FC1F207F9E22>I<3BFFF07FF81FF03B
-1F000FC007C06C903907800180170015C001805C00071502EC09E013C000035DEC19F014
-10D801E05CA2EC2078D800F05CA2EC403C01785CA2EC801E017C1460013C144090383D00
-0F133F6D5CA2011E1307010E91C7FCA2010C7F010413022C207F9E2F>I<12FFA212C0B3
-B3A512FFA2082D7CA10D>91 DI<12FFA21203B3B3A512FFA2082D80A10D>I<12081210
-1220A21240A21280A312B812FCA2127C1238060E7D9F0D>96 DI<121C12FC121CAA137CEA1D87381E0180EB00C0001C13E01470A21478A6
-147014F014E0001E13C0381A018038198700EA107C15207E9F19>IIII<13
-7CEA01C6EA030F1207EA0E061300A7EAFFF0EA0E00B2EA7FE01020809F0E>I<14E03803
-E330EA0E3CEA1C1C38380E00EA780FA5EA380E6C5AEA1E38EA33E00020C7FCA21230A2EA
-3FFE381FFF8014C0383001E038600070481330A4006013606C13C0381C03803803FC0014
-1F7F9417>I<121C12FC121CAA137C1386EA1D03001E1380A2121CAE38FF8FF014207E9F
-19>I<1238127CA31238C7FCA6121C12FC121CB1EAFF80091F7F9E0C>I<13E0EA01F0A3EA
-00E01300A61370EA07F012001370B3A31260EAF06013C0EA6180EA3F000C28829E0E>I<
-121C12FC121CAAEB1FE0EB0780EB060013045B5B5B136013E0EA1DF0EA1E70EA1C38133C
-131C7F130F7F148014C038FF9FF014207E9F18>I<121C12FC121CB3ABEAFF8009207F9F
-0C>I<391C3E03E039FCC30C30391D039038391E01E01CA2001C13C0AE3AFF8FF8FF8021
-147E9326>IIII<3801
-F04038070CC0EA0E02EA1C03EA38011278127012F0A6127012781238EA1C03EA0C05EA07
-09EA01F1EA0001A8EB0FF8151D7F9318>III<1202A31206A2120E
-A2123EEAFFF8EA0E00AB1304A5EA07081203EA01F00E1C7F9B12>I<381C0380EAFC1FEA
-1C03AE1307120CEA061B3803E3F014147E9319>I<38FF83F8383E00E0001C13C06C1380
-A338070100A21383EA0382A2EA01C4A213E4EA00E8A21370A3132015147F9318>I<39FF
-9FE1FC393C078070391C030060EC8020000E1440A214C0D80704138014E0A23903886100
-1471A23801D032143A143E3800E01CA2EB6018EB40081E147F9321>I<38FF87F8381E03
-C0380E0180EB0300EA0702EA0384EA01C813D8EA00F01370137813F8139CEA010E1202EA
-060738040380000C13C0003C13E038FE07FC16147F9318>I<38FF83F8383E00E0001C13
-C06C1380A338070100A21383EA0382A2EA01C4A213E4EA00E8A21370A31320A25BA3EAF0
-80A200F1C7FC1262123C151D7F9318>I
-I E
-%EndDVIPSBitmapFont
-%DVIPSBitmapFont: Fp cmbx12 20.736 13
-/Fp 13 122 df71 DI76
-D78
-D85 D97 D<13FE12FFA412071203B04AB4
-FC021F13F0027F13FC9138FC03FE9039FFF000FF02C0EB3F8091C7EA1FC04915E0EE0FF0
-17F8A2EE07FCA317FEA917FCA3160F17F817F0161F6D15E06EEB3FC06EEB7F80D9F9E0EB
-FF009039F0FC07FE91387FFFF8D9E01F13E09026C003FEC7FC2F3C7DBB36>I105 D<903801FFC0010F13F8017F13FFD9FF807F3A03FE003FE0D807F8EB0FF0
-48486D7EA248486D7E003F81A248486D7EA400FF1680A9007F1600A36C6C495AA2001F5D
-6D1307000F5D6C6C495AD803FEEB3FE03A00FF80FF806DB5C7FC010F13F8010113C02926
-7DA530>111 D<3901FC03F000FFEB0FFC4AB4FC91383C3F80EC707F00079038E0FFC000
-035BEBFD80A201FFEB7F809138003F00151E92C7FC5BB3A3B512FCA422267DA528>114
-D<90383FF0383903FFFE7848EBFFF8381FC00F383F0003003E13005A157812FCA27E6C14
-0013C013FC387FFFF06C13FEECFF806C14C06C14E0000314F0C614F8011F13FCEB007FEC
-07FE0070130100F01300157E7EA27E157C6C14FC6C14F890388001F09038F00FE000F9B5
-12C0D8F07F130038C01FF81F267DA526>I<130FA55BA45BA25BA25B5A5A5A001FEBFFF0
-B6FCA3000190C7FCB3153CA86C14781480017F13F090383FC1E090381FFFC06D13809038
-01FE001E377EB626>I121 D E
-%EndDVIPSBitmapFont
-end
-%%EndProlog
-%%BeginSetup
-%%Feature: *Resolution 300dpi
-TeXDict begin
-%%BeginPaperSize: Letter
-letter
-%%EndPaperSize
-
-%%EndSetup
-%%Page: 1 1
-1 0 bop 75 693 a Fp(GNU)33 b(History)f(Library)p 75 743
-1800 17 v 960 791 a Fo(Edition)16 b(4.1,)e(for)h Fn(History)f(Library)g
-Fo(V)l(ersion)i(4.1.)1609 845 y(Jan)o(uary)f(2000)75
-2467 y Fm(Brian)23 b(F)-6 b(o)n(x,)23 b(F)-6 b(ree)23
-b(Soft)n(w)n(are)f(F)-6 b(oundation)75 2534 y(Chet)22
-b(Ramey)-6 b(,)23 b(Case)e(W)-6 b(estern)23 b(Reserv)n(e)f(Univ)n
-(ersit)n(y)p 75 2570 1800 9 v eop
-%%Page: 2 2
-2 1 bop 75 250 a Fo(This)21 b(do)q(cumen)o(t)g(describ)q(es)h(the)f
-(GNU)f(History)g(library)l(,)j(a)d(programming)g(to)q(ol)g(that)g(pro)o
-(vides)h(a)75 305 y(consisten)o(t)15 b(user)h(in)o(terface)f(for)g
-(recalling)i(lines)f(of)f(previously)i(t)o(yp)q(ed)e(input.)75
-373 y(Published)i(b)o(y)f(the)f(F)l(ree)g(Soft)o(w)o(are)f(F)l
-(oundation)75 427 y(59)h(T)l(emple)h(Place,)f(Suite)i(330,)75
-482 y(Boston,)d(MA)h(02111)f(USA)75 549 y(P)o(ermission)j(is)f(gran)o
-(ted)g(to)f(mak)o(e)h(and)g(distribute)i(v)o(erbatim)d(copies)i(of)f
-(this)h(man)o(ual)f(pro)o(vided)h(the)75 604 y(cop)o(yrigh)o(t)e
-(notice)h(and)f(this)h(p)q(ermission)g(notice)g(are)f(preserv)o(ed)h
-(on)f(all)h(copies.)75 671 y(P)o(ermission)c(is)h(gran)o(ted)e(to)g
-(cop)o(y)h(and)g(distribute)h(mo)q(di\014ed)g(v)o(ersions)f(of)f(this)h
-(man)o(ual)g(under)h(the)f(con-)75 726 y(ditions)k(for)e(v)o(erbatim)h
-(cop)o(ying,)g(pro)o(vided)h(that)e(the)h(en)o(tire)h(resulting)g
-(deriv)o(ed)g(w)o(ork)e(is)h(distributed)75 781 y(under)h(the)f(terms)g
-(of)g(a)f(p)q(ermission)j(notice)f(iden)o(tical)h(to)e(this)g(one.)75
-848 y(P)o(ermission)i(is)g(gran)o(ted)f(to)g(cop)o(y)h(and)f
-(distribute)i(translations)f(of)f(this)h(man)o(ual)g(in)o(to)f(another)
-g(lan-)75 903 y(guage,)e(under)h(the)f(ab)q(o)o(v)o(e)g(conditions)i
-(for)d(mo)q(di\014ed)j(v)o(ersions,)e(except)h(that)f(this)h(p)q
-(ermission)g(notice)75 958 y(ma)o(y)f(b)q(e)i(stated)f(in)h(a)f
-(translation)g(appro)o(v)o(ed)g(b)o(y)g(the)g(F)l(ree)h(Soft)o(w)o(are)
-d(F)l(oundation.)75 2661 y(Cop)o(yrigh)o(t)301 2660 y(c)289
-2661 y Fl(\015)i Fo(1988-1999)e(F)l(ree)i(Soft)o(w)o(are)f(F)l
-(oundation,)h(Inc.)p eop
-%%Page: 1 3
-1 2 bop 75 -58 a Fo(Chapter)15 b(1:)k(Using)d(History)f(In)o(teractiv)o
-(ely)1007 b(1)75 183 y Fk(1)41 b(Using)26 b(History)h(In)n(teractiv)n
-(ely)137 317 y Fo(This)16 b(c)o(hapter)f(describ)q(es)i(ho)o(w)d(to)h
-(use)g(the)g(GNU)g(History)g(Library)h(in)o(teractiv)o(ely)l(,)g(from)e
-(a)h(user's)75 372 y(standp)q(oin)o(t.)35 b(It)20 b(should)g(b)q(e)h
-(considered)h(a)d(user's)h(guide.)35 b(F)l(or)19 b(information)h(on)g
-(using)h(the)f(GNU)75 427 y(History)d(Library)h(in)h(y)o(our)e(o)o(wn)g
-(programs,)f(see)i(Chapter)f(2)h([Programming)e(with)i(GNU)f(History],)
-75 482 y(page)e(5.)75 625 y Fm(1.1)33 b(History)22 b(Expansion)137
-727 y Fo(The)c(History)g(library)h(pro)o(vides)f(a)f(history)h
-(expansion)h(feature)e(that)h(is)g(similar)h(to)e(the)h(history)75
-782 y(expansion)12 b(pro)o(vided)g(b)o(y)f Fn(csh)p Fo(.)18
-b(This)11 b(section)h(describ)q(es)g(the)g(syn)o(tax)e(used)h(to)g
-(manipulate)h(the)f(history)75 836 y(information.)137
-909 y(History)k(expansions)h(in)o(tro)q(duce)h(w)o(ords)d(from)g(the)i
-(history)f(list)h(in)o(to)f(the)h(input)g(stream,)e(making)75
-964 y(it)h(easy)g(to)g(rep)q(eat)g(commands,)g(insert)h(the)f(argumen)o
-(ts)f(to)h(a)g(previous)h(command)f(in)o(to)g(the)g(curren)o(t)75
-1019 y(input)h(line,)h(or)d(\014x)i(errors)e(in)i(previous)g(commands)f
-(quic)o(kly)l(.)137 1092 y(History)j(expansion)i(tak)o(es)d(place)i(in)
-h(t)o(w)o(o)d(parts.)28 b(The)19 b(\014rst)f(is)g(to)g(determine)i
-(whic)o(h)f(line)h(from)75 1147 y(the)h(history)f(list)i(should)g(b)q
-(e)f(used)g(during)h(substitution.)37 b(The)21 b(second)g(is)g(to)f
-(select)i(p)q(ortions)e(of)75 1202 y(that)15 b(line)i(for)d(inclusion)k
-(in)o(to)d(the)h(curren)o(t)f(one.)20 b(The)c(line)g(selected)h(from)e
-(the)g(history)g(is)h(called)h(the)75 1256 y Fj(ev)o(en)o(t)p
-Fo(,)c(and)h(the)g(p)q(ortions)g(of)f(that)g(line)i(that)e(are)g(acted)
-h(up)q(on)g(are)f(called)j Fj(w)o(ords)p Fo(.)i(V)l(arious)c
-Fj(mo)q(di\014ers)75 1311 y Fo(are)i(a)o(v)m(ailable)i(to)e(manipulate)
-i(the)e(selected)i(w)o(ords.)23 b(The)17 b(line)h(is)f(brok)o(en)f(in)o
-(to)h(w)o(ords)e(in)j(the)e(same)75 1366 y(fashion)c(that)e(Bash)i(do)q
-(es,)g(so)f(that)g(sev)o(eral)g(w)o(ords)g(surrounded)h(b)o(y)f(quotes)
-h(are)f(considered)h(one)g(w)o(ord.)75 1421 y(History)18
-b(expansions)h(are)g(in)o(tro)q(duced)g(b)o(y)f(the)h(app)q(earance)g
-(of)f(the)g(history)h(expansion)g(c)o(haracter,)75 1475
-y(whic)o(h)d(is)g(`)p Fn(!)p Fo(')e(b)o(y)h(default.)75
-1599 y Fi(1.1.1)30 b(Ev)n(en)n(t)21 b(Designators)137
-1701 y Fo(An)16 b(ev)o(en)o(t)f(designator)g(is)g(a)g(reference)h(to)f
-(a)g(command)g(line)i(en)o(try)d(in)i(the)g(history)f(list.)75
-1789 y Fn(!)216 b Fo(Start)16 b(a)g(history)h(substitution,)g(except)h
-(when)f(follo)o(w)o(ed)g(b)o(y)f(a)h(space,)g(tab,)f(the)h(end)g(of)315
-1844 y(the)e(line,)i(`)p Fn(=)p Fo(')d(or)h(`)p Fn(\()p
-Fo('.)75 1929 y Fn(!)p Fj(n)191 b Fo(Refer)16 b(to)e(command)h(line)i
-Fj(n)p Fo(.)75 2015 y Fn(!-)p Fj(n)167 b Fo(Refer)16
-b(to)e(the)i(command)f Fj(n)g Fo(lines)i(bac)o(k.)75
-2100 y Fn(!!)192 b Fo(Refer)16 b(to)e(the)i(previous)f(command.)20
-b(This)c(is)g(a)f(synon)o(ym)g(for)f(`)p Fn(!-1)p Fo('.)75
-2186 y Fn(!)p Fj(string)102 b Fo(Refer)16 b(to)e(the)i(most)e(recen)o
-(t)h(command)g(starting)g(with)g Fj(string)p Fo(.)75
-2271 y Fn(!?)p Fj(string)t Fn([?])315 2326 y Fo(Refer)i(to)f(the)h
-(most)f(recen)o(t)h(command)g(con)o(taining)g Fj(string)p
-Fo(.)25 b(The)17 b(trailing)g(`)p Fn(?)p Fo(')f(ma)o(y)g(b)q(e)315
-2381 y(omitted)f(if)h(the)f Fj(string)k Fo(is)d(follo)o(w)o(ed)f
-(immediately)i(b)o(y)e(a)g(newline.)75 2466 y Fn(^)p
-Fj(string1)t Fn(^)p Fj(string2)t Fn(^)315 2521 y Fo(Quic)o(k)i
-(Substitution.)23 b(Rep)q(eat)17 b(the)f(last)f(command,)h(replacing)h
-Fj(string1)i Fo(with)e Fj(string2)p Fo(.)315 2576 y(Equiv)m(alen)o(t)g
-(to)d Fn(!!:s/)p Fj(string1)t Fn(/)p Fj(string2)t Fn(/)p
-Fo(.)75 2661 y Fn(!#)192 b Fo(The)15 b(en)o(tire)h(command)f(line)i(t)o
-(yp)q(ed)f(so)e(far.)p eop
-%%Page: 2 4
-2 3 bop 75 -58 a Fo(2)1347 b(GNU)15 b(History)g(Library)75
-183 y Fi(1.1.2)30 b(W)-5 b(ord)20 b(Designators)137 279
-y Fo(W)l(ord)d(designators)g(are)g(used)h(to)f(select)h(desired)h(w)o
-(ords)d(from)h(the)g(ev)o(en)o(t.)26 b(A)18 b(`)p Fn(:)p
-Fo(')e(separates)h(the)75 334 y(ev)o(en)o(t)j(sp)q(eci\014cation)h
-(from)e(the)h(w)o(ord)f(designator.)34 b(It)20 b(ma)o(y)f(b)q(e)h
-(omitted)g(if)g(the)g(w)o(ord)f(designator)75 389 y(b)q(egins)f(with)g
-(a)e(`)p Fn(^)p Fo(',)h(`)p Fn($)p Fo(',)f(`)p Fn(*)p
-Fo(',)g(`)p Fn(-)p Fo(',)g(or)h(`)p Fn(\045)p Fo('.)24
-b(W)l(ords)17 b(are)g(n)o(um)o(b)q(ered)g(from)g(the)g(b)q(eginning)i
-(of)e(the)g(line,)75 444 y(with)j(the)g(\014rst)f(w)o(ord)h(b)q(eing)h
-(denoted)f(b)o(y)g(0)f(\(zero\).)33 b(W)l(ords)20 b(are)f(inserted)i
-(in)o(to)f(the)g(curren)o(t)f(line)75 498 y(separated)c(b)o(y)g(single)
-i(spaces.)137 574 y(F)l(or)e(example,)75 653 y Fn(!!)192
-b Fo(designates)18 b(the)g(preceding)i(command.)28 b(When)18
-b(y)o(ou)g(t)o(yp)q(e)g(this,)h(the)f(preceding)h(com-)315
-708 y(mand)c(is)h(rep)q(eated)g(in)g(toto.)75 787 y Fn(!!:$)144
-b Fo(designates)12 b(the)f(last)g(argumen)o(t)f(of)h(the)g(preceding)i
-(command.)19 b(This)11 b(ma)o(y)g(b)q(e)h(shortened)315
-842 y(to)j Fn(!$)p Fo(.)75 921 y Fn(!fi:2)120 b Fo(designates)15
-b(the)g(second)g(argumen)o(t)f(of)g(the)h(most)f(recen)o(t)g(command)h
-(starting)f(with)h(the)315 976 y(letters)g Fn(fi)p Fo(.)137
-1055 y(Here)h(are)f(the)g(w)o(ord)f(designators:)75 1134
-y Fn(0)h(\(zero\))57 b Fo(The)15 b Fn(0)p Fo(th)g(w)o(ord.)20
-b(F)l(or)14 b(man)o(y)h(applications,)h(this)g(is)g(the)f(command)g(w)o
-(ord.)75 1214 y Fj(n)215 b Fo(The)15 b Fj(n)p Fo(th)h(w)o(ord.)75
-1293 y Fn(^)216 b Fo(The)15 b(\014rst)g(argumen)o(t;)f(that)h(is,)g(w)o
-(ord)g(1.)75 1372 y Fn($)216 b Fo(The)15 b(last)h(argumen)o(t.)75
-1451 y Fn(\045)216 b Fo(The)15 b(w)o(ord)g(matc)o(hed)g(b)o(y)g(the)g
-(most)g(recen)o(t)g(`)p Fn(?)p Fj(string)t Fn(?)p Fo(')f(searc)o(h.)75
-1530 y Fj(x)p Fn(-)p Fj(y)168 b Fo(A)15 b(range)g(of)g(w)o(ords;)f(`)p
-Fn(-)p Fj(y)t Fo(')g(abbreviates)i(`)p Fn(0-)p Fj(y)t
-Fo('.)75 1610 y Fn(*)216 b Fo(All)15 b(of)f(the)f(w)o(ords,)g(except)i
-(the)f Fn(0)p Fo(th.)19 b(This)14 b(is)h(a)e(synon)o(ym)h(for)f(`)p
-Fn(1-$)p Fo('.)18 b(It)c(is)g(not)g(an)g(error)315 1664
-y(to)g(use)h(`)p Fn(*)p Fo(')f(if)i(there)e(is)i(just)e(one)h(w)o(ord)f
-(in)i(the)f(ev)o(en)o(t;)f(the)h(empt)o(y)g(string)g(is)g(returned)g
-(in)315 1719 y(that)f(case.)75 1798 y Fj(x)s Fn(*)189
-b Fo(Abbreviates)16 b(`)p Fj(x)p Fn(-$)p Fo(')75 1878
-y Fj(x)p Fn(-)192 b Fo(Abbreviates)16 b(`)p Fj(x)p Fn(-$)p
-Fo(')e(lik)o(e)i(`)p Fj(x)s Fn(*)p Fo(',)e(but)i(omits)f(the)g(last)g
-(w)o(ord.)137 1957 y(If)i(a)g(w)o(ord)f(designator)h(is)h(supplied)h
-(without)e(an)g(ev)o(en)o(t)f(sp)q(eci\014cation,)j(the)e(previous)h
-(command)75 2012 y(is)e(used)f(as)g(the)h(ev)o(en)o(t.)75
-2123 y Fi(1.1.3)30 b(Mo)r(di\014ers)137 2219 y Fo(After)10
-b(the)h(optional)g(w)o(ord)e(designator,)i(y)o(ou)f(can)h(add)f(a)g
-(sequence)i(of)e(one)g(or)g(more)g(of)g(the)g(follo)o(wing)75
-2274 y(mo)q(di\014ers,)16 b(eac)o(h)f(preceded)i(b)o(y)e(a)g(`)p
-Fn(:)p Fo('.)75 2353 y Fn(h)216 b Fo(Remo)o(v)o(e)15
-b(a)g(trailing)h(pathname)f(comp)q(onen)o(t,)g(lea)o(ving)h(only)g(the)
-f(head.)75 2432 y Fn(t)216 b Fo(Remo)o(v)o(e)15 b(all)h(leading)h
-(pathname)e(comp)q(onen)o(ts,)g(lea)o(ving)h(the)f(tail.)75
-2512 y Fn(r)216 b Fo(Remo)o(v)o(e)15 b(a)g(trailing)h(su\016x)f(of)g
-(the)g(form)g(`)p Fn(.)p Fj(su\016x)s Fo(',)f(lea)o(ving)i(the)f
-(basename.)75 2591 y Fn(e)216 b Fo(Remo)o(v)o(e)15 b(all)h(but)g(the)f
-(trailing)h(su\016x.)75 2670 y Fn(p)216 b Fo(Prin)o(t)15
-b(the)g(new)h(command)f(but)g(do)g(not)g(execute)h(it.)p
-eop
-%%Page: 3 5
-3 4 bop 75 -58 a Fo(Chapter)15 b(1:)k(Using)d(History)f(In)o(teractiv)o
-(ely)1007 b(3)75 183 y Fn(s/)p Fj(old)r Fn(/)p Fj(new)t
-Fn(/)315 238 y Fo(Substitute)17 b Fj(new)j Fo(for)c(the)h(\014rst)e(o)q
-(ccurrence)j(of)e Fj(old)i Fo(in)f(the)g(ev)o(en)o(t)f(line.)25
-b(An)o(y)16 b(delimiter)315 293 y(ma)o(y)c(b)q(e)h(used)g(in)g(place)g
-(of)f(`)p Fn(/)p Fo('.)18 b(The)13 b(delimiter)h(ma)o(y)e(b)q(e)h
-(quoted)f(in)i Fj(old)g Fo(and)f Fj(new)k Fo(with)12
-b(a)315 348 y(single)j(bac)o(kslash.)20 b(If)15 b(`)p
-Fn(&)p Fo(')e(app)q(ears)h(in)h Fj(new)p Fo(,)f(it)g(is)h(replaced)g(b)
-o(y)f Fj(old)p Fo(.)20 b(A)14 b(single)i(bac)o(kslash)315
-402 y(will)j(quote)e(the)h(`)p Fn(&)p Fo('.)25 b(The)17
-b(\014nal)i(delimiter)g(is)f(optional)g(if)f(it)h(is)g(the)f(last)g(c)o
-(haracter)g(on)315 457 y(the)e(input)h(line.)75 537 y
-Fn(&)216 b Fo(Rep)q(eat)16 b(the)f(previous)h(substitution.)75
-617 y Fn(g)216 b Fo(Cause)19 b(c)o(hanges)h(to)e(b)q(e)i(applied)h(o)o
-(v)o(er)e(the)g(en)o(tire)h(ev)o(en)o(t)f(line.)34 b(Used)20
-b(in)g(conjunction)315 671 y(with)c(`)p Fn(s)p Fo(',)d(as)i(in)h
-Fn(gs/)p Fj(old)r Fn(/)p Fj(new)t Fn(/)p Fo(,)f(or)g(with)g(`)p
-Fn(&)p Fo('.)p eop
-%%Page: 4 6
-4 5 bop 75 -58 a Fo(4)1347 b(GNU)15 b(History)g(Library)p
-eop
-%%Page: 5 7
-5 6 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g
-(History)889 b(5)75 183 y Fk(2)41 b(Programming)28 b(with)e(GNU)i
-(History)137 282 y Fo(This)16 b(c)o(hapter)e(describ)q(es)j(ho)o(w)d
-(to)g(in)o(terface)h(programs)e(that)h(y)o(ou)h(write)g(with)g(the)g
-(GNU)f(History)75 337 y(Library)l(.)24 b(It)17 b(should)g(b)q(e)g
-(considered)h(a)e(tec)o(hnical)i(guide.)25 b(F)l(or)15
-b(information)i(on)f(the)h(in)o(teractiv)o(e)g(use)75
-391 y(of)e(GNU)g(History)l(,)g(see)g(Chapter)g(1)g([Using)g(History)g
-(In)o(teractiv)o(ely],)h(page)f(1.)75 509 y Fm(2.1)33
-b(In)n(tro)r(duction)24 b(to)e(History)137 602 y Fo(Man)o(y)c(programs)
-g(read)h(input)g(from)f(the)h(user)g(a)f(line)j(at)d(a)g(time.)31
-b(The)19 b(GNU)g(History)f(library)75 656 y(is)k(able)g(to)e(k)o(eep)i
-(trac)o(k)e(of)h(those)g(lines,)j(asso)q(ciate)d(arbitrary)g(data)f
-(with)i(eac)o(h)f(line,)j(and)e(utilize)75 711 y(information)15
-b(from)g(previous)h(lines)h(in)f(comp)q(osing)f(new)h(ones.)137
-775 y(The)e(programmer)f(using)h(the)g(History)g(library)g(has)g(a)o(v)
-m(ailable)h(functions)g(for)e(remem)o(b)q(ering)h(lines)75
-830 y(on)c(a)g(history)h(list,)g(asso)q(ciating)g(arbitrary)f(data)f
-(with)i(a)f(line,)j(remo)o(ving)d(lines)i(from)d(the)i(list,)h(searc)o
-(hing)75 884 y(through)17 b(the)h(list)g(for)f(a)h(line)h(con)o
-(taining)f(an)g(arbitrary)f(text)g(string,)h(and)g(referencing)h(an)o
-(y)e(line)i(in)75 939 y(the)c(list)i(directly)l(.)22
-b(In)16 b(addition,)g(a)f(history)g Fj(expansion)h Fo(function)h(is)e
-(a)o(v)m(ailable)i(whic)o(h)g(pro)o(vides)f(for)e(a)75
-994 y(consisten)o(t)h(user)h(in)o(terface)f(across)g(di\013eren)o(t)g
-(programs.)137 1058 y(The)f(user)h(using)f(programs)f(written)h(with)g
-(the)g(History)g(library)h(has)f(the)g(b)q(ene\014t)h(of)e(a)h
-(consisten)o(t)75 1112 y(user)20 b(in)o(terface)f(with)h(a)f(set)h(of)f
-(w)o(ell-kno)o(wn)h(commands)g(for)e(manipulating)k(the)d(text)g(of)g
-(previous)75 1167 y(lines)c(and)f(using)h(that)e(text)g(in)i(new)f
-(commands.)19 b(The)14 b(basic)h(history)e(manipulation)j(commands)d
-(are)75 1222 y(similar)j(to)f(the)g(history)g(substitution)h(pro)o
-(vided)g(b)o(y)g Fn(csh)p Fo(.)137 1286 y(If)f(the)g(programmer)f
-(desires,)h(he)g(can)g(use)g(the)g(Readline)i(library)l(,)f(whic)o(h)f
-(includes)j(some)c(history)75 1340 y(manipulation)j(b)o(y)e(default,)g
-(and)h(has)f(the)g(added)h(adv)m(an)o(tage)f(of)f(command)h(line)i
-(editing.)137 1404 y(Before)i(declaring)i(an)o(y)d(functions)i(using)g
-(an)o(y)f(functionalit)o(y)h(the)f(History)g(library)h(pro)o(vides)f
-(in)75 1459 y(other)14 b(co)q(de,)h(an)f(application)i(writer)e(should)
-i(include)g(the)f(\014le)g Fn()d
-Fo(in)j(an)o(y)f(\014le)75 1513 y(that)d(uses)h(the)h(History)e
-(library's)i(features.)18 b(It)12 b(supplies)i(extern)e(declarations)h
-(for)e(all)i(of)f(the)g(library's)75 1568 y(public)17
-b(functions)f(and)g(v)m(ariables,)g(and)f(declares)h(all)g(of)f(the)h
-(public)h(data)d(structures.)75 1686 y Fm(2.2)33 b(History)22
-b(Storage)137 1778 y Fo(The)16 b(history)f(list)h(is)g(an)f(arra)o(y)f
-(of)g(history)i(en)o(tries.)k(A)15 b(history)g(en)o(try)g(is)h
-(declared)g(as)f(follo)o(ws:)195 1839 y Fn(typedef)23
-b(struct)g(_hist_entry)f({)243 1891 y(char)h(*line;)243
-1943 y(char)g(*data;)195 1995 y(})h(HIST_ENTRY;)137 2058
-y Fo(The)16 b(history)f(list)h(itself)g(migh)o(t)f(therefore)g(b)q(e)h
-(declared)g(as)195 2119 y Fn(HIST_ENTRY)22 b(**the_history_list;)137
-2183 y Fo(The)16 b(state)e(of)h(the)g(History)g(library)h(is)g
-(encapsulated)g(in)o(to)f(a)g(single)i(structure:)195
-2243 y Fn(/*)24 b(A)f(structure)g(used)g(to)h(pass)f(the)h(current)f
-(state)g(of)g(the)h(history)f(stuff)g(around.)g(*/)p
-2033 2253 21 42 v 195 2295 a(typedef)g(struct)g(_hist_state)f({)243
-2347 y(HIST_ENTRY)g(**entries;)214 b(/*)23 b(Pointer)g(to)h(the)f
-(entries)g(themselves.)f(*/)243 2399 y(int)h(offset;)453
-b(/*)23 b(The)h(location)e(pointer)h(within)g(this)h(array.)f(*/)p
-2033 2409 V 243 2451 a(int)g(length;)453 b(/*)23 b(Number)g(of)h
-(elements)f(within)g(this)g(array.)g(*/)p 1985 2461 V
-243 2503 a(int)g(size;)501 b(/*)23 b(Number)g(of)h(slots)f(allocated)g
-(to)g(this)h(array.)f(*/)p 2057 2513 V 243 2555 a(int)g(flags;)195
-2606 y(})h(HISTORY_STATE;)137 2670 y Fo(If)16 b(the)f(\015ags)g(mem)o
-(b)q(er)g(includes)j Fn(HS_STIFLED)p Fo(,)13 b(the)i(history)h(has)f(b)
-q(een)h(sti\015ed.)p eop
-%%Page: 6 8
-6 7 bop 75 -58 a Fo(6)1347 b(GNU)15 b(History)g(Library)75
-183 y Fm(2.3)33 b(History)22 b(F)-6 b(unctions)137 278
-y Fo(This)21 b(section)g(describ)q(es)h(the)f(calling)h(sequence)g(for)
-e(the)g(v)m(arious)h(functions)g(presen)o(t)g(in)g(GNU)75
-333 y(History)l(.)75 441 y Fi(2.3.1)30 b(Initializing)20
-b(History)h(and)f(State)g(Managemen)n(t)137 536 y Fo(This)e(section)g
-(describ)q(es)h(functions)f(used)g(to)e(initialize)21
-b(and)c(manage)g(the)g(state)g(of)g(the)g(History)75
-591 y(library)f(when)g(y)o(ou)f(w)o(an)o(t)f(to)g(use)i(the)f(history)g
-(functions)h(in)g(y)o(our)f(program.)1650 679 y(F)l(unction)-1749
-b Fh(void)20 b Fg(using)p 333 679 18 3 v 20 w(history)j
-Ff(\(\))195 734 y Fo(Begin)18 b(a)f(session)h(in)g(whic)o(h)g(the)g
-(history)f(functions)h(migh)o(t)f(b)q(e)h(used.)27 b(This)18
-b(initializes)195 788 y(the)d(in)o(teractiv)o(e)h(v)m(ariables.)1650
-877 y(F)l(unction)-1749 b Fh(HISTORY_STATE)21 b(*)e Fg(history)p
-657 877 V 21 w(get)p 755 877 V 21 w(history)p 951 877
-V 21 w(state)j Ff(\(\))195 931 y Fo(Return)16 b(a)f(structure)g
-(describing)i(the)e(curren)o(t)g(state)f(of)h(the)g(input)i(history)l
-(.)1650 1019 y(F)l(unction)-1749 b Fh(void)20 b Fg(history)p
-377 1019 V 20 w(set)p 468 1019 V 21 w(history)p 664 1019
-V 21 w(state)j Ff(\()p Fn(HISTORY_STATE)13 b(*state)p
-Ff(\))195 1074 y Fo(Set)i(the)h(state)e(of)h(the)g(history)g(list)h
-(according)g(to)e Fj(state)p Fo(.)75 1182 y Fi(2.3.2)30
-b(History)20 b(List)h(Managemen)n(t)137 1277 y Fo(These)11
-b(functions)h(manage)e(individual)k(en)o(tries)d(on)g(the)g(history)f
-(list,)i(or)f(set)f(parameters)g(managing)75 1332 y(the)15
-b(list)h(itself.)1650 1420 y(F)l(unction)-1749 b Fh(void)20
-b Fg(add)p 294 1420 V 20 w(history)j Ff(\()p Fn(char)14
-b(*string)p Ff(\))195 1475 y Fo(Place)i Fj(string)j Fo(at)c(the)g(end)i
-(of)d(the)i(history)f(list.)22 b(The)15 b(asso)q(ciated)h(data)f
-(\014eld)h(\(if)g(an)o(y\))e(is)195 1530 y(set)h(to)g
-Fn(NULL)p Fo(.)1650 1618 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21
-b(*)e Fg(remo)n(v)n(e)p 584 1618 V 20 w(history)k Ff(\()p
-Fn(int)14 b(which)p Ff(\))195 1673 y Fo(Remo)o(v)o(e)g(history)g(en)o
-(try)f(at)h(o\013set)f Fj(whic)o(h)h Fo(from)g(the)g(history)l(.)19
-b(The)14 b(remo)o(v)o(ed)g(elemen)o(t)g(is)195 1727 y(returned)i(so)e
-(y)o(ou)h(can)h(free)f(the)g(line,)i(data,)d(and)h(con)o(taining)h
-(structure.)1650 1816 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21
-b(*)e Fg(replace)p 580 1816 V 22 w(history)p 777 1816
-V 20 w(en)n(try)24 b Ff(\()p Fn(int)14 b(which,)g(char)283
-1870 y(*line,)g(char)g(*data)p Ff(\))195 1925 y Fo(Mak)o(e)f(the)h
-(history)f(en)o(try)g(at)g(o\013set)g Fj(whic)o(h)h Fo(ha)o(v)o(e)g
-Fj(line)k Fo(and)13 b Fj(data)p Fo(.)19 b(This)14 b(returns)g(the)f
-(old)195 1980 y(en)o(try)k(so)g(y)o(ou)g(can)g(disp)q(ose)i(of)d(the)i
-(data.)25 b(In)18 b(the)f(case)h(of)f(an)g(in)o(v)m(alid)i
-Fj(whic)o(h)p Fo(,)g(a)e Fn(NULL)195 2035 y Fo(p)q(oin)o(ter)f(is)f
-(returned.)1650 2123 y(F)l(unction)-1749 b Fh(void)20
-b Fg(clear)p 320 2123 V 21 w(history)j Ff(\(\))195 2178
-y Fo(Clear)15 b(the)h(history)f(list)h(b)o(y)f(deleting)i(all)f(the)f
-(en)o(tries.)1650 2266 y(F)l(unction)-1749 b Fh(void)20
-b Fg(sti\015e)p 320 2266 V 21 w(history)j Ff(\()p Fn(int)14
-b(max)p Ff(\))195 2321 y Fo(Sti\015e)i(the)f(history)h(list,)f(remem)o
-(b)q(ering)h(only)g(the)f(last)g Fj(max)j Fo(en)o(tries.)1650
-2409 y(F)l(unction)-1749 b Fh(int)20 b Fg(unsti\015e)p
-358 2409 V 21 w(history)i Ff(\(\))195 2463 y Fo(Stop)e(sti\015ing)i
-(the)f(history)l(.)36 b(This)21 b(returns)g(the)f(previous)i(amoun)o(t)
-e(the)g(history)h(w)o(as)195 2518 y(sti\015ed.)g(The)15
-b(v)m(alue)i(is)e(p)q(ositiv)o(e)i(if)e(the)g(history)h(w)o(as)e
-(sti\015ed,)i(negativ)o(e)f(if)h(it)f(w)o(asn't.)1650
-2606 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p 351
-2606 V 20 w(is)p 409 2606 V 21 w(sti\015ed)k Ff(\(\))195
-2661 y Fo(Returns)16 b(non-zero)f(if)h(the)f(history)g(is)h(sti\015ed,)
-g(zero)f(if)g(it)h(is)g(not.)p eop
-%%Page: 7 9
-7 8 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g
-(History)889 b(7)75 183 y Fi(2.3.3)30 b(Information)19
-b(Ab)r(out)i(the)f(History)h(List)137 279 y Fo(These)13
-b(functions)h(return)f(information)g(ab)q(out)f(the)h(en)o(tire)h
-(history)e(list)i(or)e(individual)k(list)e(en)o(tries.)1650
-371 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 b(**)e Fg(history)p
-605 371 18 3 v 21 w(list)24 b Ff(\(\))195 426 y Fo(Return)f(a)g
-Fn(NULL)f Fo(terminated)g(arra)o(y)g(of)g Fn(HIST_ENTRY)f
-Fo(whic)o(h)j(is)f(the)f(curren)o(t)h(input)195 481 y(history)l(.)j
-(Elemen)o(t)18 b(0)e(of)h(this)h(list)g(is)f(the)h(b)q(eginning)h(of)e
-(time.)26 b(If)17 b(there)g(is)h(no)f(history)l(,)195
-535 y(return)e Fn(NULL)p Fo(.)1650 627 y(F)l(unction)-1749
-b Fh(int)20 b Fg(where)p 325 627 V 20 w(history)j Ff(\(\))195
-682 y Fo(Returns)16 b(the)f(o\013set)f(of)h(the)g(curren)o(t)g(history)
-g(elemen)o(t.)1650 773 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21
-b(*)e Fg(curren)n(t)p 587 773 V 21 w(history)k Ff(\(\))195
-828 y Fo(Return)g(the)f(history)g(en)o(try)g(at)f(the)h(curren)o(t)g(p)
-q(osition,)j(as)c(determined)j(b)o(y)e Fn(where_)195
-883 y(history)14 b(\(\))p Fo(.)20 b(If)15 b(there)g(is)h(no)f(en)o(try)
-g(there,)g(return)g(a)g Fn(NULL)g Fo(p)q(oin)o(ter.)1650
-975 y(F)l(unction)-1749 b Fh(HIST_ENTRY)21 b(*)e Fg(history)p
-579 975 V 21 w(get)j Ff(\()p Fn(int)15 b(offset)p Ff(\))195
-1029 y Fo(Return)21 b(the)g(history)g(en)o(try)f(at)g(p)q(osition)i
-Fj(o\013set)p Fo(,)e(starting)g(from)g Fn(history_base)p
-Fo(.)35 b(If)195 1084 y(there)16 b(is)h(no)g(en)o(try)f(there,)g(or)g
-(if)g Fj(o\013set)h Fo(is)g(greater)e(than)h(the)h(history)f(length,)h
-(return)f(a)195 1139 y Fn(NULL)f Fo(p)q(oin)o(ter.)1650
-1231 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p 351
-1231 V 20 w(total)p 487 1231 V 22 w(b)n(ytes)j Ff(\(\))195
-1285 y Fo(Return)c(the)f(n)o(um)o(b)q(er)g(of)g(b)o(ytes)g(that)f(the)h
-(primary)h(history)f(en)o(tries)g(are)g(using.)29 b(This)195
-1340 y(function)16 b(returns)f(the)g(sum)h(of)e(the)i(lengths)f(of)g
-(all)h(the)g(lines)g(in)g(the)g(history)l(.)75 1452 y
-Fi(2.3.4)30 b(Mo)n(ving)21 b(Around)f(the)h(History)g(List)137
-1548 y Fo(These)16 b(functions)g(allo)o(w)f(the)g(curren)o(t)h(index)g
-(in)o(to)f(the)h(history)f(list)h(to)e(b)q(e)i(set)f(or)g(c)o(hanged.)
-1650 1640 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p
-351 1640 V 20 w(set)p 442 1640 V 21 w(p)r(os)h Ff(\()p
-Fn(int)15 b(pos)p Ff(\))195 1694 y Fo(Set)g(the)h(p)q(osition)g(in)g
-(the)f(history)g(list)h(to)f Fj(p)q(os)p Fo(,)g(an)g(absolute)g(index)i
-(in)o(to)e(the)g(list.)1650 1786 y(F)l(unction)-1749
-b Fh(HIST_ENTRY)21 b(*)e Fg(previous)p 615 1786 V 20
-w(history)k Ff(\(\))195 1841 y Fo(Bac)o(k)17 b(up)h(the)f(curren)o(t)g
-(history)g(o\013set)f(to)h(the)g(previous)h(history)f(en)o(try)l(,)g
-(and)g(return)g(a)195 1896 y(p)q(oin)o(ter)f(to)e(that)h(en)o(try)l(.)k
-(If)d(there)f(is)h(no)f(previous)h(en)o(try)l(,)f(return)g(a)g
-Fn(NULL)f Fo(p)q(oin)o(ter.)1650 1987 y(F)l(unction)-1749
-b Fh(HIST_ENTRY)21 b(*)e Fg(next)p 514 1987 V 21 w(history)k
-Ff(\(\))195 2042 y Fo(Mo)o(v)o(e)17 b(the)h(curren)o(t)g(history)f
-(o\013set)g(forw)o(ard)g(to)g(the)h(next)g(history)g(en)o(try)l(,)g
-(and)g(return)195 2097 y(the)d(a)g(p)q(oin)o(ter)h(to)e(that)h(en)o
-(try)l(.)20 b(If)15 b(there)g(is)h(no)f(next)g(en)o(try)l(,)g(return)g
-(a)g Fn(NULL)g Fo(p)q(oin)o(ter.)75 2208 y Fi(2.3.5)30
-b(Searc)n(hing)21 b(the)f(History)h(List)137 2304 y Fo(These)14
-b(functions)g(allo)o(w)g(searc)o(hing)g(of)e(the)i(history)f(list)h
-(for)f(en)o(tries)h(con)o(taining)g(a)f(sp)q(eci\014c)i(string.)75
-2359 y(Searc)o(hing)f(ma)o(y)g(b)q(e)g(p)q(erformed)g(b)q(oth)g(forw)o
-(ard)e(and)i(bac)o(kw)o(ard)f(from)g(the)h(curren)o(t)g(history)f(p)q
-(osition.)75 2414 y(The)j(searc)o(h)f(ma)o(y)g(b)q(e)i
-Fj(anc)o(hored)p Fo(,)e(meaning)h(that)f(the)h(string)g(m)o(ust)f(matc)
-o(h)g(at)g(the)h(b)q(eginning)i(of)d(the)75 2469 y(history)g(en)o(try)l
-(.)1650 2560 y(F)l(unction)-1749 b Fh(int)20 b Fg(history)p
-351 2560 V 20 w(searc)n(h)j Ff(\()p Fn(char)14 b(*string,)g(int)h
-(direction)p Ff(\))195 2615 y Fo(Searc)o(h)g(the)h(history)f(for)f
-Fj(string)p Fo(,)h(starting)f(at)h(the)g(curren)o(t)g(history)g
-(o\013set.)k(If)d Fj(direction)195 2670 y Fn(<)j Fo(0,)g(then)g(the)h
-(searc)o(h)e(is)i(through)e(previous)i(en)o(tries,)g(else)g(through)f
-(subsequen)o(t.)32 b(If)p eop
-%%Page: 8 10
-8 9 bop 75 -58 a Fo(8)1347 b(GNU)15 b(History)g(Library)195
-183 y Fj(string)k Fo(is)d(found,)f(then)h(the)f(curren)o(t)g(history)g
-(index)i(is)f(set)f(to)f(that)h(history)g(en)o(try)l(,)g(and)195
-238 y(the)g(v)m(alue)h(returned)f(is)g(the)g(o\013set)f(in)h(the)g
-(line)h(of)e(the)h(en)o(try)g(where)g Fj(string)j Fo(w)o(as)c(found.)
-195 293 y(Otherwise,)i(nothing)f(is)h(c)o(hanged,)f(and)h(a)e(-1)h(is)h
-(returned.)1650 396 y(F)l(unction)-1749 b Fh(int)20 b
-Fg(history)p 351 396 18 3 v 20 w(searc)n(h)p 527 396
-V 21 w(pre\014x)i Ff(\()p Fn(char)15 b(*string,)f(int)g(direction)p
-Ff(\))195 451 y Fo(Searc)o(h)i(the)f(history)g(for)g
-Fj(string)p Fo(,)g(starting)g(at)g(the)g(curren)o(t)h(history)f
-(o\013set.)k(The)d(searc)o(h)195 506 y(is)h(anc)o(hored:)23
-b(matc)o(hing)17 b(lines)h(m)o(ust)e(b)q(egin)i(with)f
-Fj(string)p Fo(.)25 b(If)17 b Fj(direction)h Fn(<)e Fo(0,)h(then)g(the)
-195 560 y(searc)o(h)f(is)g(through)f(previous)i(en)o(tries,)f(else)g
-(through)g(subsequen)o(t.)22 b(If)16 b Fj(string)k Fo(is)c(found,)195
-615 y(then)i(the)g(curren)o(t)g(history)g(index)h(is)g(set)e(to)h(that)
-f(en)o(try)l(,)h(and)g(the)g(return)g(v)m(alue)h(is)g(0.)195
-670 y(Otherwise,)d(nothing)f(is)h(c)o(hanged,)f(and)h(a)e(-1)h(is)h
-(returned.)1650 773 y(F)l(unction)-1749 b Fh(int)20 b
-Fg(history)p 351 773 V 20 w(searc)n(h)p 527 773 V 21
-w(p)r(os)h Ff(\()p Fn(char)15 b(*string,)f(int)g(direction,)g(int)283
-828 y(pos)p Ff(\))195 883 y Fo(Searc)o(h)h(for)g Fj(string)k
-Fo(in)d(the)f(history)g(list,)g(starting)g(at)f Fj(p)q(os)p
-Fo(,)h(an)g(absolute)g(index)i(in)o(to)e(the)195 937
-y(list.)21 b(If)15 b Fj(direction)h Fo(is)g(negativ)o(e,)f(the)g(searc)
-o(h)g(pro)q(ceeds)g(bac)o(kw)o(ard)g(from)f Fj(p)q(os)p
-Fo(,)h(otherwise)195 992 y(forw)o(ard.)27 b(Returns)18
-b(the)g(absolute)g(index)h(of)f(the)g(history)f(elemen)o(t)i(where)f
-Fj(string)k Fo(w)o(as)195 1047 y(found,)15 b(or)g(-1)g(otherwise.)75
-1170 y Fi(2.3.6)30 b(Managing)20 b(the)g(History)h(File)137
-1272 y Fo(The)16 b(History)g(library)h(can)e(read)h(the)g(history)g
-(from)f(and)h(write)g(it)g(to)f(a)h(\014le.)22 b(This)17
-b(section)f(do)q(cu-)75 1327 y(men)o(ts)f(the)g(functions)h(for)f
-(managing)g(a)g(history)g(\014le.)1650 1430 y(F)l(unction)-1749
-b Fh(int)20 b Fg(read)p 286 1430 V 20 w(history)i Ff(\()p
-Fn(char)15 b(*filename)p Ff(\))195 1485 y Fo(Add)h(the)f(con)o(ten)o
-(ts)f(of)h Fj(\014lename)j Fo(to)d(the)g(history)g(list,)g(a)g(line)h
-(at)f(a)f(time.)21 b(If)15 b Fj(\014lename)j Fo(is)195
-1539 y Fn(NULL)p Fo(,)c(then)i(read)f(from)f(`)p Fn(~/.history)p
-Fo('.)k(Returns)e(0)f(if)g(successful,)i(or)d(errno)h(if)h(not.)1650
-1643 y(F)l(unction)-1749 b Fh(int)20 b Fg(read)p 286
-1643 V 20 w(history)p 481 1643 V 20 w(range)i Ff(\()p
-Fn(char)15 b(*filename,)e(int)i(from,)g(int)f(to)p Ff(\))195
-1697 y Fo(Read)21 b(a)f(range)g(of)g(lines)i(from)e Fj(\014lename)p
-Fo(,)i(adding)f(them)g(to)f(the)g(history)h(list.)36
-b(Start)195 1752 y(reading)15 b(at)e(line)j Fj(from)e
-Fo(and)g(end)h(at)e Fj(to)p Fo(.)19 b(If)c Fj(from)e
-Fo(is)i(zero,)f(start)f(at)g(the)h(b)q(eginning.)22 b(If)15
-b Fj(to)195 1807 y Fo(is)i(less)g(than)f Fj(from)p Fo(,)g(then)h(read)f
-(un)o(til)i(the)e(end)h(of)f(the)h(\014le.)24 b(If)17
-b Fj(\014lename)j Fo(is)d Fn(NULL)p Fo(,)f(then)195 1862
-y(read)f(from)g(`)p Fn(~/.history)p Fo('.)i(Returns)f(0)f(if)h
-(successful,)g(or)e Fn(errno)h Fo(if)h(not.)1650 1965
-y(F)l(unction)-1749 b Fh(int)20 b Fg(write)p 304 1965
-V 22 w(history)i Ff(\()p Fn(char)15 b(*filename)p Ff(\))195
-2020 y Fo(W)l(rite)23 b(the)f(curren)o(t)g(history)h(to)f
-Fj(\014lename)p Fo(,)j(o)o(v)o(erwriting)d Fj(\014lename)k
-Fo(if)d(necessary)l(.)42 b(If)195 2074 y Fj(\014lename)20
-b Fo(is)d Fn(NULL)p Fo(,)f(then)g(write)h(the)f(history)h(list)g(to)f
-(`)p Fn(~/.history)p Fo('.)21 b(V)l(alues)d(returned)195
-2129 y(are)d(as)g(in)h Fn(read_history)d(\(\))p Fo(.)1650
-2232 y(F)l(unction)-1749 b Fh(int)20 b Fg(app)r(end)p
-360 2232 V 19 w(history)j Ff(\()p Fn(int)14 b(nelements,)g(char)h
-(*filename)p Ff(\))195 2287 y Fo(App)q(end)i(the)e(last)g
-Fj(nelemen)o(ts)j Fo(of)d(the)g(history)g(list)h(to)f
-Fj(\014lename)p Fo(.)1650 2390 y(F)l(unction)-1749 b
-Fh(int)20 b Fg(history)p 351 2390 V 20 w(truncate)p 582
-2390 V 21 w(\014le)k Ff(\()p Fn(char)14 b(*filename,)g(int)h(nlines)p
-Ff(\))195 2445 y Fo(T)l(runcate)g(the)h(history)f(\014le)h
-Fj(\014lename)p Fo(,)g(lea)o(ving)g(only)g(the)f(last)g
-Fj(nlines)k Fo(lines.)75 2568 y Fi(2.3.7)30 b(History)20
-b(Expansion)137 2670 y Fo(These)c(functions)g(implemen)o(t)g
-Fn(csh)p Fo(-lik)o(e)g(history)g(expansion.)p eop
-%%Page: 9 11
-9 10 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g
-(History)889 b(9)1650 183 y(F)l(unction)-1749 b Fh(int)20
-b Fg(history)p 351 183 18 3 v 20 w(expand)j Ff(\()p Fn(char)14
-b(*string,)g(char)h(**output)p Ff(\))195 238 y Fo(Expand)k
-Fj(string)p Fo(,)g(placing)h(the)e(result)h(in)o(to)g
-Fj(output)p Fo(,)g(a)f(p)q(oin)o(ter)h(to)f(a)g(string)h(\(see)f(Sec-)
-195 293 y(tion)d(1.1)g([History)f(In)o(teraction],)h(page)g(1\).)k
-(Returns:)195 370 y Fn(0)216 b Fo(If)16 b(no)g(expansions)h(to)q(ok)e
-(place)i(\(or,)d(if)j(the)f(only)g(c)o(hange)g(in)h(the)e(text)h(w)o
-(as)435 425 y(the)f(de-slashifying)j(of)c(the)i(history)f(expansion)h
-(c)o(haracter\);)195 502 y Fn(1)216 b Fo(if)16 b(expansions)g(did)g
-(tak)o(e)e(place;)195 580 y Fn(-1)192 b Fo(if)16 b(there)f(w)o(as)f(an)
-h(error)g(in)h(expansion;)195 657 y Fn(2)216 b Fo(if)16
-b(the)g(returned)f(line)j(should)e(b)q(e)g(displa)o(y)o(ed,)h(but)e
-(not)g(executed,)i(as)e(with)435 712 y(the)g Fn(:p)g
-Fo(mo)q(di\014er)h(\(see)f(Section)i(1.1.3)c([Mo)q(di\014ers],)i(page)g
-(2\).)195 789 y(If)g(an)g(error)f(o)q(curred)i(in)g(expansion,)f(then)h
-Fj(output)f Fo(con)o(tains)g(a)g(descriptiv)o(e)i(error)d(mes-)195
-844 y(sage.)1650 932 y(F)l(unction)-1749 b Fh(char)20
-b(*)f Fg(history)p 422 932 V 21 w(arg)p 524 932 V 19
-w(extract)24 b Ff(\()p Fn(int)14 b(first,)h(int)g(last,)f(char)283
-987 y(*string)p Ff(\))195 1042 y Fo(Extract)g(a)g(string)g(segmen)o(t)g
-(consisting)i(of)e(the)g Fj(\014rst)i Fo(through)e Fj(last)h
-Fo(argumen)o(ts)f(presen)o(t)195 1097 y(in)i Fj(string)p
-Fo(.)k(Argumen)o(ts)15 b(are)f(brok)o(en)i(up)f(as)g(in)h(Bash.)1650
-1185 y(F)l(unction)-1749 b Fh(char)20 b(*)f Fg(get)p
-324 1185 V 21 w(history)p 520 1185 V 20 w(ev)n(en)n(t)25
-b Ff(\()p Fn(char)14 b(*string,)g(int)h(*cindex,)f(int)283
-1240 y(qchar)p Ff(\))195 1295 y Fo(Returns)h(the)g(text)f(of)g(the)h
-(history)g(ev)o(en)o(t)f(b)q(eginning)j(at)d Fj(string)k
-Fn(+)d Fj(*cindex)p Fo(.)20 b Fj(*cindex)f Fo(is)195
-1350 y(mo)q(di\014ed)e(to)e(p)q(oin)o(t)h(to)f(after)g(the)h(ev)o(en)o
-(t)f(sp)q(eci\014er.)23 b(A)o(t)16 b(function)g(en)o(try)l(,)f
-Fj(cindex)21 b Fo(p)q(oin)o(ts)195 1404 y(to)16 b(the)h(index)h(in)o
-(to)e Fj(string)21 b Fo(where)c(the)g(history)f(ev)o(en)o(t)h(sp)q
-(eci\014cation)h(b)q(egins.)26 b Fj(qc)o(har)19 b Fo(is)195
-1459 y(a)h(c)o(haracter)g(that)g(is)h(allo)o(w)o(ed)f(to)g(end)h(the)g
-(ev)o(en)o(t)f(sp)q(eci\014cation)i(in)g(addition)f(to)f(the)195
-1514 y(\\normal")15 b(terminating)g(c)o(haracters.)1650
-1602 y(F)l(unction)-1749 b Fh(char)20 b(**)f Fg(history)p
-448 1602 V 21 w(tok)n(enize)25 b Ff(\()p Fn(char)14 b(*string)p
-Ff(\))195 1657 y Fo(Return)j(an)g(arra)o(y)f(of)g(tok)o(ens)g(parsed)h
-(out)g(of)f Fj(string)p Fo(,)h(m)o(uc)o(h)g(as)f(the)h(shell)h(migh)o
-(t.)25 b(The)195 1712 y(tok)o(ens)d(are)g(split)i(on)f(white)g(space)g
-(and)f(on)h(the)g(c)o(haracters)f Fn(\(\)<>;&|$)p Fo(,)h(and)f(shell)
-195 1767 y(quoting)15 b(con)o(v)o(en)o(tions)h(are)e(ob)q(ey)o(ed.)75
-1892 y Fm(2.4)33 b(History)22 b(V)-6 b(ariables)137 1987
-y Fo(This)23 b(section)f(describ)q(es)h(the)f(externally)h(visible)h(v)
-m(ariables)f(exp)q(orted)f(b)o(y)g(the)g(GNU)f(History)75
-2042 y(Library)l(.)1661 2130 y(V)l(ariable)-1749 b Fh(int)20
-b Fg(history)p 351 2130 V 20 w(base)195 2185 y Fo(The)15
-b(logical)i(o\013set)d(of)h(the)g(\014rst)g(en)o(try)g(in)h(the)f
-(history)g(list.)1661 2274 y(V)l(ariable)-1749 b Fh(int)20
-b Fg(history)p 351 2274 V 20 w(length)195 2329 y Fo(The)15
-b(n)o(um)o(b)q(er)h(of)f(en)o(tries)g(curren)o(tly)h(stored)f(in)h(the)
-f(history)g(list.)1661 2417 y(V)l(ariable)-1749 b Fh(int)20
-b Fg(max)p 283 2417 V 19 w(input)p 435 2417 V 21 w(history)195
-2472 y Fo(The)14 b(maxim)o(um)f(n)o(um)o(b)q(er)h(of)e(history)i(en)o
-(tries.)19 b(This)14 b(m)o(ust)f(b)q(e)h(c)o(hanged)g(using)g
-Fn(stifle_)195 2527 y(history)g(\(\))p Fo(.)1661 2615
-y(V)l(ariable)-1749 b Fh(char)20 b Fg(history)p 377 2615
-V 20 w(expansion)p 644 2615 V 21 w(c)n(har)195 2670 y
-Fo(The)15 b(c)o(haracter)g(that)f(starts)g(a)h(history)g(ev)o(en)o(t.)
-20 b(The)15 b(default)h(is)g(`)p Fn(!)p Fo('.)p eop
-%%Page: 10 12
-10 11 bop 75 -58 a Fo(10)1324 b(GNU)15 b(History)g(Library)1661
-183 y(V)l(ariable)-1749 b Fh(char)20 b Fg(history)p 377
-183 18 3 v 20 w(subst)p 529 183 V 20 w(c)n(har)195 238
-y Fo(The)13 b(c)o(haracter)e(that)h(in)o(v)o(ok)o(es)g(w)o(ord)g
-(substitution)h(if)g(found)g(at)e(the)i(start)e(of)h(a)g(line.)21
-b(The)195 293 y(default)16 b(is)f(`)p Fn(^)p Fo('.)1661
-388 y(V)l(ariable)-1749 b Fh(char)20 b Fg(history)p 377
-388 V 20 w(commen)n(t)p 627 388 V 19 w(c)n(har)195 443
-y Fo(During)e(tok)o(enization,)h(if)f(this)h(c)o(haracter)e(is)i(seen)f
-(as)g(the)g(\014rst)g(c)o(haracter)f(of)g(a)h(w)o(ord,)195
-498 y(then)e(it)g(and)g(all)h(subsequen)o(t)g(c)o(haracters)e(up)h(to)g
-(a)f(newline)j(are)e(ignored,)g(suppressing)195 553 y(history)f
-(expansion)h(for)f(the)g(remainder)h(of)f(the)g(line.)22
-b(This)15 b(is)h(disabled)h(b)o(y)e(default.)1661 648
-y(V)l(ariable)-1749 b Fh(char)20 b(*)f Fg(history)p 422
-648 V 21 w(no)p 504 648 V 20 w(expand)p 704 648 V 20
-w(c)n(hars)195 703 y Fo(The)j(list)h(of)f(c)o(haracters)f(whic)o(h)i
-(inhibit)h(history)e(expansion)h(if)g(found)f(immediately)195
-758 y(follo)o(wing)16 b Fj(history)p 528 758 14 2 v 16
-w(expansion)p 739 758 V 18 w(c)o(har)p Fo(.)j(The)d(default)f(is)h
-(whitespace)g(and)g(`)p Fn(=)p Fo('.)1661 853 y(V)l(ariable)-1749
-b Fh(char)20 b(*)f Fg(history)p 422 853 18 3 v 21 w(searc)n(h)p
-599 853 V 20 w(delimiter)p 843 853 V 23 w(c)n(hars)195
-908 y Fo(The)f(list)h(of)e(additional)i(c)o(haracters)e(whic)o(h)i(can)
-f(delimit)h(a)f(history)g(searc)o(h)f(string,)h(in)195
-963 y(addition)c(to)d(whitespace,)j(`)p Fn(:)p Fo(')d(and)i(`)p
-Fn(?)p Fo(')f(in)h(the)f(case)h(of)f(a)g(substring)h(searc)o(h.)19
-b(The)12 b(default)195 1018 y(is)k(empt)o(y)l(.)1661
-1113 y(V)l(ariable)-1749 b Fh(int)20 b Fg(history)p 351
-1113 V 20 w(quotes)p 533 1113 V 21 w(inhibit)p 717 1113
-V 23 w(expansion)195 1168 y Fo(If)13 b(non-zero,)f(single-quoted)i(w)o
-(ords)e(are)g(not)g(scanned)h(for)f(the)g(history)h(expansion)g(c)o
-(har-)195 1223 y(acter.)19 b(The)d(default)g(v)m(alue)g(is)g(0.)1661
-1318 y(V)l(ariable)-1749 b Fh(Function)20 b(*)g Fg(history)p
-527 1318 V 20 w(inhibit)p 710 1318 V 23 w(expansion)p
-980 1318 V 21 w(function)195 1373 y Fo(This)12 b(should)g(b)q(e)g(set)f
-(to)f(the)i(address)f(of)g(a)g(function)h(that)e(tak)o(es)h(t)o(w)o(o)f
-(argumen)o(ts:)17 b(a)11 b Fn(char)195 1428 y(*)j Fo(\()p
-Fj(string)t Fo(\))f(and)i(an)f(in)o(teger)g(index)h(in)o(to)f(that)g
-(string)g(\()p Fj(i)r Fo(\).)20 b(It)14 b(should)h(return)f(a)g
-(non-zero)195 1482 y(v)m(alue)g(if)e(the)h(history)f(expansion)h
-(starting)f(at)g Fj(string[i])i Fo(should)f(not)f(b)q(e)h(p)q
-(erformed;)g(zero)195 1537 y(if)g(the)h(expansion)f(should)h(b)q(e)g
-(done.)20 b(It)13 b(is)g(in)o(tended)i(for)d(use)h(b)o(y)g
-(applications)i(lik)o(e)f(Bash)195 1592 y(that)j(use)h(the)g(history)f
-(expansion)i(c)o(haracter)e(for)g(additional)i(purp)q(oses.)28
-b(By)18 b(default,)195 1647 y(this)e(v)m(ariable)g(is)g(set)f(to)f
-(NULL.)75 1780 y Fm(2.5)33 b(History)22 b(Programming)h(Example)137
-1878 y Fo(The)16 b(follo)o(wing)g(program)e(demonstrates)g(simple)j
-(use)e(of)g(the)g(GNU)g(History)g(Library)l(.)195 1944
-y Fn(main)23 b(\(\))195 1995 y({)243 2047 y(char)g(line[1024],)f(*t;)
-243 2099 y(int)h(len,)g(done)h(=)g(0;)243 2203 y(line[0])f(=)g(0;)243
-2307 y(using_history)f(\(\);)243 2359 y(while)h(\(!done\))290
-2411 y({)338 2462 y(printf)g(\("history$)g("\);)338 2514
-y(fflush)g(\(stdout\);)338 2566 y(t)h(=)g(fgets)f(\(line,)g(sizeof)g
-(\(line\))g(-)h(1,)f(stdin\);)338 2618 y(if)h(\(t)f(&&)h(*t\))386
-2670 y({)p eop
-%%Page: 11 13
-11 12 bop 75 -58 a Fo(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g
-(History)867 b(11)434 183 y Fn(len)23 b(=)h(strlen)f(\(t\);)434
-235 y(if)g(\(t[len)g(-)h(1])g(==)f('\\n'\))481 287 y(t[len)h(-)f(1])h
-(=)g('\\0';)386 339 y(})338 443 y(if)g(\(!t\))386 495
-y(strcpy)f(\(line,)g("quit"\);)338 598 y(if)h(\(line[0]\))386
-650 y({)434 702 y(char)f(*expansion;)434 754 y(int)g(result;)434
-858 y(result)g(=)g(history_expand)f(\(line,)h(&expansion\);)434
-910 y(if)g(\(result\))481 962 y(fprintf)g(\(stderr,)g("\045s\\n",)g
-(expansion\);)434 1065 y(if)g(\(result)g(<)h(0)g(||)f(result)g(==)h
-(2\))481 1117 y({)529 1169 y(free)f(\(expansion\);)529
-1221 y(continue;)481 1273 y(})434 1377 y(add_history)f(\(expansion\);)
-434 1429 y(strncpy)h(\(line,)g(expansion,)f(sizeof)h(\(line\))g(-)h
-(1\);)434 1480 y(free)f(\(expansion\);)386 1532 y(})338
-1636 y(if)h(\(strcmp)f(\(line,)g("quit"\))g(==)g(0\))386
-1688 y(done)g(=)h(1;)338 1740 y(else)f(if)h(\(strcmp)f(\(line,)g
-("save"\))g(==)h(0\))386 1792 y(write_history)e(\("history_file"\);)338
-1844 y(else)h(if)h(\(strcmp)f(\(line,)g("read"\))g(==)h(0\))386
-1896 y(read_history)e(\("history_file"\);)338 1947 y(else)h(if)h
-(\(strcmp)f(\(line,)g("list"\))g(==)h(0\))386 1999 y({)434
-2051 y(register)e(HIST_ENTRY)h(**the_list;)434 2103 y(register)f(int)i
-(i;)434 2207 y(the_list)e(=)i(history_list)e(\(\);)434
-2259 y(if)h(\(the_list\))481 2311 y(for)h(\(i)f(=)h(0;)g(the_list[i];)e
-(i++\))529 2363 y(printf)h(\("\045d:)g(\045s\\n",)g(i)h(+)g
-(history_base,)e(the_list[i]->line\);)386 2414 y(})338
-2466 y(else)h(if)h(\(strncmp)f(\(line,)g("delete",)g(6\))g(==)h(0\))386
-2518 y({)434 2570 y(int)f(which;)434 2622 y(if)g(\(\(sscanf)g(\(line)g
-(+)h(6,)f("\045d",)h(&which\)\))e(==)i(1\))p eop
-%%Page: 12 14
-12 13 bop 75 -58 a Fo(12)1324 b(GNU)15 b(History)g(Library)481
-183 y Fn({)529 235 y(HIST_ENTRY)23 b(*entry)g(=)g(remove_history)f
-(\(which\);)529 287 y(if)i(\(!entry\))577 339 y(fprintf)f(\(stderr,)f
-("No)i(such)f(entry)g(\045d\\n",)g(which\);)529 391 y(else)577
-443 y({)625 495 y(free)g(\(entry->line\);)625 546 y(free)g(\(entry\);)
-577 598 y(})481 650 y(})434 702 y(else)481 754 y({)529
-806 y(fprintf)g(\(stderr,)g("non-numeric)f(arg)h(given)h(to)f
-(`delete'\\n"\);)481 858 y(})386 910 y(})290 962 y(})195
-1013 y(})p eop
-%%Page: 13 15
-13 14 bop 75 -58 a Fo(App)q(endix)17 b(A:)e(Concept)g(Index)1196
-b(13)75 183 y Fk(App)r(endix)25 b(A)41 b(Concept)27 b(Index)75
-359 y Fm(A)75 417 y Fe(anc)o(hored)14 b(searc)o(h)s Fd(.)7
-b(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)16
-b Fe(7)75 517 y Fm(E)75 575 y Fe(ev)o(en)o(t)d(designators)c
-Fd(.)g(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)21
-b Fe(1)1012 359 y Fm(H)1012 417 y Fe(history)15 b(ev)o(en)o(ts)s
-Fd(.)7 b(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g
-(.)16 b Fe(1)1012 467 y(history)f(expansion)6 b Fd(.)j(.)d(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fe(1)1012 517 y(History)14
-b(Searc)o(hing)5 b Fd(.)j(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)18 b Fe(7)p eop
-%%Page: 14 16
-14 15 bop 75 -58 a Fo(14)1324 b(GNU)15 b(History)g(Library)p
-eop
-%%Page: 15 17
-15 16 bop 75 -58 a Fo(App)q(endix)17 b(B:)e(F)l(unction)h(and)g(V)l
-(ariable)g(Index)919 b(15)75 183 y Fk(App)r(endix)25
-b(B)41 b(F)-7 b(unction)26 b(and)h(V)-7 b(ariable)26
-b(Index)75 359 y Fm(A)75 417 y Fc(add)p 137 417 12 2
-v 13 w(history)6 b Fd(.)s(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)h(.)18 b Fe(6)75 467 y Fc(append)p
-197 467 V 12 w(history)8 b Fd(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
-g(.)g(.)g(.)g(.)23 b Fe(8)75 567 y Fm(C)75 625 y Fc(clear)p
-177 625 V 12 w(history)s Fd(.)t(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)16 b Fe(6)75 675 y Fc(current)p
-217 675 V 11 w(history)7 b Fd(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)22 b Fe(7)75 774 y Fm(G)75 832 y Fc(get)p
-137 832 V 13 w(history)p 290 832 V 11 w(event)8 b Fd(.)e(.)g(.)g(.)g(.)
-g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
-(.)f(.)g(.)g(.)g(.)g(.)g(.)22 b Fe(9)75 932 y Fm(H)75
-990 y Fc(history)p 217 990 V 11 w(arg)p 288 990 V 13
-w(extract)7 b Fd(.)t(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)20
-b Fe(9)75 1040 y Fc(history)p 217 1040 V 11 w(base)f
-Fd(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)19
-b Fe(9)75 1090 y Fc(history_co)o(mm)o(ent)o(_c)o(har)g
-Fd(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)23 b Fe(10)75 1139 y Fc(history)p
-217 1139 V 11 w(expand)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
-g(.)g(.)g(.)g(.)23 b Fe(9)75 1189 y Fc(history)p 217
-1189 V 11 w(expansion)p 408 1189 V 11 w(char)17 b Fd(.)6
-b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)18 b Fe(9)75 1239 y Fc(history)p 217
-1239 V 11 w(get)6 b Fd(.)f(.)h(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)h(.)18 b Fe(7)75 1289 y Fc(history)p
-217 1289 V 11 w(get)p 288 1289 V 13 w(history)p 441 1289
-V 12 w(state)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)h(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(6)75 1339 y Fc(history_in)o(hi)o
-(bit)o(_e)o(xpa)o(nsi)o(on)o(_fu)o(nc)o(tio)o(n)c Fd(.)6
-b(.)g(.)g(.)g(.)g(.)g(.)22 b Fe(10)75 1389 y Fc(history)p
-217 1389 V 11 w(is)p 268 1389 V 14 w(stifled)8 b Fd(.)s(.)f(.)f(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)21 b Fe(6)75 1438 y Fc(history)p
-217 1438 V 11 w(length)15 b Fd(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)17 b Fe(9)75 1488 y Fc(history)p 217
-1488 V 11 w(list)5 b Fd(.)g(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)
-f(.)g(.)g(.)g(.)g(.)17 b Fe(7)75 1538 y Fc(history_no)o(_e)o(xpa)o(nd)o
-(_ch)o(ars)e Fd(.)6 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)19 b Fe(10)75 1588 y Fc(history_qu)o(ot)o
-(es_)o(in)o(hib)o(it_)o(ex)o(pan)o(si)o(on)13 b Fd(.)6
-b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)16 b Fe(10)75 1638
-y Fc(history)p 217 1638 V 11 w(search)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(7)75 1687 y Fc(history_se)o(ar)o
-(ch_)o(de)o(lim)o(ite)o(r_)o(cha)o(rs)15 b Fd(.)6 b(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)h(.)f(.)g(.)18 b Fe(10)75 1737 y Fc(history)p
-217 1737 V 11 w(search)p 348 1737 V 12 w(pos)8 b Fd(.)d(.)i(.)f(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)21 b Fe(8)75 1787 y Fc(history)p
-217 1787 V 11 w(search)p 348 1787 V 12 w(prefix)5 b Fd(.)t(.)h(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
-g(.)g(.)g(.)17 b Fe(8)75 1837 y Fc(history)p 217 1837
-V 11 w(set)p 288 1837 V 13 w(history)p 441 1837 V 12
-w(state)9 b Fd(.)d(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
-(.)f(.)g(.)g(.)g(.)g(.)23 b Fe(6)75 1887 y Fc(history)p
-217 1887 V 11 w(set)p 288 1887 V 13 w(pos)t Fd(.)5 b(.)h(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)16 b Fe(7)1012 359
-y Fc(history_sub)o(st)o(_ch)o(ar)d Fd(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
-17 b Fe(10)1012 409 y Fc(history)p 1154 409 V 12 w(tokenize)8
-b Fd(.)s(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21
-b Fe(9)1012 459 y Fc(history)p 1154 459 V 12 w(total)p
-1266 459 V 12 w(bytes)7 b Fd(.)t(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)20
-b Fe(7)1012 509 y Fc(history)p 1154 509 V 12 w(truncate)p
-1326 509 V 11 w(file)5 b Fd(.)t(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
-(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)18
-b Fe(8)1012 612 y Fm(M)1012 670 y Fc(max)p 1074 670 V
-13 w(input)p 1187 670 V 13 w(history)13 b Fd(.)6 b(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)h(.)f(.)g(.)g(.)16 b Fe(9)1012 773 y Fm(N)1012 831
-y Fc(next)p 1094 831 V 13 w(history)5 b Fd(.)s(.)h(.)g(.)g(.)g(.)g(.)g
-(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)
-f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)18 b Fe(7)1012
-934 y Fm(P)1012 992 y Fc(previous)p 1174 992 V 11 w(history)8
-b Fd(.)t(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21
-b Fe(7)1012 1096 y Fm(R)1012 1154 y Fc(read)p 1094 1154
-V 13 w(history)5 b Fd(.)s(.)h(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)18 b Fe(8)1012 1204 y Fc(read)p 1094
-1204 V 13 w(history)p 1247 1204 V 11 w(range)8 b Fd(.)d(.)h(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)h(.)f(.)21 b Fe(8)1012 1253 y Fc(remove)p
-1134 1253 V 12 w(history)8 b Fd(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)24 b Fe(6)1012 1303 y Fc(replace)p 1154
-1303 V 12 w(history)p 1306 1303 V 11 w(entry)5 b Fd(.)t(.)h(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)18 b Fe(6)1012 1406 y Fm(S)1012 1464 y Fc(stifle)p
-1134 1464 V 12 w(history)8 b Fd(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)24 b Fe(6)1012 1568 y Fm(U)1012 1626
-y Fc(unstifle)p 1174 1626 V 11 w(history)8 b Fd(.)t(.)e(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)h(.)f(.)g(.)g(.)g(.)21 b Fe(6)1012 1676 y Fc(using)p
-1114 1676 V 13 w(history)s Fd(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)g(.)g(.)g(.)g(.)g(.)17 b Fe(6)1012 1779 y Fm(W)1012
-1837 y Fc(where)p 1114 1837 V 13 w(history)s Fd(.)s(.)6
-b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f
-(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)17
-b Fe(7)1012 1887 y Fc(write)p 1114 1887 V 13 w(history)s
-Fd(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
-g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)17
-b Fe(8)p eop
-%%Page: 16 18
-16 17 bop 75 -58 a Fo(16)1324 b(GNU)15 b(History)g(Library)p
-eop
-%%Page: -1 19
--1 18 bop 1862 -58 a Fo(i)75 183 y Fk(T)-7 b(able)27
-b(of)f(Con)n(ten)n(ts)75 354 y Fm(1)67 b(Using)22 b(History)h(In)n
-(teractiv)n(ely)9 b Fb(.)k(.)d(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)h
-(.)f(.)g(.)g(.)h(.)31 b Fm(1)224 423 y Fo(1.1)45 b(History)15
-b(Expansion)5 b Fa(.)j(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f
-(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)19 b Fo(1)374 478 y(1.1.1)44
-b(Ev)o(en)o(t)14 b(Designators)e Fa(.)7 b(.)h(.)f(.)h(.)f(.)h(.)f(.)h
-(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)26 b Fo(1)374 532 y(1.1.2)44 b(W)l(ord)15
-b(Designators)5 b Fa(.)h(.)i(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h
-(.)19 b Fo(2)374 587 y(1.1.3)44 b(Mo)q(di\014ers)t Fa(.)8
-b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f
-(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)19 b Fo(2)75 708 y Fm(2)67 b(Programming)23
-b(with)g(GNU)f(History)16 b Fb(.)10 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f
-(.)g(.)38 b Fm(5)224 777 y Fo(2.1)45 b(In)o(tro)q(duction)16
-b(to)f(History)10 b Fa(.)d(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f
-(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)24 b Fo(5)224 832 y(2.2)45 b(History)15
-b(Storage)c Fa(.)d(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f
-(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)26 b Fo(5)224 886
-y(2.3)45 b(History)15 b(F)l(unctions)d Fa(.)c(.)f(.)h(.)f(.)h(.)f(.)h
-(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)26
-b Fo(6)374 941 y(2.3.1)44 b(Initializing)18 b(History)d(and)h(State)e
-(Managemen)o(t)g Fa(.)7 b(.)h(.)g(.)f(.)h(.)f(.)29 b
-Fo(6)374 996 y(2.3.2)44 b(History)15 b(List)h(Managemen)o(t)d
-Fa(.)7 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)
-h(.)f(.)h(.)f(.)h(.)f(.)29 b Fo(6)374 1051 y(2.3.3)44
-b(Information)15 b(Ab)q(out)g(the)h(History)f(List)c
-Fa(.)d(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)26
-b Fo(7)374 1106 y(2.3.4)44 b(Mo)o(ving)15 b(Around)g(the)g(History)g
-(List)c Fa(.)d(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f
-(.)h(.)25 b Fo(7)374 1160 y(2.3.5)44 b(Searc)o(hing)16
-b(the)f(History)g(List)7 b Fa(.)h(.)g(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f
-(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)22
-b Fo(7)374 1215 y(2.3.6)44 b(Managing)15 b(the)g(History)g(File)6
-b Fa(.)i(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)f(.)h(.)20 b Fo(8)374 1270 y(2.3.7)44
-b(History)15 b(Expansion)9 b Fa(.)f(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h
-(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)
-h(.)f(.)24 b Fo(8)224 1325 y(2.4)45 b(History)15 b(V)l(ariables)6
-b Fa(.)j(.)e(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)
-f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h
-(.)f(.)h(.)f(.)h(.)f(.)21 b Fo(9)224 1380 y(2.5)45 b(History)15
-b(Programming)f(Example)7 b Fa(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h
-(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)22
-b Fo(10)75 1501 y Fm(App)r(endix)i(A)67 b(Concept)22
-b(Index)17 b Fb(.)10 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g
-(.)h(.)f(.)g(.)38 b Fm(13)75 1636 y(App)r(endix)24 b(B)67
-b(F)-6 b(unction)25 b(and)e(V)-6 b(ariable)24 b(Index)16
-b Fb(.)10 b(.)g(.)g(.)38 b Fm(15)p eop
-%%Page: -2 20
--2 19 bop 75 -58 a Fo(ii)1346 b(GNU)15 b(History)g(Library)p
-eop
-%%Trailer
-end
-userdict /end-hook known{end-hook}if
-%%EOF
diff --git a/readline/doc/hstech.texinfo b/readline/doc/hstech.texinfo
index 5410090..12fff2c 100644
--- a/readline/doc/hstech.texinfo
+++ b/readline/doc/hstech.texinfo
@@ -66,6 +66,13 @@ If the programmer desires, he can use the Readline library, which
includes some history manipulation by default, and has the added
advantage of command line editing.
+Before declaring any functions using any functionality the History
+library provides in other code, an application writer should include
+the file @code{} in any file that uses the
+History library's features. It supplies extern declarations for all
+of the library's public functions and variables, and declares all of
+the public data structures.
+
@node History Storage
@section History Storage
@@ -334,7 +341,7 @@ if expansions did take place;
@item -1
if there was an error in expansion;
@item 2
-if the returned line should only be displayed, but not executed,
+if the returned line should be displayed, but not executed,
as with the @code{:p} modifier (@pxref{Modifiers}).
@end table
diff --git a/readline/doc/hsuser.texinfo b/readline/doc/hsuser.texinfo
index 7c4582d..5f75f5d 100644
--- a/readline/doc/hsuser.texinfo
+++ b/readline/doc/hsuser.texinfo
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
-Copyright (C) 1988, 1991, 1996 Free Software Foundation, Inc.
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
@@ -26,11 +26,16 @@ into another language, under the above conditions for modified versions.
@node Using History Interactively
@chapter Using History Interactively
+@ifclear BashFeatures
+@defcodeindex bt
+@end ifclear
+
@ifset BashFeatures
-This chapter describes how to use the GNU History Library interactively,
-from a user's standpoint. It should be considered a user's guide. For
-information on using the GNU History Library in other programs,
-see the GNU Readline Library Manual.
+This chapter describes how to use the @sc{gnu} History Library
+interactively, from a user's standpoint.
+It should be considered a user's guide.
+For information on using the @sc{gnu} History Library in other programs,
+see the @sc{gnu} Readline Library Manual.
@end ifset
@ifclear BashFeatures
This chapter describes how to use the GNU History Library interactively,
@@ -63,20 +68,25 @@ information on using the GNU History Library in your own programs,
When the @samp{-o history} option to the @code{set} builtin
is enabled (@pxref{The Set Builtin}),
the shell provides access to the @var{command history},
-the list of commands previously typed. The text of the last
-@code{HISTSIZE}
-commands (default 500) is saved in a history list. The shell
-stores each command in the history list prior to parameter and
-variable expansion
+the list of commands previously typed.
+The value of the @code{HISTSIZE} shell variable is used as the
+number of commands to save in a history list.
+The text of the last @code{$HISTSIZE}
+commands (default 500) is saved.
+The shell stores each command in the history list prior to
+parameter and variable expansion
but after history expansion is performed, subject to the
values of the shell variables
@code{HISTIGNORE} and @code{HISTCONTROL}.
+
When the shell starts up, the history is initialized from the
file named by the @code{HISTFILE} variable (default @file{~/.bash_history}).
-@code{HISTFILE} is truncated, if necessary, to contain no more than
-the number of lines specified by the value of the @code{HISTFILESIZE}
-variable. When an interactive shell exits, the last
-@code{HISTSIZE} lines are copied from the history list to @code{HISTFILE}.
+The file named by the value of @code{HISTFILE} is truncated, if
+necessary, to contain no more than the number of lines specified by
+the value of the @code{HISTFILESIZE} variable.
+When an interactive shell exits, the last
+@code{$HISTSIZE} lines are copied from the history list to the file
+named by @code{$HISTFILE}.
If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
the lines are appended to the history file,
otherwise the history file is overwritten.
@@ -88,11 +98,11 @@ lines. If @code{HISTFILESIZE} is not set, no truncation is performed.
The builtin command @code{fc} may be used to list or edit and re-execute
a portion of the history list.
-The @code{history} builtin can be used to display or modify the history
+The @code{history} builtin may be used to display or modify the history
list and manipulate the history file.
-When using the command-line editing, search commands
+When using command-line editing, search commands
are available in each editing mode that provide access to the
-history list.
+history list (@pxref{Commands For History}).
The shell allows control over which commands are saved on the history
list. The @code{HISTCONTROL} and @code{HISTIGNORE}
@@ -105,19 +115,20 @@ semicolons where necessary to preserve syntactic correctness.
The @code{lithist}
shell option causes the shell to save the command with embedded newlines
instead of semicolons.
+The @code{shopt} builtin is used to set these options.
@xref{Bash Builtins}, for a description of @code{shopt}.
@node Bash History Builtins
@section Bash History Builtins
@cindex history builtins
-Bash provides two builtin commands that allow you to manipulate the
+Bash provides two builtin commands which manipulate the
history list and history file.
@table @code
@item fc
-@comment btindex fc
+@btindex fc
@example
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
@@ -149,25 +160,29 @@ that typing @samp{r cc} runs the last command beginning with @code{cc}
and typing @samp{r} re-executes the last command (@pxref{Aliases}).
@item history
-@comment btindex history
+@btindex history
@example
-history [-c] [@var{n}]
+history [@var{n}]
+history -c
+history -d @var{offset}
history [-anrw] [@var{filename}]
history -ps @var{arg}
@end example
-Display the history list with line numbers. Lines prefixed with
-with a @samp{*} have been modified. An argument of @var{n} says
-to list only the last @var{n} lines. Options, if supplied, have
-the following meanings:
+With no options, display the history list with line numbers.
+Lines prefixed with with a @samp{*} have been modified.
+An argument of @var{n} lists only the last @var{n} lines.
+Options, if supplied, have the following meanings:
@table @code
-@item -w
-Write out the current history to the history file.
+@item -c
+Clear the history list. This may be combined
+with the other options to replace the history list completely.
-@item -r
-Read the current history file and append its contents to
-the history list.
+@item -d @var{offset}
+Delete the history entry at position @var{offset}.
+@var{offset} should be specified as it appears when the history is
+displayed.
@item -a
Append the new
@@ -179,20 +194,24 @@ Append the history lines not already read from the history file
to the current history list. These are lines appended to the history
file since the beginning of the current Bash session.
-@item -c
-Clear the history list. This may be combined
-with the other options to replace the history list completely.
+@item -r
+Read the current history file and append its contents to
+the history list.
-@item -s
-The @var{arg}s are added to the end of
-the history list as a single entry.
+@item -w
+Write out the current history to the history file.
@item -p
Perform history substitution on the @var{arg}s and display the result
on the standard output, without storing the results in the history list.
+
+@item -s
+The @var{arg}s are added to the end of
+the history list as a single entry.
+
@end table
-When the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} option is
+When any of the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} options is
used, if @var{filename}
is given, then it is used as the history file. If not, then
the value of the @code{HISTFILE} variable is used.
@@ -309,6 +328,26 @@ may be omitted if the word designator begins with a @samp{^}, @samp{$},
of the line, with the first word being denoted by 0 (zero). Words are
inserted into the current line separated by single spaces.
+@need 0.75
+For example,
+
+@table @code
+@item !!
+designates the preceding command. When you type this, the preceding
+command is repeated in toto.
+
+@item !!:$
+designates the last argument of the preceding command. This may be
+shortened to @code{!$}.
+
+@item !fi:2
+designates the second argument of the most recent command starting with
+the letters @code{fi}.
+@end table
+
+@need 0.75
+Here are the word designators:
+
@table @code
@item 0 (zero)
diff --git a/readline/doc/inc-hist.texinfo b/readline/doc/inc-hist.texinfo
index 06774b7..37ed15f 100644
--- a/readline/doc/inc-hist.texinfo
+++ b/readline/doc/inc-hist.texinfo
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
-Copyright (C) 1988, 1991, 1996 Free Software Foundation, Inc.
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
@@ -26,16 +26,21 @@ into another language, under the above conditions for modified versions.
@node Using History Interactively
@chapter Using History Interactively
+@c @ifclear BashFeatures
+@c @defcodeindex bt
+@c @end ifclear
+
@ifset BashFeatures
-This chapter describes how to use the GNU History Library interactively,
-from a user's standpoint. It should be considered a user's guide. For
-information on using the GNU History Library in other programs,
-see the GNU Readline Library Manual.
+This chapter describes how to use the @sc{gnu} History Library
+interactively, from a user's standpoint.
+It should be considered a user's guide.
+For information on using the @sc{gnu} History Library in other programs,
+see the @sc{gnu} Readline Library Manual.
@end ifset
@ifclear BashFeatures
This chapter describes how to use the GNU History Library interactively,
-from a user's standpoint. It should be considered a user's guide.
-@c For
+from a user's standpoint. It should be considered a user's guide.
+@c For
@c information on using the GNU History Library in your own programs,
@c @pxref{Programming with GNU History}.
@end ifclear
@@ -64,20 +69,25 @@ from a user's standpoint. It should be considered a user's guide.
When the @samp{-o history} option to the @code{set} builtin
is enabled (@pxref{The Set Builtin}),
the shell provides access to the @var{command history},
-the list of commands previously typed. The text of the last
-@code{HISTSIZE}
-commands (default 500) is saved in a history list. The shell
-stores each command in the history list prior to parameter and
-variable expansion
+the list of commands previously typed.
+The value of the @code{HISTSIZE} shell variable is used as the
+number of commands to save in a history list.
+The text of the last @code{$HISTSIZE}
+commands (default 500) is saved.
+The shell stores each command in the history list prior to
+parameter and variable expansion
but after history expansion is performed, subject to the
values of the shell variables
@code{HISTIGNORE} and @code{HISTCONTROL}.
+
When the shell starts up, the history is initialized from the
file named by the @code{HISTFILE} variable (default @file{~/.bash_history}).
-@code{HISTFILE} is truncated, if necessary, to contain no more than
-the number of lines specified by the value of the @code{HISTFILESIZE}
-variable. When an interactive shell exits, the last
-@code{HISTSIZE} lines are copied from the history list to @code{HISTFILE}.
+The file named by the value of @code{HISTFILE} is truncated, if
+necessary, to contain no more than the number of lines specified by
+the value of the @code{HISTFILESIZE} variable.
+When an interactive shell exits, the last
+@code{$HISTSIZE} lines are copied from the history list to the file
+named by @code{$HISTFILE}.
If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
the lines are appended to the history file,
otherwise the history file is overwritten.
@@ -89,11 +99,11 @@ lines. If @code{HISTFILESIZE} is not set, no truncation is performed.
The builtin command @code{fc} may be used to list or edit and re-execute
a portion of the history list.
-The @code{history} builtin can be used to display or modify the history
+The @code{history} builtin may be used to display or modify the history
list and manipulate the history file.
-When using the command-line editing, search commands
+When using command-line editing, search commands
are available in each editing mode that provide access to the
-history list.
+history list (@pxref{Commands For History}).
The shell allows control over which commands are saved on the history
list. The @code{HISTCONTROL} and @code{HISTIGNORE}
@@ -106,19 +116,20 @@ semicolons where necessary to preserve syntactic correctness.
The @code{lithist}
shell option causes the shell to save the command with embedded newlines
instead of semicolons.
+The @code{shopt} builtin is used to set these options.
@xref{Bash Builtins}, for a description of @code{shopt}.
@node Bash History Builtins
@section Bash History Builtins
@cindex history builtins
-Bash provides two builtin commands that allow you to manipulate the
+Bash provides two builtin commands which manipulate the
history list and history file.
@table @code
@item fc
-@c btindex fc
+@btindex fc
@example
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
@@ -150,25 +161,29 @@ that typing @samp{r cc} runs the last command beginning with @code{cc}
and typing @samp{r} re-executes the last command (@pxref{Aliases}).
@item history
-@c btindex history
+@btindex history
@example
-history [-c] [@var{n}]
+history [@var{n}]
+history -c
+history -d @var{offset}
history [-anrw] [@var{filename}]
history -ps @var{arg}
@end example
-Display the history list with line numbers. Lines prefixed with
-with a @samp{*} have been modified. An argument of @var{n} says
-to list only the last @var{n} lines. Options, if supplied, have
-the following meanings:
+With no options, display the history list with line numbers.
+Lines prefixed with with a @samp{*} have been modified.
+An argument of @var{n} lists only the last @var{n} lines.
+Options, if supplied, have the following meanings:
@table @code
-@item -w
-Write out the current history to the history file.
+@item -c
+Clear the history list. This may be combined
+with the other options to replace the history list completely.
-@item -r
-Read the current history file and append its contents to
-the history list.
+@item -d @var{offset}
+Delete the history entry at position @var{offset}.
+@var{offset} should be specified as it appears when the history is
+displayed.
@item -a
Append the new
@@ -180,20 +195,24 @@ Append the history lines not already read from the history file
to the current history list. These are lines appended to the history
file since the beginning of the current Bash session.
-@item -c
-Clear the history list. This may be combined
-with the other options to replace the history list completely.
+@item -r
+Read the current history file and append its contents to
+the history list.
-@item -s
-The @var{arg}s are added to the end of
-the history list as a single entry.
+@item -w
+Write out the current history to the history file.
@item -p
Perform history substitution on the @var{arg}s and display the result
on the standard output, without storing the results in the history list.
+
+@item -s
+The @var{arg}s are added to the end of
+the history list as a single entry.
+
@end table
-When the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} option is
+When any of the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} options is
used, if @var{filename}
is given, then it is used as the history file. If not, then
the value of the @code{HISTFILE} variable is used.
@@ -310,6 +329,26 @@ may be omitted if the word designator begins with a @samp{^}, @samp{$},
of the line, with the first word being denoted by 0 (zero). Words are
inserted into the current line separated by single spaces.
+@need 0.75
+For example,
+
+@table @code
+@item !!
+designates the preceding command. When you type this, the preceding
+command is repeated in toto.
+
+@item !!:$
+designates the last argument of the preceding command. This may be
+shortened to @code{!$}.
+
+@item !fi:2
+designates the second argument of the most recent command starting with
+the letters @code{fi}.
+@end table
+
+@need 0.75
+Here are the word designators:
+
@table @code
@item 0 (zero)
diff --git a/readline/doc/manvers.texinfo b/readline/doc/manvers.texinfo
index 63924e3..3122b6c 100644
--- a/readline/doc/manvers.texinfo
+++ b/readline/doc/manvers.texinfo
@@ -1,6 +1,6 @@
-@set EDITION 4.0
-@set VERSION 4.0
-@set UPDATED 31 December 1998
-@set UPDATE-MONTH December 1998
+@set EDITION 4.1
+@set VERSION 4.1
+@set UPDATED 2000 January 19
+@set UPDATE-MONTH January 2000
-@set LASTCHANGE Thu Dec 31 10:17:05 EST 1998
+@set LASTCHANGE Wed Jan 19 12:16:30 EST 2000
diff --git a/readline/doc/readline.3 b/readline/doc/readline.3
index 6b36f2f..c1ed9cf 100644
--- a/readline/doc/readline.3
+++ b/readline/doc/readline.3
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Thu Dec 31 10:16:30 EST 1998
+.\" Last Change: Tue Jun 1 13:28:03 EDT 1999
.\"
-.TH READLINE 3 "1998 Dec 31" GNU
+.TH READLINE 3 "1999 Jun 1" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -148,6 +148,7 @@ processing key bindings:
.IR SPACE ,
and
.IR TAB .
+.PP
In addition to command names, readline allows keys to be bound
to a string that is inserted when the key is pressed (a \fImacro\fP).
.PP
@@ -564,7 +565,7 @@ Move forward to the end of the next word. Words are composed of
alphanumeric characters (letters and digits).
.TP
.B backward\-word (M\-b)
-Move back to the start of this, or the previous, word. Words are
+Move back to the start of the current or previous word. Words are
composed of alphanumeric characters (letters and digits).
.TP
.B clear\-screen (C\-l)
@@ -1172,9 +1173,9 @@ VI Command Mode functions
Individual \fBreadline\fP initialization file
.PD
.SH AUTHORS
-Brian Fox, Free Software Foundation (primary author)
+Brian Fox, Free Software Foundation
.br
-bfox@ai.MIT.Edu
+bfox@gnu.org
.PP
Chet Ramey, Case Western Reserve University
.br
diff --git a/readline/doc/readline.dvi b/readline/doc/readline.dvi
deleted file mode 100644
index 5d859d8..0000000
Binary files a/readline/doc/readline.dvi and /dev/null differ
diff --git a/readline/doc/readline.html b/readline/doc/readline.html
deleted file mode 100644
index d8a2eda..0000000
--- a/readline/doc/readline.html
+++ /dev/null
@@ -1,4327 +0,0 @@
-
-
-
-
-GNU Readline Library
-
-
-GNU Readline Library
-Edition 4.1, for Readline Library
Version 4.1.
-January 2000
-Brian Fox, Free Software Foundation
-Chet Ramey, Case Western Reserve University
-
-
-
Table of Contents
-
-
-
-
-This document describes the GNU Readline Library, a utility which aids
-in the consistency of user interface across discrete programs that need
-to provide a command line interface.
-
-
-
-Published by the Free Software Foundation
-59 Temple Place, Suite 330,
-Boston, MA 02111 USA
-
-
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-
-
-
-Copyright (C) 1988-1999 Free Software Foundation, Inc.
-
-
-
-
-
-
-
-
-This chapter describes the basic features of the GNU
-command line editing interface.
-
-
-
-
-
-
-
-
-
-
-The following paragraphs describe the notation used to represent
-keystrokes.
-
-
-
-The text C-k is read as `Control-K' and describes the character
-produced when the k key is pressed while the Control key
-is depressed.
-
-
-
-The text M-k is read as `Meta-K' and describes the character
-produced when the Meta key (if you have one) is depressed, and the k
-key is pressed.
-The Meta key is labeled ALT on many keyboards.
-On keyboards with two keys labeled ALT (usually to either side of
-the space bar), the ALT on the left side is generally set to
-work as a Meta key.
-The ALT key on the right may also be configured to work as a
-Meta key or may be configured as some other modifier, such as a
-Compose key for typing accented characters.
-
-
-
-If you do not have a Meta or ALT key, or another key working as
-a Meta key, the identical keystroke can be generated by typing ESC
-first, and then typing k.
-Either process is known as metafying the k key.
-
-
-
-The text M-C-k is read as `Meta-Control-k' and describes the
-character produced by metafying C-k.
-
-
-
-In addition, several keys have their own names. Specifically,
-DEL, ESC, LFD, SPC, RET, and TAB all
-stand for themselves when seen in this text, or in an init file
-(see section Readline Init File).
-If your keyboard lacks a LFD key, typing C-j will
-produce the desired character.
-The RET key may be labeled Return or Enter on
-some keyboards.
-
-
-
-
-
-
-
-
-
-
-Often during an interactive session you type in a long line of text,
-only to notice that the first word on the line is misspelled. The
-Readline library gives you a set of commands for manipulating the text
-as you type it in, allowing you to just fix your typo, and not forcing
-you to retype the majority of the line. Using these editing commands,
-you move the cursor to the place that needs correction, and delete or
-insert the text of the corrections. Then, when you are satisfied with
-the line, you simply press RETURN. You do not have to be at the
-end of the line to press RETURN; the entire line is accepted
-regardless of the location of the cursor within the line.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-In order to enter characters into the line, simply type them. The typed
-character appears where the cursor was, and then the cursor moves one
-space to the right. If you mistype a character, you can use your
-erase character to back up and delete the mistyped character.
-
-
-
-Sometimes you may mistype a character, and
-not notice the error until you have typed several other characters. In
-that case, you can type C-b to move the cursor to the left, and then
-correct your mistake. Afterwards, you can move the cursor to the right
-with C-f.
-
-
-
-When you add text in the middle of a line, you will notice that characters
-to the right of the cursor are `pushed over' to make room for the text
-that you have inserted. Likewise, when you delete text behind the cursor,
-characters to the right of the cursor are `pulled back' to fill in the
-blank space created by the removal of the text. A list of the bare
-essentials for editing the text of an input line follows.
-
-
-
-
-- C-b
-
-
-Move back one character.
-
- C-f
-
-
-Move forward one character.
-
- DEL or Backspace
-
-
-Delete the character to the left of the cursor.
-
- C-d
-
-
-Delete the character underneath the cursor.
-
- Printing characters
-
-
-Insert the character into the line at the cursor.
-
- C-_ or C-x C-u
-
-
-Undo the last editing command. You can undo all the way back to an
-empty line.
-
-
-
-(Depending on your configuration, the Backspace key be set to
-delete the character to the left of the cursor and the DEL key set
-to delete the character underneath the cursor, like C-d, rather
-than the character to the left of the cursor.)
-
-
-
-
-
-
-
-The above table describes the most basic keystrokes that you need
-in order to do editing of the input line. For your convenience, many
-other commands have been added in addition to C-b, C-f,
-C-d, and DEL. Here are some commands for moving more rapidly
-about the line.
-
-
-
-
-- C-a
-
-
-Move to the start of the line.
-
- C-e
-
-
-Move to the end of the line.
-
- M-f
-
-
-Move forward a word, where a word is composed of letters and digits.
-
- M-b
-
-
-Move backward a word.
-
- C-l
-
-
-Clear the screen, reprinting the current line at the top.
-
-
-
-Notice how C-f moves forward a character, while M-f moves
-forward a word. It is a loose convention that control keystrokes
-operate on characters while meta keystrokes operate on words.
-
-
-
-
-
-
-
-
-
-
-
-
-Killing text means to delete the text from the line, but to save
-it away for later use, usually by yanking (re-inserting)
-it back into the line.
-(`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
-
-
-
-If the description for a command says that it `kills' text, then you can
-be sure that you can get the text back in a different (or the same)
-place later.
-
-
-
-When you use a kill command, the text is saved in a kill-ring.
-Any number of consecutive kills save all of the killed text together, so
-that when you yank it back, you get it all. The kill
-ring is not line specific; the text that you killed on a previously
-typed line is available to be yanked back later, when you are typing
-another line.
-
-
-
-
-Here is the list of commands for killing text.
-
-
-
-
-- C-k
-
-
-Kill the text from the current cursor position to the end of the line.
-
-
- M-d
-
-
-Kill from the cursor to the end of the current word, or, if between
-words, to the end of the next word.
-Word boundaries are the same as those used by M-f.
-
-
- M-DEL
-
-
-Kill from the cursor the start of the previous word, or, if between
-words, to the start of the previous word.
-Word boundaries are the same as those used by M-b.
-
-
- C-w
-
-
-Kill from the cursor to the previous whitespace. This is different than
-M-DEL because the word boundaries differ.
-
-
-
-
-Here is how to yank the text back into the line. Yanking
-means to copy the most-recently-killed text from the kill buffer.
-
-
-
-
-- C-y
-
-
-Yank the most recently killed text back into the buffer at the cursor.
-
-
- M-y
-
-
-Rotate the kill-ring, and yank the new top. You can only do this if
-the prior command is C-y or M-y.
-
-
-
-
-
-
-
-You can pass numeric arguments to Readline commands. Sometimes the
-argument acts as a repeat count, other times it is the sign of the
-argument that is significant. If you pass a negative argument to a
-command which normally acts in a forward direction, that command will
-act in a backward direction. For example, to kill text back to the
-start of the line, you might type `M-- C-k'.
-
-
-
-The general way to pass numeric arguments to a command is to type meta
-digits before the command. If the first `digit' typed is a minus
-sign (`-'), then the sign of the argument will be negative. Once
-you have typed one meta digit to get the argument started, you can type
-the remainder of the digits, and then the command. For example, to give
-the C-d command an argument of 10, you could type `M-1 0 C-d'.
-
-
-
-
-
-
-
-Readline provides commands for searching through the command history
-for lines containing a specified string.
-There are two search modes: incremental and non-incremental.
-
-
-
-Incremental searches begin before the user has finished typing the
-search string.
-As each character of the search string is typed, Readline displays
-the next entry from the history matching the string typed so far.
-An incremental search requires only as many characters as needed to
-find the desired history entry.
-To search backward in the history for a particular string, type
-C-r. Typing C-s searches forward through the history.
-The characters present in the value of the isearch-terminators
variable
-are used to terminate an incremental search.
-If that variable has not been assigned a value, the ESC and
-C-J characters will terminate an incremental search.
-C-g will abort an incremental search and restore the original line.
-When the search is terminated, the history entry containing the
-search string becomes the current line.
-
-
-
-To find other matching entries in the history list, type C-r or
-C-s as appropriate.
-This will search backward or forward in the history for the next
-entry matching the search string typed so far.
-Any other key sequence bound to a Readline command will terminate
-the search and execute that command.
-For instance, a RET will terminate the search and accept
-the line, thereby executing the command from the history list.
-
-
-
-Non-incremental searches read the entire search string before starting
-to search for matching history lines. The search string may be
-typed by the user or be part of the contents of the current line.
-
-
-
-
-
-
-
-
-
-
-Although the Readline library comes with a set of Emacs-like
-keybindings installed by default, it is possible to use a different set
-of keybindings.
-Any user can customize programs that use Readline by putting
-commands in an inputrc file, conventionally in his home directory.
-The name of this
-file is taken from the value of the environment variable INPUTRC
. If
-that variable is unset, the default is `~/.inputrc'.
-
-
-
-When a program which uses the Readline library starts up, the
-init file is read, and the key bindings are set.
-
-
-
-In addition, the C-x C-r
command re-reads this init file, thus
-incorporating any changes that you might have made to it.
-
-
-
-
-
-
-
-
-
-
-There are only a few basic constructs allowed in the
-Readline init file. Blank lines are ignored.
-Lines beginning with a `#' are comments.
-Lines beginning with a `$' indicate conditional
-constructs (see section Conditional Init Constructs). Other lines
-denote variable settings and key bindings.
-
-
-
-
-- Variable Settings
-
-
-You can modify the run-time behavior of Readline by
-altering the values of variables in Readline
-using the
set
command within the init file. Here is how to
-change from the default Emacs-like key binding to use
-vi
line editing commands:
-
-
-
-set editing-mode vi
-
-
-A great deal of run-time behavior is changeable with the following
-variables.
-
-
-
-bell-style
--
-
-Controls what happens when Readline wants to ring the terminal bell.
-If set to `none', Readline never rings the bell. If set to
-`visible', Readline uses a visible bell if one is available.
-If set to `audible' (the default), Readline attempts to ring
-the terminal's bell.
-
-
comment-begin
--
-
-The string to insert at the beginning of the line when the
-
insert-comment
command is executed. The default value
-is "#"
.
-
- completion-ignore-case
--
-If set to `on', Readline performs filename matching and completion
-in a case-insensitive fashion.
-The default value is `off'.
-
-
completion-query-items
--
-
-The number of possible completions that determines when the user is
-asked whether he wants to see the list of possibilities. If the
-number of possible completions is greater than this value,
-Readline will ask the user whether or not he wishes to view
-them; otherwise, they are simply listed. The default limit is
-
100
.
-
- convert-meta
--
-
-If set to `on', Readline will convert characters with the
-eighth bit set to an ASCII key sequence by stripping the eighth
-bit and prefixing an ESC character, converting them to a
-meta-prefixed key sequence. The default value is `on'.
-
-
disable-completion
--
-
-If set to `On', Readline will inhibit word completion.
-Completion characters will be inserted into the line as if they had
-been mapped to
self-insert
. The default is `off'.
-
- editing-mode
--
-
-The
editing-mode
variable controls which default set of
-key bindings is used. By default, Readline starts up in Emacs editing
-mode, where the keystrokes are most similar to Emacs. This variable can be
-set to either `emacs' or `vi'.
-
- enable-keypad
--
-
-When set to `on', Readline will try to enable the application
-keypad when it is called. Some systems need this to enable the
-arrow keys. The default is `off'.
-
-
expand-tilde
--
-
-If set to `on', tilde expansion is performed when Readline
-attempts word completion. The default is `off'.
-
-
horizontal-scroll-mode
--
-
-This variable can be set to either `on' or `off'. Setting it
-to `on' means that the text of the lines being edited will scroll
-horizontally on a single screen line when they are longer than the width
-of the screen, instead of wrapping onto a new screen line. By default,
-this variable is set to `off'.
-
-
input-meta
--
-
-
-If set to `on', Readline will enable eight-bit input (it
-will not strip the eighth bit from the characters it reads),
-regardless of what the terminal claims it can support. The
-default value is `off'. The name
meta-flag
is a
-synonym for this variable.
-
- isearch-terminators
--
-
-The string of characters that should terminate an incremental search without
-subsequently executing the character as a command (see section Searching for Commands in the History).
-If this variable has not been given a value, the characters ESC and
-C-J will terminate an incremental search.
-
-
keymap
--
-
-Sets Readline's idea of the current keymap for key binding commands.
-Acceptable
keymap
names are
-emacs
,
-emacs-standard
,
-emacs-meta
,
-emacs-ctlx
,
-vi
,
-vi-command
, and
-vi-insert
.
-vi
is equivalent to vi-command
; emacs
is
-equivalent to emacs-standard
. The default value is emacs
.
-The value of the editing-mode
variable also affects the
-default keymap.
-
- mark-directories
--
-If set to `on', completed directory names have a slash
-appended. The default is `on'.
-
-
mark-modified-lines
--
-
-This variable, when set to `on', causes Readline to display an
-asterisk (`*') at the start of history lines which have been modified.
-This variable is `off' by default.
-
-
output-meta
--
-
-If set to `on', Readline will display characters with the
-eighth bit set directly rather than as a meta-prefixed escape
-sequence. The default is `off'.
-
-
print-completions-horizontally
--
-If set to `on', Readline will display completions with matches
-sorted horizontally in alphabetical order, rather than down the screen.
-The default is `off'.
-
-
show-all-if-ambiguous
--
-
-This alters the default behavior of the completion functions. If
-set to `on',
-words which have more than one possible completion cause the
-matches to be listed immediately instead of ringing the bell.
-The default value is `off'.
-
-
visible-stats
--
-
-If set to `on', a character denoting a file's type
-is appended to the filename when listing possible
-completions. The default is `off'.
-
-
-
- - Key Bindings
-
-
-The syntax for controlling key bindings in the init file is
-simple. First you need to find the name of the command that you
-want to change. The following sections contain tables of the command
-name, the default keybinding, if any, and a short description of what
-the command does.
-
-Once you know the name of the command, simply place the name of the key
-you wish to bind the command to, a colon, and then the name of the
-command on a line in the init file. The name of the key
-can be expressed in different ways, depending on which is most
-comfortable for you.
-
-
-
-- keyname: function-name or macro
-
-
-keyname is the name of a key spelled out in English. For example:
-
-
-Control-u: universal-argument
-Meta-Rubout: backward-kill-word
-Control-o: "> output"
-
-
-In the above example, C-u is bound to the function
-universal-argument
, and C-o is bound to run the macro
-expressed on the right hand side (that is, to insert the text
-`> output' into the line).
-
- - "keyseq": function-name or macro
-
-
-keyseq differs from keyname above in that strings
-denoting an entire key sequence can be specified, by placing
-the key sequence in double quotes. Some GNU Emacs style key
-escapes can be used, as in the following example, but the
-special character names are not recognized.
-
-
-
-"\C-u": universal-argument
-"\C-x\C-r": re-read-init-file
-"\e[11~": "Function Key 1"
-
-
-In the above example, C-u is bound to the function
-universal-argument
(just as it was in the first example),
-`C-x C-r' is bound to the function re-read-init-file
,
-and `ESC [ 1 1 ~' is bound to insert
-the text `Function Key 1'.
-
-
-
-The following GNU Emacs style escape sequences are available when
-specifying key sequences:
-
-
-
-\C-
--
-control prefix
-
\M-
--
-meta prefix
-
\e
--
-an escape character
-
\\
--
-backslash
-
\"
--
-", a double quotation mark
-
\'
--
-', a single quote or apostrophe
-
-
-In addition to the GNU Emacs style escape sequences, a second
-set of backslash escapes is available:
-
-
-
-\a
--
-alert (bell)
-
\b
--
-backspace
-
\d
--
-delete
-
\f
--
-form feed
-
\n
--
-newline
-
\r
--
-carriage return
-
\t
--
-horizontal tab
-
\v
--
-vertical tab
-
\nnn
--
-the character whose
ASCII
code is the octal value nnn
-(one to three digits)
- \xnnn
--
-the character whose
ASCII
code is the hexadecimal value nnn
-(one to three digits)
-
-
-When entering the text of a macro, single or double quotes must
-be used to indicate a macro definition.
-Unquoted text is assumed to be a function name.
-In the macro body, the backslash escapes described above are expanded.
-Backslash will quote any other character in the macro text,
-including `"' and `''.
-For example, the following binding will make `C-x \'
-insert a single `\' into the line:
-
-
-"\C-x\\": "\\"
-
-
-
-
-
-
-
-
-
-Readline implements a facility similar in spirit to the conditional
-compilation features of the C preprocessor which allows key
-bindings and variable settings to be performed as the result
-of tests. There are four parser directives used.
-
-
-
-
-$if
--
-The
$if
construct allows bindings to be made based on the
-editing mode, the terminal being used, or the application using
-Readline. The text of the test extends to the end of the line;
-no characters are required to isolate it.
-
-
-
-mode
--
-The
mode=
form of the $if
directive is used to test
-whether Readline is in emacs
or vi
mode.
-This may be used in conjunction
-with the `set keymap' command, for instance, to set bindings in
-the emacs-standard
and emacs-ctlx
keymaps only if
-Readline is starting out in emacs
mode.
-
- term
--
-The
term=
form may be used to include terminal-specific
-key bindings, perhaps to bind the key sequences output by the
-terminal's function keys. The word on the right side of the
-`=' is tested against both the full name of the terminal and
-the portion of the terminal name before the first `-'. This
-allows sun
to match both sun
and sun-cmd
,
-for instance.
-
- application
--
-The application construct is used to include
-application-specific settings. Each program using the Readline
-library sets the application name, and you can test for it.
-This could be used to bind key sequences to functions useful for
-a specific program. For instance, the following command adds a
-key sequence that quotes the current or previous word in Bash:
-
-
-$if Bash
-# Quote the current or previous word
-"\C-xq": "\eb\"\ef\""
-$endif
-
-
-
-
- $endif
--
-This command, as seen in the previous example, terminates an
-
$if
command.
-
- $else
--
-Commands in this branch of the
$if
directive are executed if
-the test fails.
-
- $include
--
-This directive takes a single filename as an argument and reads commands
-and bindings from that file.
-
-
-$include /etc/inputrc
-
-
-
-
-
-
-
-
-
-Here is an example of an inputrc file. This illustrates key
-binding, variable assignment, and conditional syntax.
-
-
-
-
-# This file controls the behaviour of line input editing for
-# programs that use the Gnu Readline library. Existing programs
-# include FTP, Bash, and Gdb.
-#
-# You can re-read the inputrc file with C-x C-r.
-# Lines beginning with '#' are comments.
-#
-# First, include any systemwide bindings and variable assignments from
-# /etc/Inputrc
-$include /etc/Inputrc
-
-#
-# Set various bindings for emacs mode.
-
-set editing-mode emacs
-
-$if mode=emacs
-
-Meta-Control-h: backward-kill-word Text after the function name is ignored
-
-#
-# Arrow keys in keypad mode
-#
-#"\M-OD": backward-char
-#"\M-OC": forward-char
-#"\M-OA": previous-history
-#"\M-OB": next-history
-#
-# Arrow keys in ANSI mode
-#
-"\M-[D": backward-char
-"\M-[C": forward-char
-"\M-[A": previous-history
-"\M-[B": next-history
-#
-# Arrow keys in 8 bit keypad mode
-#
-#"\M-\C-OD": backward-char
-#"\M-\C-OC": forward-char
-#"\M-\C-OA": previous-history
-#"\M-\C-OB": next-history
-#
-# Arrow keys in 8 bit ANSI mode
-#
-#"\M-\C-[D": backward-char
-#"\M-\C-[C": forward-char
-#"\M-\C-[A": previous-history
-#"\M-\C-[B": next-history
-
-C-q: quoted-insert
-
-$endif
-
-# An old-style binding. This happens to be the default.
-TAB: complete
-
-# Macros that are convenient for shell interaction
-$if Bash
-# edit the path
-"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
-# prepare to type a quoted word -- insert open and close double quotes
-# and move to just after the open quote
-"\C-x\"": "\"\"\C-b"
-# insert a backslash (testing backslash escapes in sequences and macros)
-"\C-x\\": "\\"
-# Quote the current or previous word
-"\C-xq": "\eb\"\ef\""
-# Add a binding to refresh the line, which is unbound
-"\C-xr": redraw-current-line
-# Edit variable on current line.
-"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
-$endif
-
-# use a visible bell if one is available
-set bell-style visible
-
-# don't strip characters to 7 bits when reading
-set input-meta on
-
-# allow iso-latin1 characters to be inserted rather than converted to
-# prefix-meta sequences
-set convert-meta off
-
-# display characters with the eighth bit set directly rather than
-# as meta-prefixed characters
-set output-meta on
-
-# if there are more than 150 possible completions for a word, ask the
-# user if he wants to see all of them
-set completion-query-items 150
-
-# For FTP
-$if Ftp
-"\C-xg": "get \M-?"
-"\C-xt": "put \M-?"
-"\M-.": yank-last-arg
-$endif
-
-
-
-
-
-
-
-
-
-
-This section describes Readline commands that may be bound to key
-sequences.
-
-
-
-Command names without an accompanying key sequence are unbound by default.
-In the following descriptions, point refers to the current cursor
-position, and mark refers to a cursor position saved by the
-set-mark
command.
-The text between the point and mark is referred to as the region.
-
-
-
-
-
-
-
-beginning-of-line (C-a)
--
-
-Move to the start of the current line.
-
-
end-of-line (C-e)
--
-
-Move to the end of the line.
-
-
forward-char (C-f)
--
-
-Move forward a character.
-
-
backward-char (C-b)
--
-
-Move back a character.
-
-
forward-word (M-f)
--
-
-Move forward to the end of the next word. Words are composed of
-letters and digits.
-
-
backward-word (M-b)
--
-
-Move back to the start of the current or previous word. Words are
-composed of letters and digits.
-
-
clear-screen (C-l)
--
-
-Clear the screen and redraw the current line,
-leaving the current line at the top of the screen.
-
-
redraw-current-line ()
--
-
-Refresh the current line. By default, this is unbound.
-
-
-
-
-
-
-
-
-
-accept-line (Newline, Return)
--
-
-Accept the line regardless of where the cursor is. If this line is
-non-empty, add it to the history list. If this line was a history
-line, then restore the history line to its original state.
-
-
previous-history (C-p)
--
-
-Move `up' through the history list.
-
-
next-history (C-n)
--
-
-Move `down' through the history list.
-
-
beginning-of-history (M-<)
--
-
-Move to the first line in the history.
-
-
end-of-history (M->)
--
-
-Move to the end of the input history, i.e., the line currently
-being entered.
-
-
reverse-search-history (C-r)
--
-
-Search backward starting at the current line and moving `up' through
-the history as necessary. This is an incremental search.
-
-
forward-search-history (C-s)
--
-
-Search forward starting at the current line and moving `down' through
-the the history as necessary. This is an incremental search.
-
-
non-incremental-reverse-search-history (M-p)
--
-
-Search backward starting at the current line and moving `up'
-through the history as necessary using a non-incremental search
-for a string supplied by the user.
-
-
non-incremental-forward-search-history (M-n)
--
-
-Search forward starting at the current line and moving `down'
-through the the history as necessary using a non-incremental search
-for a string supplied by the user.
-
-
history-search-forward ()
--
-
-Search forward through the history for the string of characters
-between the start of the current line and the point.
-This is a non-incremental search.
-By default, this command is unbound.
-
-
history-search-backward ()
--
-
-Search backward through the history for the string of characters
-between the start of the current line and the point. This
-is a non-incremental search. By default, this command is unbound.
-
-
yank-nth-arg (M-C-y)
--
-
-Insert the first argument to the previous command (usually
-the second word on the previous line). With an argument n,
-insert the nth word from the previous command (the words
-in the previous command begin with word 0). A negative argument
-inserts the nth word from the end of the previous command.
-
-
yank-last-arg (M-., M-_)
--
-
-Insert last argument to the previous command (the last word of the
-previous history entry). With an
-argument, behave exactly like
yank-nth-arg
.
-Successive calls to yank-last-arg
move back through the history
-list, inserting the last argument of each line in turn.
-
-
-
-
-
-
-
-
-
-delete-char (C-d)
--
-
-Delete the character under the cursor. If the cursor is at the
-beginning of the line, there are no characters in the line, and
-the last character typed was not bound to
delete-char
, then
-return EOF
.
-
- backward-delete-char (Rubout)
--
-
-Delete the character behind the cursor. A numeric argument means
-to kill the characters instead of deleting them.
-
-
forward-backward-delete-char ()
--
-
-Delete the character under the cursor, unless the cursor is at the
-end of the line, in which case the character behind the cursor is
-deleted. By default, this is not bound to a key.
-
-
quoted-insert (C-q, C-v)
--
-
-Add the next character typed to the line verbatim. This is
-how to insert key sequences like C-q, for example.
-
-
tab-insert (M-TAB)
--
-
-Insert a tab character.
-
-
self-insert (a, b, A, 1, !, ...)
--
-
-Insert yourself.
-
-
transpose-chars (C-t)
--
-
-Drag the character before the cursor forward over
-the character at the cursor, moving the
-cursor forward as well. If the insertion point
-is at the end of the line, then this
-transposes the last two characters of the line.
-Negative arguments have no effect.
-
-
transpose-words (M-t)
--
-
-Drag the word before point past the word after point,
-moving point past that word as well.
-
-
upcase-word (M-u)
--
-
-Uppercase the current (or following) word. With a negative argument,
-uppercase the previous word, but do not move the cursor.
-
-
downcase-word (M-l)
--
-
-Lowercase the current (or following) word. With a negative argument,
-lowercase the previous word, but do not move the cursor.
-
-
capitalize-word (M-c)
--
-
-Capitalize the current (or following) word. With a negative argument,
-capitalize the previous word, but do not move the cursor.
-
-
-
-
-
-
-
-
-
-kill-line (C-k)
--
-
-Kill the text from point to the end of the line.
-
-
backward-kill-line (C-x Rubout)
--
-
-Kill backward to the beginning of the line.
-
-
unix-line-discard (C-u)
--
-
-Kill backward from the cursor to the beginning of the current line.
-
-
kill-whole-line ()
--
-
-Kill all characters on the current line, no matter point is.
-By default, this is unbound.
-
-
kill-word (M-d)
--
-
-Kill from point to the end of the current word, or if between
-words, to the end of the next word.
-Word boundaries are the same as
forward-word
.
-
- backward-kill-word (M-DEL)
--
-
-Kill the word behind point.
-Word boundaries are the same as
backward-word
.
-
- unix-word-rubout (C-w)
--
-
-Kill the word behind point, using white space as a word boundary.
-The killed text is saved on the kill-ring.
-
-
delete-horizontal-space ()
--
-
-Delete all spaces and tabs around point. By default, this is unbound.
-
-
kill-region ()
--
-
-Kill the text in the current region.
-By default, this command is unbound.
-
-
copy-region-as-kill ()
--
-
-Copy the text in the region to the kill buffer, so it can be yanked
-right away. By default, this command is unbound.
-
-
copy-backward-word ()
--
-
-Copy the word before point to the kill buffer.
-The word boundaries are the same as
backward-word
.
-By default, this command is unbound.
-
- copy-forward-word ()
--
-
-Copy the word following point to the kill buffer.
-The word boundaries are the same as
forward-word
.
-By default, this command is unbound.
-
- yank (C-y)
--
-
-Yank the top of the kill ring into the buffer at the current
-cursor position.
-
-
yank-pop (M-y)
--
-
-Rotate the kill-ring, and yank the new top. You can only do this if
-the prior command is yank or yank-pop.
-
-
-
-
-
-
-
-digit-argument (M-0, M-1, ... M--)
--
-
-Add this digit to the argument already accumulating, or start a new
-argument. M-- starts a negative argument.
-
-
universal-argument ()
--
-
-This is another way to specify an argument.
-If this command is followed by one or more digits, optionally with a
-leading minus sign, those digits define the argument.
-If the command is followed by digits, executing
universal-argument
-again ends the numeric argument, but is otherwise ignored.
-As a special case, if this command is immediately followed by a
-character that is neither a digit or minus sign, the argument count
-for the next command is multiplied by four.
-The argument count is initially one, so executing this function the
-first time makes the argument count four, a second time makes the
-argument count sixteen, and so on.
-By default, this is not bound to a key.
-
-
-
-
-
-
-
-
-complete (TAB)
--
-
-Attempt to do completion on the text before the cursor. This is
-application-specific. Generally, if you are typing a filename
-argument, you can do filename completion; if you are typing a command,
-you can do command completion; if you are typing in a symbol to GDB, you
-can do symbol name completion; if you are typing in a variable to Bash,
-you can do variable name completion, and so on.
-
-
possible-completions (M-?)
--
-
-List the possible completions of the text before the cursor.
-
-
insert-completions (M-*)
--
-
-Insert all completions of the text before point that would have
-been generated by
possible-completions
.
-
- menu-complete ()
--
-
-Similar to
complete
, but replaces the word to be completed
-with a single match from the list of possible completions.
-Repeated execution of menu-complete
steps through the list
-of possible completions, inserting each match in turn.
-At the end of the list of completions, the bell is rung and the
-original text is restored.
-An argument of n moves n positions forward in the list
-of matches; a negative argument may be used to move backward
-through the list.
-This command is intended to be bound to TAB
, but is unbound
-by default.
-
- delete-char-or-list ()
--
-
-Deletes the character under the cursor if not at the beginning or
-end of the line (like
delete-char
).
-If at the end of the line, behaves identically to
-possible-completions
.
-This command is unbound by default.
-
-
-
-
-
-
-
-
-start-kbd-macro (C-x ()
--
-
-Begin saving the characters typed into the current keyboard macro.
-
-
end-kbd-macro (C-x ))
--
-
-Stop saving the characters typed into the current keyboard macro
-and save the definition.
-
-
call-last-kbd-macro (C-x e)
--
-
-Re-execute the last keyboard macro defined, by making the characters
-in the macro appear as if typed at the keyboard.
-
-
-
-
-
-
-
-
-re-read-init-file (C-x C-r)
--
-
-Read in the contents of the inputrc file, and incorporate
-any bindings or variable assignments found there.
-
-
abort (C-g)
--
-
-Abort the current editing command and
-ring the terminal's bell (subject to the setting of
-
bell-style
).
-
- do-uppercase-version (M-a, M-b, M-x, ...)
--
-
-If the metafied character x is lowercase, run the command
-that is bound to the corresponding uppercase character.
-
-
prefix-meta (ESC)
--
-
-Make the next character typed be metafied. This is for keyboards
-without a meta key. Typing `ESC f' is equivalent to typing
-`M-f'.
-
-
undo (C-_, C-x C-u)
--
-
-Incremental undo, separately remembered for each line.
-
-
revert-line (M-r)
--
-
-Undo all changes made to this line. This is like executing the
undo
-command enough times to get back to the beginning.
-
- tilde-expand (M-~)
--
-
-Perform tilde expansion on the current word.
-
-
set-mark (C-@)
--
-
-Set the mark to the current point. If a
-numeric argument is supplied, the mark is set to that position.
-
-
exchange-point-and-mark (C-x C-x)
--
-
-Swap the point with the mark. The current cursor position is set to
-the saved position, and the old cursor position is saved as the mark.
-
-
character-search (C-])
--
-
-A character is read and point is moved to the next occurrence of that
-character. A negative count searches for previous occurrences.
-
-
character-search-backward (M-C-])
--
-
-A character is read and point is moved to the previous occurrence
-of that character. A negative count searches for subsequent
-occurrences.
-
-
insert-comment (M-#)
--
-
-The value of the
comment-begin
-variable is inserted at the beginning of the current line,
-and the line is accepted as if a newline had been typed.
-
- dump-functions ()
--
-
-Print all of the functions and their key bindings to the
-Readline output stream. If a numeric argument is supplied,
-the output is formatted in such a way that it can be made part
-of an inputrc file. This command is unbound by default.
-
-
dump-variables ()
--
-
-Print all of the settable variables and their values to the
-Readline output stream. If a numeric argument is supplied,
-the output is formatted in such a way that it can be made part
-of an inputrc file. This command is unbound by default.
-
-
dump-macros ()
--
-
-Print all of the Readline key sequences bound to macros and the
-strings they ouput. If a numeric argument is supplied,
-the output is formatted in such a way that it can be made part
-of an inputrc file. This command is unbound by default.
-
-
-
-
-
-
-
-
-While the Readline library does not have a full set of vi
-editing functions, it does contain enough to allow simple editing
-of the line. The Readline vi
mode behaves as specified in
-the POSIX 1003.2 standard.
-
-
-
-In order to switch interactively between emacs
and vi
-editing modes, use the command M-C-j (toggle-editing-mode).
-The Readline default is emacs
mode.
-
-
-
-When you enter a line in vi
mode, you are already placed in
-`insertion' mode, as if you had typed an `i'. Pressing ESC
-switches you into `command' mode, where you can edit the text of the
-line with the standard vi
movement keys, move to previous
-history lines with `k' and subsequent lines with `j', and
-so forth.
-
-
-
-
-
-
-
-
-This chapter describes the interface between the GNU Readline Library and
-other programs. If you are a programmer, and you wish to include the
-features found in GNU Readline
-such as completion, line editing, and interactive history manipulation
-in your own programs, this section is for you.
-
-
-
-
-
-
-
-
-
-
-Many programs provide a command line interface, such as mail
,
-ftp
, and sh
. For such programs, the default behaviour of
-Readline is sufficient. This section describes how to use Readline in
-the simplest way possible, perhaps to replace calls in your code to
-gets()
or fgets ()
.
-
-
-
-
-
-The function readline ()
prints a prompt and then reads and returns
-a single line of text from the user. The line readline
-returns is allocated with malloc ()
; you should free ()
-the line when you are done with it. The declaration for readline
-in ANSI C is
-
-
-
-
-char *readline (char *prompt);
-
-
-
-So, one might say
-
-
-char *line = readline ("Enter a line: ");
-
-
-
-in order to read a line of text from the user.
-The line returned has the final newline removed, so only the
-text remains.
-
-
-
-If readline
encounters an EOF
while reading the line, and the
-line is empty at that point, then (char *)NULL
is returned.
-Otherwise, the line is ended just as if a newline had been typed.
-
-
-
-If you want the user to be able to get at the line later, (with
-C-p for example), you must call add_history ()
to save the
-line away in a history list of such lines.
-
-
-
-
-add_history (line)
;
-
-
-
-For full details on the GNU History Library, see the associated manual.
-
-
-
-It is preferable to avoid saving empty lines on the history list, since
-users rarely have a burning need to reuse a blank line. Here is
-a function which usefully replaces the standard gets ()
library
-function, and has the advantage of no static buffer to overflow:
-
-
-
-
-/* A static variable for holding the line. */
-static char *line_read = (char *)NULL;
-
-/* Read a string, and return a pointer to it. Returns NULL on EOF. */
-char *
-rl_gets ()
-{
- /* If the buffer has already been allocated, return the memory
- to the free pool. */
- if (line_read)
- {
- free (line_read);
- line_read = (char *)NULL;
- }
-
- /* Get a line from the user. */
- line_read = readline ("");
-
- /* If the line has any text in it, save it on the history. */
- if (line_read && *line_read)
- add_history (line_read);
-
- return (line_read);
-}
-
-
-
-This function gives the user the default behaviour of TAB
-completion: completion on file names. If you do not want Readline to
-complete on filenames, you can change the binding of the TAB key
-with rl_bind_key ()
.
-
-
-
-
-int rl_bind_key (int key, int (*function)());
-
-
-
-rl_bind_key ()
takes two arguments: key is the character that
-you want to bind, and function is the address of the function to
-call when key is pressed. Binding TAB to rl_insert ()
-makes TAB insert itself.
-rl_bind_key ()
returns non-zero if key is not a valid
-ASCII character code (between 0 and 255).
-
-
-
-Thus, to disable the default TAB behavior, the following suffices:
-
-
-rl_bind_key ('\t', rl_insert);
-
-
-
-This code should be executed once at the start of your program; you
-might write a function called initialize_readline ()
which
-performs this and other desired initializations, such as installing
-custom completers (see section Custom Completers).
-
-
-
-
-
-
-
-Readline provides many functions for manipulating the text of
-the line, but it isn't possible to anticipate the needs of all
-programs. This section describes the various functions and variables
-defined within the Readline library which allow a user program to add
-customized functionality to Readline.
-
-
-
-Before declaring any functions that customize Readline's behavior, or
-using any functionality Readline provides in other code, an
-application writer should include the file <readline/readline.h>
-in any file that uses Readline's features. Since some of the definitions
-in readline.h
use the stdio
library, the file
-<stdio.h>
should be included before readline.h
.
-
-
-
-
-
-
-
-
-
-
-For readabilty, we declare a new type of object, called
-Function. A Function
is a C function which
-returns an int
. The type declaration for Function
is:
-
-
-
-typedef int Function ();
-
-
-
-The reason for declaring this new type is to make it easier to write
-code describing pointers to C functions. Let us say we had a variable
-called func which was a pointer to a function. Instead of the
-classic C declaration
-
-
-
-int (*)()func;
-
-
-
-we may write
-
-
-
-Function *func;
-
-
-
-Similarly, there are
-
-
-
-
-typedef void VFunction ();
-typedef char *CPFunction (); and
-typedef char **CPPFunction ();
-
-
-
-for functions returning no value, pointer to char
, and
-pointer to pointer to char
, respectively.
-
-
-
-
-
-
-
-In order to write new functions for Readline, you need to know the
-calling conventions for keyboard-invoked functions, and the names of the
-variables that describe the current state of the line read so far.
-
-
-
-The calling sequence for a command foo
looks like
-
-
-
-
-foo (int count, int key)
-
-
-
-where count is the numeric argument (or 1 if defaulted) and
-key is the key that invoked this function.
-
-
-
-It is completely up to the function as to what should be done with the
-numeric argument. Some functions use it as a repeat count, some
-as a flag, and others to choose alternate behavior (refreshing the current
-line as opposed to refreshing the screen, for example). Some choose to
-ignore it. In general, if a
-function uses the numeric argument as a repeat count, it should be able
-to do something useful with both negative and positive arguments.
-At the very least, it should be aware that it can be passed a
-negative argument.
-
-
-
-
-
-
-
-These variables are available to function writers.
-
-
-
-
-- Variable: char * rl_line_buffer
-
-
-This is the line gathered so far. You are welcome to modify the
-contents of the line, but see section Allowing Undoing. The
-function
rl_extend_line_buffer
is available to increase
-the memory allocated to rl_line_buffer
.
-
-
-
-
-
-- Variable: int rl_point
-
-
-The offset of the current cursor position in
rl_line_buffer
-(the point).
-
-
-
-
-
-- Variable: int rl_end
-
-
-The number of characters present in
rl_line_buffer
. When
-rl_point
is at the end of the line, rl_point
and
-rl_end
are equal.
-
-
-
-
-
-- Variable: int rl_mark
-
-
-The mark (saved position) in the current line. If set, the mark
-and point define a region.
-
-
-
-
-
-- Variable: int rl_done
-
-
-Setting this to a non-zero value causes Readline to return the current
-line immediately.
-
-
-
-
-
-- Variable: int rl_pending_input
-
-
-Setting this to a value makes it the next keystroke read. This is a
-way to stuff a single character into the input stream.
-
-
-
-
-
-- Variable: int rl_erase_empty_line
-
-
-Setting this to a non-zero value causes Readline to completely erase
-the current line, including any prompt, any time a newline is typed as
-the only character on an otherwise-empty line. The cursor is moved to
-the beginning of the newly-blank line.
-
-
-
-
-
-- Variable: char * rl_prompt
-
-
-The prompt Readline uses. This is set from the argument to
-
readline ()
, and should not be assigned to directly.
-
-
-
-
-
-- Variable: int rl_already_prompted
-
-
-If an application wishes to display the prompt itself, rather than have
-Readline do it the first time
readline()
is called, it should set
-this variable to a non-zero value after displaying the prompt.
-The prompt must also be passed as the argument to readline()
so
-the redisplay functions can update the display properly.
-The calling application is responsible for managing the value; Readline
-never sets it.
-
-
-
-
-
-- Variable: char * rl_library_version
-
-
-The version number of this revision of the library.
-
-
-
-
-
-- Variable: char * rl_terminal_name
-
-
-The terminal type, used for initialization.
-
-
-
-
-
-- Variable: char * rl_readline_name
-
-
-This variable is set to a unique name by each application using Readline.
-The value allows conditional parsing of the inputrc file
-(see section Conditional Init Constructs).
-
-
-
-
-
-- Variable: FILE * rl_instream
-
-
-The stdio stream from which Readline reads input.
-
-
-
-
-
-- Variable: FILE * rl_outstream
-
-
-The stdio stream to which Readline performs output.
-
-
-
-
-
-- Variable: Function * rl_startup_hook
-
-
-If non-zero, this is the address of a function to call just
-before
readline
prints the first prompt.
-
-
-
-
-
-- Variable: Function * rl_pre_input_hook
-
-
-If non-zero, this is the address of a function to call after
-the first prompt has been printed and just before
readline
-starts reading input characters.
-
-
-
-
-
-- Variable: Function * rl_event_hook
-
-
-If non-zero, this is the address of a function to call periodically
-when readline is waiting for terminal input.
-
-
-
-
-
-- Variable: Function * rl_getc_function
-
-
-If non-zero,
readline
will call indirectly through this pointer
-to get a character from the input stream. By default, it is set to
-rl_getc
, the default readline
character input function
-(see section Utility Functions).
-
-
-
-
-
-- Variable: VFunction * rl_redisplay_function
-
-
-If non-zero,
readline
will call indirectly through this pointer
-to update the display with the current contents of the editing buffer.
-By default, it is set to rl_redisplay
, the default readline
-redisplay function (see section Redisplay).
-
-
-
-
-
-- Variable: Keymap rl_executing_keymap
-
-
-This variable is set to the keymap (see section Selecting a Keymap) in which the
-currently executing readline function was found.
-
-
-
-
-
-- Variable: Keymap rl_binding_keymap
-
-
-This variable is set to the keymap (see section Selecting a Keymap) in which the
-last key binding occurred.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-The user can dynamically change the bindings of keys while using
-Readline. This is done by representing the function with a descriptive
-name. The user is able to type the descriptive name when referring to
-the function. Thus, in an init file, one might find
-
-
-
-
-Meta-Rubout: backward-kill-word
-
-
-
-This binds the keystroke Meta-Rubout to the function
-descriptively named backward-kill-word
. You, as the
-programmer, should bind the functions you write to descriptive names as
-well. Readline provides a function for doing that:
-
-
-
-
-- Function: int rl_add_defun (char *name, Function *function, int key)
-
-
-Add name to the list of named functions. Make function be
-the function that gets called. If key is not -1, then bind it to
-function using
rl_bind_key ()
.
-
-
-
-
-Using this function alone is sufficient for most applications. It is
-the recommended way to add a few functions to the default functions that
-Readline has built in. If you need to do something other
-than adding a function to Readline, you may need to use the
-underlying functions described below.
-
-
-
-
-
-
-
-Key bindings take place on a keymap. The keymap is the
-association between the keys that the user types and the functions that
-get run. You can make your own keymaps, copy existing keymaps, and tell
-Readline which keymap to use.
-
-
-
-
-- Function: Keymap rl_make_bare_keymap ()
-
-
-Returns a new, empty keymap. The space for the keymap is allocated with
-
malloc ()
; you should free ()
it when you are done.
-
-
-
-
-
-- Function: Keymap rl_copy_keymap (Keymap map)
-
-
-Return a new keymap which is a copy of map.
-
-
-
-
-
-- Function: Keymap rl_make_keymap ()
-
-
-Return a new keymap with the printing characters bound to rl_insert,
-the lowercase Meta characters bound to run their equivalents, and
-the Meta digits bound to produce numeric arguments.
-
-
-
-
-
-- Function: void rl_discard_keymap (Keymap keymap)
-
-
-Free the storage associated with keymap.
-
-
-
-
-Readline has several internal keymaps. These functions allow you to
-change which keymap is active.
-
-
-
-
-- Function: Keymap rl_get_keymap ()
-
-
-Returns the currently active keymap.
-
-
-
-
-
-- Function: void rl_set_keymap (Keymap keymap)
-
-
-Makes keymap the currently active keymap.
-
-
-
-
-
-- Function: Keymap rl_get_keymap_by_name (char *name)
-
-
-Return the keymap matching name. name is one which would
-be supplied in a
set keymap
inputrc line (see section Readline Init File).
-
-
-
-
-
-- Function: char * rl_get_keymap_name (Keymap keymap)
-
-
-Return the name matching keymap. name is one which would
-be supplied in a
set keymap
inputrc line (see section Readline Init File).
-
-
-
-
-
-
-
-
-You associate keys with functions through the keymap. Readline has
-several internal keymaps: emacs_standard_keymap
,
-emacs_meta_keymap
, emacs_ctlx_keymap
,
-vi_movement_keymap
, and vi_insertion_keymap
.
-emacs_standard_keymap
is the default, and the examples in
-this manual assume that.
-
-
-
-Since readline
installs a set of default key bindings the first
-time it is called, there is always the danger that a custom binding
-installed before the first call to readline
will be overridden.
-An alternate mechanism is to install custom key bindings in an
-initialization function assigned to the rl_startup_hook
variable
-(see section Readline Variables).
-
-
-
-These functions manage key bindings.
-
-
-
-
-- Function: int rl_bind_key (int key, Function *function)
-
-
-Binds key to function in the currently active keymap.
-Returns non-zero in the case of an invalid key.
-
-
-
-
-
-- Function: int rl_bind_key_in_map (int key, Function *function, Keymap map)
-
-
-Bind key to function in map. Returns non-zero in the case
-of an invalid key.
-
-
-
-
-
-- Function: int rl_unbind_key (int key)
-
-
-Bind key to the null function in the currently active keymap.
-Returns non-zero in case of error.
-
-
-
-
-
-- Function: int rl_unbind_key_in_map (int key, Keymap map)
-
-
-Bind key to the null function in map.
-Returns non-zero in case of error.
-
-
-
-
-
-- Function: int rl_unbind_function_in_map (Function *function, Keymap map)
-
-
-Unbind all keys that execute function in map.
-
-
-
-
-
-- Function: int rl_unbind_command_in_map (char *command, Keymap map)
-
-
-Unbind all keys that are bound to command in map.
-
-
-
-
-
-- Function: int rl_generic_bind (int type, char *keyseq, char *data, Keymap map)
-
-
-Bind the key sequence represented by the string keyseq to the arbitrary
-pointer data. type says what kind of data is pointed to by
-data; this can be a function (
ISFUNC
), a macro
-(ISMACR
), or a keymap (ISKMAP
). This makes new keymaps as
-necessary. The initial keymap in which to do bindings is map.
-
-
-
-
-
-- Function: int rl_parse_and_bind (char *line)
-
-
-Parse line as if it had been read from the
inputrc
file and
-perform any key bindings and variable assignments found
-(see section Readline Init File).
-
-
-
-
-
-- Function: int rl_read_init_file (char *filename)
-
-
-Read keybindings and variable assignments from filename
-(see section Readline Init File).
-
-
-
-
-
-
-
-
-These functions allow you to find out what keys invoke named functions
-and the functions invoked by a particular key sequence.
-
-
-
-
-- Function: Function * rl_named_function (char *name)
-
-
-Return the function with name name.
-
-
-
-
-
-- Function: Function * rl_function_of_keyseq (char *keyseq, Keymap map, int *type)
-
-
-Return the function invoked by keyseq in keymap map.
-If map is NULL, the current keymap is used. If type is
-not NULL, the type of the object is returned in it (one of
ISFUNC
,
-ISKMAP
, or ISMACR
).
-
-
-
-
-
-- Function: char ** rl_invoking_keyseqs (Function *function)
-
-
-Return an array of strings representing the key sequences used to
-invoke function in the current keymap.
-
-
-
-
-
-- Function: char ** rl_invoking_keyseqs_in_map (Function *function, Keymap map)
-
-
-Return an array of strings representing the key sequences used to
-invoke function in the keymap map.
-
-
-
-
-
-- Function: void rl_function_dumper (int readable)
-
-
-Print the readline function names and the key sequences currently
-bound to them to
rl_outstream
. If readable is non-zero,
-the list is formatted in such a way that it can be made part of an
-inputrc
file and re-read.
-
-
-
-
-
-- Function: void rl_list_funmap_names ()
-
-
-Print the names of all bindable Readline functions to
rl_outstream
.
-
-
-
-
-
-- Function: char ** rl_funmap_names ()
-
-
-Return a NULL terminated array of known function names. The array is
-sorted. The array itself is allocated, but not the strings inside. You
-should free () the array when you done, but not the pointrs.
-
-
-
-
-
-
-
-
-Supporting the undo command is a painless thing, and makes your
-functions much more useful. It is certainly easy to try
-something if you know you can undo it. I could use an undo function for
-the stock market.
-
-
-
-If your function simply inserts text once, or deletes text once, and
-uses rl_insert_text ()
or rl_delete_text ()
to do it, then
-undoing is already done for you automatically.
-
-
-
-If you do multiple insertions or multiple deletions, or any combination
-of these operations, you should group them together into one operation.
-This is done with rl_begin_undo_group ()
and
-rl_end_undo_group ()
.
-
-
-
-The types of events that can be undone are:
-
-
-
-
-enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
-
-
-
-Notice that UNDO_DELETE
means to insert some text, and
-UNDO_INSERT
means to delete some text. That is, the undo code
-tells undo what to undo, not how to undo it. UNDO_BEGIN
and
-UNDO_END
are tags added by rl_begin_undo_group ()
and
-rl_end_undo_group ()
.
-
-
-
-
-- Function: int rl_begin_undo_group ()
-
-
-Begins saving undo information in a group construct. The undo
-information usually comes from calls to
rl_insert_text ()
and
-rl_delete_text ()
, but could be the result of calls to
-rl_add_undo ()
.
-
-
-
-
-
-- Function: int rl_end_undo_group ()
-
-
-Closes the current undo group started with
rl_begin_undo_group
-()
. There should be one call to rl_end_undo_group ()
-for each call to rl_begin_undo_group ()
.
-
-
-
-
-
-- Function: void rl_add_undo (enum undo_code what, int start, int end, char *text)
-
-
-Remember how to undo an event (according to what). The affected
-text runs from start to end, and encompasses text.
-
-
-
-
-
-- Function: void free_undo_list ()
-
-
-Free the existing undo list.
-
-
-
-
-
-- Function: int rl_do_undo ()
-
-
-Undo the first thing on the undo list. Returns
0
if there was
-nothing to undo, non-zero if something was undone.
-
-
-
-
-Finally, if you neither insert nor delete text, but directly modify the
-existing text (e.g., change its case), call rl_modifying ()
-once, just before you modify the text. You must supply the indices of
-the text range that you are going to modify.
-
-
-
-
-- Function: int rl_modifying (int start, int end)
-
-
-Tell Readline to save the text between start and end as a
-single undo unit. It is assumed that you will subsequently modify
-that text.
-
-
-
-
-
-
-
-
-
-- Function: void rl_redisplay ()
-
-
-Change what's displayed on the screen to reflect the current contents
-of
rl_line_buffer
.
-
-
-
-
-
-- Function: int rl_forced_update_display ()
-
-
-Force the line to be updated and redisplayed, whether or not
-Readline thinks the screen display is correct.
-
-
-
-
-
-- Function: int rl_on_new_line ()
-
-
-Tell the update functions that we have moved onto a new (empty) line,
-usually after ouputting a newline.
-
-
-
-
-
-- Function: int rl_on_new_line_with_prompt ()
-
-
-Tell the update functions that we have moved onto a new line, with
-rl_prompt already displayed.
-This could be used by applications that want to output the prompt string
-themselves, but still need Readline to know the prompt string length for
-redisplay.
-It should be used after setting rl_already_prompted.
-
-
-
-
-
-- Function: int rl_reset_line_state ()
-
-
-Reset the display state to a clean state and redisplay the current line
-starting on a new line.
-
-
-
-
-
-- Function: int rl_message (va_alist)
-
-
-The arguments are a string as would be supplied to
printf
. The
-resulting string is displayed in the echo area. The echo area
-is also used to display numeric arguments and search strings.
-
-
-
-
-
-- Function: int rl_clear_message ()
-
-
-Clear the message in the echo area.
-
-
-
-
-
-- Function: void rl_save_prompt ()
-
-
-Save the local Readline prompt display state in preparation for
-displaying a new message in the message area with
rl_message
.
-
-
-
-
-
-- Function: void rl_restore_prompt ()
-
-
-Restore the local Readline prompt display state saved by the most
-recent call to
rl_save_prompt
.
-
-
-
-
-
-
-
-
-
-- Function: int rl_insert_text (char *text)
-
-
-Insert text into the line at the current cursor position.
-
-
-
-
-
-- Function: int rl_delete_text (int start, int end)
-
-
-Delete the text between start and end in the current line.
-
-
-
-
-
-- Function: char * rl_copy_text (int start, int end)
-
-
-Return a copy of the text between start and end in
-the current line.
-
-
-
-
-
-- Function: int rl_kill_text (int start, int end)
-
-
-Copy the text between start and end in the current line
-to the kill ring, appending or prepending to the last kill if the
-last command was a kill command. The text is deleted.
-If start is less than end,
-the text is appended, otherwise prepended. If the last command was
-not a kill, a new kill ring slot is used.
-
-
-
-
-
-
-
-
-
-- Function: int rl_read_key ()
-
-
-Return the next character available. This handles input inserted into
-the input stream via pending input (see section Readline Variables)
-and
rl_stuff_char ()
, macros, and characters read from the keyboard.
-
-
-
-
-
-- Function: int rl_getc (FILE *)
-
-
-Return the next character available from the keyboard.
-
-
-
-
-
-- Function: int rl_stuff_char (int c)
-
-
-Insert c into the Readline input stream. It will be "read"
-before Readline attempts to read characters from the terminal with
-
rl_read_key ()
.
-
-
-
-
-
-- Function: int rl_extend_line_buffer (int len)
-
-
-Ensure that
rl_line_buffer
has enough space to hold len
-characters, possibly reallocating it if necessary.
-
-
-
-
-
-- Function: int rl_initialize ()
-
-
-Initialize or re-initialize Readline's internal state.
-
-
-
-
-
-- Function: int rl_reset_terminal (char *terminal_name)
-
-
-Reinitialize Readline's idea of the terminal settings using
-terminal_name as the terminal type (e.g.,
vt100
).
-If terminal_name is NULL, the value of the TERM
-environment variable is used.
-
-
-
-
-
-- Function: int alphabetic (int c)
-
-
-Return 1 if c is an alphabetic character.
-
-
-
-
-
-- Function: int numeric (int c)
-
-
-Return 1 if c is a numeric character.
-
-
-
-
-
-- Function: int ding ()
-
-
-Ring the terminal bell, obeying the setting of
bell-style
.
-
-
-
-
-
-- Function: void rl_display_match_list (char **matches, int len, int max)
-
-
-A convenience function for displaying a list of strings in
-columnar format on Readline's output stream.
matches
is the list
-of strings, in argv format, such as a list of completion matches.
-len
is the number of strings in matches
, and max
-is the length of the longest string in matches
. This function uses
-the setting of print-completions-horizontally
to select how the
-matches are displayed (see section Readline Init File Syntax).
-
-
-
-
-The following are implemented as macros, defined in chartypes.h
.
-
-
-
-
-- Function: int uppercase_p (int c)
-
-
-Return 1 if c is an uppercase alphabetic character.
-
-
-
-
-
-- Function: int lowercase_p (int c)
-
-
-Return 1 if c is a lowercase alphabetic character.
-
-
-
-
-
-- Function: int digit_p (int c)
-
-
-Return 1 if c is a numeric character.
-
-
-
-
-
-- Function: int to_upper (int c)
-
-
-If c is a lowercase alphabetic character, return the corresponding
-uppercase character.
-
-
-
-
-
-- Function: int to_lower (int c)
-
-
-If c is an uppercase alphabetic character, return the corresponding
-lowercase character.
-
-
-
-
-
-- Function: int digit_value (int c)
-
-
-If c is a number, return the value it represents.
-
-
-
-
-
-
-
-
-An alternate interface is available to plain readline()
. Some
-applications need to interleave keyboard I/O with file, device, or
-window system I/O, typically by using a main loop to select()
-on various file descriptors. To accomodate this need, readline can
-also be invoked as a `callback' function from an event loop. There
-are functions available to make this easy.
-
-
-
-
-- Function: void rl_callback_handler_install (char *prompt, Vfunction *lhandler)
-
-
-Set up the terminal for readline I/O and display the initial
-expanded value of prompt. Save the value of lhandler to
-use as a callback when a complete line of input has been entered.
-
-
-
-
-
-- Function: void rl_callback_read_char ()
-
-
-Whenever an application determines that keyboard input is available, it
-should call
rl_callback_read_char()
, which will read the next
-character from the current input source. If that character completes the
-line, rl_callback_read_char
will invoke the lhandler
-function saved by rl_callback_handler_install
to process the
-line. EOF
is indicated by calling lhandler with a
-NULL
line.
-
-
-
-
-
-- Function: void rl_callback_handler_remove ()
-
-
-Restore the terminal to its initial state and remove the line handler.
-This may be called from within a callback as well as independently.
-
-
-
-
-
-
-
-
-Here is a function which changes lowercase characters to their uppercase
-equivalents, and uppercase characters to lowercase. If
-this function was bound to `M-c', then typing `M-c' would
-change the case of the character under point. Typing `M-1 0 M-c'
-would change the case of the following 10 characters, leaving the cursor on
-the last character changed.
-
-
-
-
-/* Invert the case of the COUNT following characters. */
-int
-invert_case_line (count, key)
- int count, key;
-{
- register int start, end, i;
-
- start = rl_point;
-
- if (rl_point >= rl_end)
- return (0);
-
- if (count < 0)
- {
- direction = -1;
- count = -count;
- }
- else
- direction = 1;
-
- /* Find the end of the range to modify. */
- end = start + (count * direction);
-
- /* Force it to be within range. */
- if (end > rl_end)
- end = rl_end;
- else if (end < 0)
- end = 0;
-
- if (start == end)
- return (0);
-
- if (start > end)
- {
- int temp = start;
- start = end;
- end = temp;
- }
-
- /* Tell readline that we are modifying the line, so it will save
- the undo information. */
- rl_modifying (start, end);
-
- for (i = start; i != end; i++)
- {
- if (uppercase_p (rl_line_buffer[i]))
- rl_line_buffer[i] = to_lower (rl_line_buffer[i]);
- else if (lowercase_p (rl_line_buffer[i]))
- rl_line_buffer[i] = to_upper (rl_line_buffer[i]);
- }
- /* Move point to on top of the last character changed. */
- rl_point = (direction == 1) ? end - 1 : start;
- return (0);
-}
-
-
-
-
-
-
-
-Signals are asynchronous events sent to a process by the Unix kernel,
-sometimes on behalf of another process. They are intended to indicate
-exceptional events, like a user pressing the interrupt key on his
-terminal, or a network connection being broken. There is a class of
-signals that can be sent to the process currently reading input from
-the keyboard. Since Readline changes the terminal attributes when it
-is called, it needs to perform special processing when a signal is
-received to restore the terminal to a sane state, or provide application
-writers with functions to do so manually.
-
-
-
-Readline contains an internal signal handler that is installed for a
-number of signals (SIGINT
, SIGQUIT
, SIGTERM
,
-SIGALRM
, SIGTSTP
, SIGTTIN
, and SIGTTOU
).
-When one of these signals is received, the signal handler
-will reset the terminal attributes to those that were in effect before
-readline ()
was called, reset the signal handling to what it was
-before readline ()
was called, and resend the signal to the calling
-application.
-If and when the calling application's signal handler returns, Readline
-will reinitialize the terminal and continue to accept input.
-When a SIGINT
is received, the Readline signal handler performs
-some additional work, which will cause any partially-entered line to be
-aborted (see the description of rl_free_line_state ()
).
-
-
-
-There is an additional Readline signal handler, for SIGWINCH
, which
-the kernel sends to a process whenever the terminal's size changes (for
-example, if a user resizes an xterm
). The Readline SIGWINCH
-handler updates Readline's internal screen size state, and then calls any
-SIGWINCH
signal handler the calling application has installed.
-Readline calls the application's SIGWINCH
signal handler without
-resetting the terminal to its original state. If the application's signal
-handler does more than update its idea of the terminal size and return (for
-example, a longjmp
back to a main processing loop), it must
-call rl_cleanup_after_signal ()
(described below), to restore the
-terminal state.
-
-
-
-Readline provides two variables that allow application writers to
-control whether or not it will catch certain signals and act on them
-when they are received. It is important that applications change the
-values of these variables only when calling readline ()
, not in
-a signal handler, so Readline's internal signal state is not corrupted.
-
-
-
-
-- Variable: int rl_catch_signals
-
-
-If this variable is non-zero, Readline will install signal handlers for
-
SIGINT
, SIGQUIT
, SIGTERM
, SIGALRM
,
-SIGTSTP
, SIGTTIN
, and SIGTTOU
.
-
-
-
-The default value of rl_catch_signals
is 1.
-
-
-
-
-
-- Variable: int rl_catch_sigwinch
-
-
-If this variable is non-zero, Readline will install a signal handler for
-
SIGWINCH
.
-
-
-
-The default value of rl_catch_sigwinch
is 1.
-
-
-
-
-If an application does not wish to have Readline catch any signals, or
-to handle signals other than those Readline catches (SIGHUP
,
-for example),
-Readline provides convenience functions to do the necessary terminal
-and internal state cleanup upon receipt of a signal.
-
-
-
-
-- Function: void rl_cleanup_after_signal (void)
-
-
-This function will reset the state of the terminal to what it was before
-
readline ()
was called, and remove the Readline signal handlers for
-all signals, depending on the values of rl_catch_signals
and
-rl_catch_sigwinch
.
-
-
-
-
-
-- Function: void rl_free_line_state (void)
-
-
-This will free any partial state associated with the current input line
-(undo information, any partial history entry, any partially-entered
-keyboard macro, and any partially-entered numeric argument). This
-should be called before
rl_cleanup_after_signal ()
. The
-Readline signal handler for SIGINT
calls this to abort the
-current input line.
-
-
-
-
-
-- Function: void rl_reset_after_signal (void)
-
-
-This will reinitialize the terminal and reinstall any Readline signal
-handlers, depending on the values of
rl_catch_signals
and
-rl_catch_sigwinch
.
-
-
-
-
-If an application does not wish Readline to catch SIGWINCH
, it may
-call rl_resize_terminal ()
to force Readline to update its idea of
-the terminal size when a SIGWINCH
is received.
-
-
-
-
-- Function: void rl_resize_terminal (void)
-
-
-Update Readline's internal screen size.
-
-
-
-
-The following functions install and remove Readline's signal handlers.
-
-
-
-
-- Function: int rl_set_signals (void)
-
-
-Install Readline's signal handler for
SIGINT
, SIGQUIT
,
-SIGTERM
, SIGALRM
, SIGTSTP
, SIGTTIN
,
-SIGTTOU
, and SIGWINCH
, depending on the values of
-rl_catch_signals
and rl_catch_sigwinch
.
-
-
-
-
-
-- Function: int rl_clear_signals (void)
-
-
-Remove all of the Readline signal handlers installed by
-
rl_set_signals ()
.
-
-
-
-
-
-
-
-
-Typically, a program that reads commands from the user has a way of
-disambiguating commands and data. If your program is one of these, then
-it can provide completion for commands, data, or both.
-The following sections describe how your program and Readline
-cooperate to provide this service.
-
-
-
-
-
-
-
-
-
-
-In order to complete some text, the full list of possible completions
-must be available. That is, it is not possible to accurately
-expand a partial word without knowing all of the possible words
-which make sense in that context. The Readline library provides
-the user interface to completion, and two of the most common
-completion functions: filename and username. For completing other types
-of text, you must write your own completion function. This section
-describes exactly what such functions must do, and provides an example.
-
-
-
-There are three major functions used to perform completion:
-
-
-
-
--
-
-The user-interface function
rl_complete ()
. This function is
-called with the same arguments as other Readline
-functions intended for interactive use: count and
-invoking_key. It isolates the word to be completed and calls
-completion_matches ()
to generate a list of possible completions.
-It then either lists the possible completions, inserts the possible
-completions, or actually performs the
-completion, depending on which behavior is desired.
-
- -
-
-The internal function
completion_matches ()
uses your
-generator function to generate the list of possible matches, and
-then returns the array of these matches. You should place the address
-of your generator function in rl_completion_entry_function
.
-
- -
-
-The generator function is called repeatedly from
-
completion_matches ()
, returning a string each time. The
-arguments to the generator function are text and state.
-text is the partial word to be completed. state is zero the
-first time the function is called, allowing the generator to perform
-any necessary initialization, and a positive non-zero integer for
-each subsequent call. When the generator function returns
-(char *)NULL
this signals completion_matches ()
that there are
-no more possibilities left. Usually the generator function computes the
-list of possible completions when state is zero, and returns them
-one at a time on subsequent calls. Each string the generator function
-returns as a match must be allocated with malloc()
; Readline
-frees the strings when it has finished with them.
-
-
-
-
-
-- Function: int rl_complete (int ignore, int invoking_key)
-
-
-Complete the word at or before point. You have supplied the function
-that does the initial simple matching selection algorithm (see
-
completion_matches ()
). The default is to do filename completion.
-
-
-
-
-
-- Variable: Function * rl_completion_entry_function
-
-
-This is a pointer to the generator function for
completion_matches
-()
. If the value of rl_completion_entry_function
is
-(Function *)NULL
then the default filename generator function,
-filename_completion_function ()
, is used.
-
-
-
-
-
-
-
-
-Here is the complete list of callable completion functions present in
-Readline.
-
-
-
-
-- Function: int rl_complete_internal (int what_to_do)
-
-
-Complete the word at or before point. what_to_do says what to do
-with the completion. A value of `?' means list the possible
-completions. `TAB' means do standard completion. `*' means
-insert all of the possible completions. `!' means to display
-all of the possible completions, if there is more than one, as well as
-performing partial completion.
-
-
-
-
-
-- Function: int rl_complete (int ignore, int invoking_key)
-
-
-Complete the word at or before point. You have supplied the function
-that does the initial simple matching selection algorithm (see
-
completion_matches ()
and rl_completion_entry_function
).
-The default is to do filename
-completion. This calls rl_complete_internal ()
with an
-argument depending on invoking_key.
-
-
-
-
-
-- Function: int rl_possible_completions (int count, int invoking_key))
-
-
-List the possible completions. See description of
rl_complete
-()
. This calls rl_complete_internal ()
with an argument of
-`?'.
-
-
-
-
-
-- Function: int rl_insert_completions (int count, int invoking_key))
-
-
-Insert the list of possible completions into the line, deleting the
-partially-completed word. See description of
rl_complete ()
.
-This calls rl_complete_internal ()
with an argument of `*'.
-
-
-
-
-
-- Function: char ** completion_matches (char *text, CPFunction *entry_func)
-
-
-Returns an array of
(char *)
which is a list of completions for
-text. If there are no completions, returns (char **)NULL
.
-The first entry in the returned array is the substitution for text.
-The remaining entries are the possible completions. The array is
-terminated with a NULL
pointer.
-
-
-
-entry_func is a function of two args, and returns a
-(char *)
. The first argument is text. The second is a
-state argument; it is zero on the first call, and non-zero on subsequent
-calls. entry_func returns a NULL
pointer to the caller
-when there are no more matches.
-
-
-
-
-
-- Function: char * filename_completion_function (char *text, int state)
-
-
-A generator function for filename completion in the general case. Note
-that completion in Bash is a little different because of all
-the pathnames that must be followed when looking up completions for a
-command. The Bash source is a useful reference for writing custom
-completion functions.
-
-
-
-
-
-- Function: char * username_completion_function (char *text, int state)
-
-
-A completion generator for usernames. text contains a partial
-username preceded by a random character (usually `~'). As with all
-completion generators, state is zero on the first call and non-zero
-for subsequent calls.
-
-
-
-
-
-
-
-
-
-- Variable: Function * rl_completion_entry_function
-
-
-A pointer to the generator function for
completion_matches ()
.
-NULL
means to use filename_completion_function ()
, the default
-filename completer.
-
-
-
-
-
-- Variable: CPPFunction * rl_attempted_completion_function
-
-
-A pointer to an alternative function to create matches.
-The function is called with text, start, and end.
-start and end are indices in
rl_line_buffer
saying
-what the boundaries of text are. If this function exists and
-returns NULL
, or if this variable is set to NULL
, then
-rl_complete ()
will call the value of
-rl_completion_entry_function
to generate matches, otherwise the
-array of strings returned will be used.
-
-
-
-
-
-- Variable: CPFunction * rl_filename_quoting_function
-
-
-A pointer to a function that will quote a filename in an application-
-specific fashion. This is called if filename completion is being
-attempted and one of the characters in
rl_filename_quote_characters
-appears in a completed filename. The function is called with
-text, match_type, and quote_pointer. The text
-is the filename to be quoted. The match_type is either
-SINGLE_MATCH
, if there is only one completion match, or
-MULT_MATCH
. Some functions use this to decide whether or not to
-insert a closing quote character. The quote_pointer is a pointer
-to any opening quote character the user typed. Some functions choose
-to reset this character.
-
-
-
-
-
-- Variable: CPFunction * rl_filename_dequoting_function
-
-
-A pointer to a function that will remove application-specific quoting
-characters from a filename before completion is attempted, so those
-characters do not interfere with matching the text against names in
-the filesystem. It is called with text, the text of the word
-to be dequoted, and quote_char, which is the quoting character
-that delimits the filename (usually `'' or `"'). If
-quote_char is zero, the filename was not in an embedded string.
-
-
-
-
-
-- Variable: Function * rl_char_is_quoted_p
-
-
-A pointer to a function to call that determines whether or not a specific
-character in the line buffer is quoted, according to whatever quoting
-mechanism the program calling readline uses. The function is called with
-two arguments: text, the text of the line, and index, the
-index of the character in the line. It is used to decide whether a
-character found in
rl_completer_word_break_characters
should be
-used to break words for the completer.
-
-
-
-
-
-- Variable: int rl_completion_query_items
-
-
-Up to this many items will be displayed in response to a
-possible-completions call. After that, we ask the user if she is sure
-she wants to see them all. The default value is 100.
-
-
-
-
-
-- Variable: char * rl_basic_word_break_characters
-
-
-The basic list of characters that signal a break between words for the
-completer routine. The default value of this variable is the characters
-which break words for completion in Bash, i.e.,
-
" \t\n\"\\'`@$><=;|&{("
.
-
-
-
-
-
-- Variable: char * rl_basic_quote_characters
-
-
-List of quote characters which can cause a word break.
-
-
-
-
-
-- Variable: char * rl_completer_word_break_characters
-
-
-The list of characters that signal a break between words for
-
rl_complete_internal ()
. The default list is the value of
-rl_basic_word_break_characters
.
-
-
-
-
-
-- Variable: char * rl_completer_quote_characters
-
-
-List of characters which can be used to quote a substring of the line.
-Completion occurs on the entire substring, and within the substring
-
rl_completer_word_break_characters
are treated as any other character,
-unless they also appear within this list.
-
-
-
-
-
-- Variable: char * rl_filename_quote_characters
-
-
-A list of characters that cause a filename to be quoted by the completer
-when they appear in a completed filename. The default is the null string.
-
-
-
-
-
-- Variable: char * rl_special_prefixes
-
-
-The list of characters that are word break characters, but should be
-left in text when it is passed to the completion function.
-Programs can use this to help determine what kind of completing to do.
-For instance, Bash sets this variable to "$@" so that it can complete
-shell variables and hostnames.
-
-
-
-
-
-- Variable: int rl_completion_append_character
-
-
-When a single completion alternative matches at the end of the command
-line, this character is appended to the inserted completion text. The
-default is a space character (` '). Setting this to the null
-character (`\0') prevents anything being appended automatically.
-This can be changed in custom completion functions to
-provide the "most sensible word separator character" according to
-an application-specific command line syntax specification.
-
-
-
-
-
-- Variable: int rl_ignore_completion_duplicates
-
-
-If non-zero, then disallow duplicates in the matches. Default is 1.
-
-
-
-
-
-- Variable: int rl_filename_completion_desired
-
-
-Non-zero means that the results of the matches are to be treated as
-filenames. This is always zero on entry, and can only be changed
-within a completion entry generator function. If it is set to a non-zero
-value, directory names have a slash appended and Readline attempts to
-quote completed filenames if they contain any embedded word break
-characters.
-
-
-
-
-
-- Variable: int rl_filename_quoting_desired
-
-
-Non-zero means that the results of the matches are to be quoted using
-double quotes (or an application-specific quoting mechanism) if the
-completed filename contains any characters in
-
rl_filename_quote_chars
. This is always non-zero
-on entry, and can only be changed within a completion entry generator
-function. The quoting is effected via a call to the function pointed to
-by rl_filename_quoting_function
.
-
-
-
-
-
-- Variable: int rl_inhibit_completion
-
-
-If this variable is non-zero, completion is inhibit<ed. The completion
-character will be inserted as any other bound to
self-insert
.
-
-
-
-
-
-- Variable: Function * rl_ignore_some_completions_function
-
-
-This function, if defined, is called by the completer when real filename
-completion is done, after all the matching names have been generated.
-It is passed a
NULL
terminated array of matches.
-The first element (matches[0]
) is the
-maximal substring common to all matches. This function can
-re-arrange the list of matches as required, but each element deleted
-from the array must be freed.
-
-
-
-
-
-- Variable: Function * rl_directory_completion_hook
-
-
-This function, if defined, is allowed to modify the directory portion
-of filenames Readline completes. It is called with the address of a
-string (the current directory name) as an argument. It could be used
-to expand symbolic links or shell variables in pathnames.
-
-
-
-
-
-- Variable: VFunction * rl_completion_display_matches_hook
-
-
-If non-zero, then this is the address of a function to call when
-completing a word would normally display the list of possible matches.
-This function is called in lieu of Readline displaying the list.
-It takes three arguments:
-(
char **
matches, int
num_matches, int
max_length)
-where matches is the array of matching strings,
-num_matches is the number of strings in that array, and
-max_length is the length of the longest string in that array.
-Readline provides a convenience function, rl_display_match_list
,
-that takes care of doing the display to Readline's output stream. That
-function may be called from this hook.
-
-
-
-
-
-
-
-
-Here is a small application demonstrating the use of the GNU Readline
-library. It is called fileman
, and the source code resides in
-`examples/fileman.c'. This sample application provides
-completion of command names, line editing features, and access to the
-history list.
-
-
-
-
-/* fileman.c -- A tiny application which demonstrates how to use the
- GNU Readline library. This application interactively allows users
- to manipulate files and their modes. */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-
-#include <readline/readline.h>
-#include <readline/history.h>
-
-extern char *getwd ();
-extern char *xmalloc ();
-
-/* The names of functions that actually do the manipulation. */
-int com_list (), com_view (), com_rename (), com_stat (), com_pwd ();
-int com_delete (), com_help (), com_cd (), com_quit ();
-
-/* A structure which contains information on the commands this program
- can understand. */
-
-typedef struct {
- char *name; /* User printable name of the function. */
- Function *func; /* Function to call to do the job. */
- char *doc; /* Documentation for this function. */
-} COMMAND;
-
-COMMAND commands[] = {
- { "cd", com_cd, "Change to directory DIR" },
- { "delete", com_delete, "Delete FILE" },
- { "help", com_help, "Display this text" },
- { "?", com_help, "Synonym for `help'" },
- { "list", com_list, "List files in DIR" },
- { "ls", com_list, "Synonym for `list'" },
- { "pwd", com_pwd, "Print the current working directory" },
- { "quit", com_quit, "Quit using Fileman" },
- { "rename", com_rename, "Rename FILE to NEWNAME" },
- { "stat", com_stat, "Print out statistics on FILE" },
- { "view", com_view, "View the contents of FILE" },
- { (char *)NULL, (Function *)NULL, (char *)NULL }
-};
-
-/* Forward declarations. */
-char *stripwhite ();
-COMMAND *find_command ();
-
-/* The name of this program, as taken from argv[0]. */
-char *progname;
-
-/* When non-zero, this global means the user is done using this program. */
-int done;
-
-char *
-dupstr (s)
- int s;
-{
- char *r;
-
- r = xmalloc (strlen (s) + 1);
- strcpy (r, s);
- return (r);
-}
-
-main (argc, argv)
- int argc;
- char **argv;
-{
- char *line, *s;
-
- progname = argv[0];
-
- initialize_readline (); /* Bind our completer. */
-
- /* Loop reading and executing lines until the user quits. */
- for ( ; done == 0; )
- {
- line = readline ("FileMan: ");
-
- if (!line)
- break;
-
- /* Remove leading and trailing whitespace from the line.
- Then, if there is anything left, add it to the history list
- and execute it. */
- s = stripwhite (line);
-
- if (*s)
- {
- add_history (s);
- execute_line (s);
- }
-
- free (line);
- }
- exit (0);
-}
-
-/* Execute a command line. */
-int
-execute_line (line)
- char *line;
-{
- register int i;
- COMMAND *command;
- char *word;
-
- /* Isolate the command word. */
- i = 0;
- while (line[i] && whitespace (line[i]))
- i++;
- word = line + i;
-
- while (line[i] && !whitespace (line[i]))
- i++;
-
- if (line[i])
- line[i++] = '\0';
-
- command = find_command (word);
-
- if (!command)
- {
- fprintf (stderr, "%s: No such command for FileMan.\n", word);
- return (-1);
- }
-
- /* Get argument to command, if any. */
- while (whitespace (line[i]))
- i++;
-
- word = line + i;
-
- /* Call the function. */
- return ((*(command->func)) (word));
-}
-
-/* Look up NAME as the name of a command, and return a pointer to that
- command. Return a NULL pointer if NAME isn't a command name. */
-COMMAND *
-find_command (name)
- char *name;
-{
- register int i;
-
- for (i = 0; commands[i].name; i++)
- if (strcmp (name, commands[i].name) == 0)
- return (&commands[i]);
-
- return ((COMMAND *)NULL);
-}
-
-/* Strip whitespace from the start and end of STRING. Return a pointer
- into STRING. */
-char *
-stripwhite (string)
- char *string;
-{
- register char *s, *t;
-
- for (s = string; whitespace (*s); s++)
- ;
-
- if (*s == 0)
- return (s);
-
- t = s + strlen (s) - 1;
- while (t > s && whitespace (*t))
- t--;
- *++t = '\0';
-
- return s;
-}
-
-/* **************************************************************** */
-/* */
-/* Interface to Readline Completion */
-/* */
-/* **************************************************************** */
-
-char *command_generator ();
-char **fileman_completion ();
-
-/* Tell the GNU Readline library how to complete. We want to try to complete
- on command names if this is the first word in the line, or on filenames
- if not. */
-initialize_readline ()
-{
- /* Allow conditional parsing of the ~/.inputrc file. */
- rl_readline_name = "FileMan";
-
- /* Tell the completer that we want a crack first. */
- rl_attempted_completion_function = (CPPFunction *)fileman_completion;
-}
-
-/* Attempt to complete on the contents of TEXT. START and END bound the
- region of rl_line_buffer that contains the word to complete. TEXT is
- the word to complete. We can use the entire contents of rl_line_buffer
- in case we want to do some simple parsing. Return the array of matches,
- or NULL if there aren't any. */
-char **
-fileman_completion (text, start, end)
- char *text;
- int start, end;
-{
- char **matches;
-
- matches = (char **)NULL;
-
- /* If this word is at the start of the line, then it is a command
- to complete. Otherwise it is the name of a file in the current
- directory. */
- if (start == 0)
- matches = completion_matches (text, command_generator);
-
- return (matches);
-}
-
-/* Generator function for command completion. STATE lets us know whether
- to start from scratch; without any state (i.e. STATE == 0), then we
- start at the top of the list. */
-char *
-command_generator (text, state)
- char *text;
- int state;
-{
- static int list_index, len;
- char *name;
-
- /* If this is a new word to complete, initialize now. This includes
- saving the length of TEXT for efficiency, and initializing the index
- variable to 0. */
- if (!state)
- {
- list_index = 0;
- len = strlen (text);
- }
-
- /* Return the next name which partially matches from the command list. */
- while (name = commands[list_index].name)
- {
- list_index++;
-
- if (strncmp (name, text, len) == 0)
- return (dupstr(name));
- }
-
- /* If no names matched, then return NULL. */
- return ((char *)NULL);
-}
-
-/* **************************************************************** */
-/* */
-/* FileMan Commands */
-/* */
-/* **************************************************************** */
-
-/* String to pass to system (). This is for the LIST, VIEW and RENAME
- commands. */
-static char syscom[1024];
-
-/* List the file(s) named in arg. */
-com_list (arg)
- char *arg;
-{
- if (!arg)
- arg = "";
-
- sprintf (syscom, "ls -FClg %s", arg);
- return (system (syscom));
-}
-
-com_view (arg)
- char *arg;
-{
- if (!valid_argument ("view", arg))
- return 1;
-
- sprintf (syscom, "more %s", arg);
- return (system (syscom));
-}
-
-com_rename (arg)
- char *arg;
-{
- too_dangerous ("rename");
- return (1);
-}
-
-com_stat (arg)
- char *arg;
-{
- struct stat finfo;
-
- if (!valid_argument ("stat", arg))
- return (1);
-
- if (stat (arg, &finfo) == -1)
- {
- perror (arg);
- return (1);
- }
-
- printf ("Statistics for `%s':\n", arg);
-
- printf ("%s has %d link%s, and is %d byte%s in length.\n", arg,
- finfo.st_nlink,
- (finfo.st_nlink == 1) ? "" : "s",
- finfo.st_size,
- (finfo.st_size == 1) ? "" : "s");
- printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime));
- printf (" Last access at: %s", ctime (&finfo.st_atime));
- printf (" Last modified at: %s", ctime (&finfo.st_mtime));
- return (0);
-}
-
-com_delete (arg)
- char *arg;
-{
- too_dangerous ("delete");
- return (1);
-}
-
-/* Print out help for ARG, or for all of the commands if ARG is
- not present. */
-com_help (arg)
- char *arg;
-{
- register int i;
- int printed = 0;
-
- for (i = 0; commands[i].name; i++)
- {
- if (!*arg || (strcmp (arg, commands[i].name) == 0))
- {
- printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc);
- printed++;
- }
- }
-
- if (!printed)
- {
- printf ("No commands match `%s'. Possibilties are:\n", arg);
-
- for (i = 0; commands[i].name; i++)
- {
- /* Print in six columns. */
- if (printed == 6)
- {
- printed = 0;
- printf ("\n");
- }
-
- printf ("%s\t", commands[i].name);
- printed++;
- }
-
- if (printed)
- printf ("\n");
- }
- return (0);
-}
-
-/* Change to the directory ARG. */
-com_cd (arg)
- char *arg;
-{
- if (chdir (arg) == -1)
- {
- perror (arg);
- return 1;
- }
-
- com_pwd ("");
- return (0);
-}
-
-/* Print out the current working directory. */
-com_pwd (ignore)
- char *ignore;
-{
- char dir[1024], *s;
-
- s = getwd (dir);
- if (s == 0)
- {
- printf ("Error getting pwd: %s\n", dir);
- return 1;
- }
-
- printf ("Current directory is %s\n", dir);
- return 0;
-}
-
-/* The user wishes to quit using this program. Just set DONE non-zero. */
-com_quit (arg)
- char *arg;
-{
- done = 1;
- return (0);
-}
-
-/* Function which tells you that you can't do this. */
-too_dangerous (caller)
- char *caller;
-{
- fprintf (stderr,
- "%s: Too dangerous for me to distribute. Write it yourself.\n",
- caller);
-}
-
-/* Return non-zero if ARG is a valid argument for CALLER, else print
- an error message and return zero. */
-int
-valid_argument (caller, arg)
- char *caller, *arg;
-{
- if (!arg || !*arg)
- {
- fprintf (stderr, "%s: Argument required.\n", caller);
- return (0);
- }
-
- return (1);
-}
-
-
-
-
-
-
-Jump to:
-c
--
-e
--
-i
--
-k
--
-n
--
-r
--
-y
-
-
-
-command editing
-
-
-
-editing command lines
-
-
-
-initialization file, readline
-interaction, readline
-
-
-
-kill ring
-killing text
-
-
-
-notation, readline
-
-
-
-readline, function
-
-
-
-yanking text
-
-
-
-
-
-
-
-Jump to:
-a
--
-b
--
-c
--
-d
--
-e
--
-f
--
-h
--
-i
--
-k
--
-l
--
-m
--
-n
--
-o
--
-p
--
-q
--
-r
--
-s
--
-t
--
-u
--
-v
--
-y
-
-
-
-abort (C-g)
-accept-line (Newline, Return)
-alphabetic
-
-
-
-backward-char (C-b)
-backward-delete-char (Rubout)
-backward-kill-line (C-x Rubout)
-backward-kill-word (M-DEL)
-backward-word (M-b)
-beginning-of-history (M-<)
-beginning-of-line (C-a)
-bell-style
-
-
-
-call-last-kbd-macro (C-x e)
-capitalize-word (M-c)
-character-search (C-])
-character-search-backward (M-C-])
-clear-screen (C-l)
-comment-begin
-complete (TAB)
-completion-query-items
-completion_matches
-convert-meta
-copy-backward-word ()
-copy-forward-word ()
-copy-region-as-kill ()
-
-
-
-delete-char (C-d)
-delete-char-or-list ()
-delete-horizontal-space ()
-digit-argument (M-0, M-1, ... M--)
-digit_p
-digit_value
-ding
-disable-completion
-do-uppercase-version (M-a, M-b, M-x, ...)
-downcase-word (M-l)
-dump-functions ()
-dump-macros ()
-dump-variables ()
-
-
-
-editing-mode
-enable-keypad
-end-kbd-macro (C-x ))
-end-of-history (M->)
-end-of-line (C-e)
-exchange-point-and-mark (C-x C-x)
-expand-tilde
-
-
-
-filename_completion_function
-forward-backward-delete-char ()
-forward-char (C-f)
-forward-search-history (C-s)
-forward-word (M-f)
-free_undo_list
-
-
-
-history-search-backward ()
-history-search-forward ()
-horizontal-scroll-mode
-
-
-
-input-meta
-insert-comment (M-#)
-insert-completions (M-*)
-isearch-terminators
-
-
-
-keymap
-kill-line (C-k)
-kill-region ()
-kill-whole-line ()
-kill-word (M-d)
-
-
-
-lowercase_p
-
-
-
-mark-modified-lines
-menu-complete ()
-meta-flag
-
-
-
-next-history (C-n)
-non-incremental-forward-search-history (M-n)
-non-incremental-reverse-search-history (M-p)
-numeric
-
-
-
-output-meta
-
-
-
-possible-completions (M-?)
-prefix-meta (ESC)
-previous-history (C-p)
-
-
-
-quoted-insert (C-q, C-v)
-
-
-
-re-read-init-file (C-x C-r)
-readline
-redraw-current-line ()
-reverse-search-history (C-r)
-revert-line (M-r)
-rl_add_defun
-rl_add_undo
-rl_already_prompted
-rl_attempted_completion_function
-rl_basic_quote_characters
-rl_basic_word_break_characters
-rl_begin_undo_group
-rl_bind_key
-rl_bind_key_in_map
-rl_binding_keymap
-rl_callback_handler_install
-rl_callback_handler_remove
-rl_callback_read_char
-rl_catch_signals
-rl_catch_sigwinch
-rl_char_is_quoted_p
-rl_cleanup_after_signal
-rl_clear_message
-rl_clear_signals
-rl_complete, rl_complete
-rl_complete_internal
-rl_completer_quote_characters
-rl_completer_word_break_characters
-rl_completion_append_character
-rl_completion_display_matches_hook
-rl_completion_entry_function, rl_completion_entry_function
-rl_completion_query_items
-rl_copy_keymap
-rl_copy_text
-rl_delete_text
-rl_directory_completion_hook
-rl_discard_keymap
-rl_display_match_list
-rl_do_undo
-rl_done
-rl_end
-rl_end_undo_group
-rl_erase_empty_line
-rl_event_hook
-rl_executing_keymap
-rl_extend_line_buffer
-rl_filename_completion_desired
-rl_filename_dequoting_function
-rl_filename_quote_characters
-rl_filename_quoting_desired
-rl_filename_quoting_function
-rl_forced_update_display
-rl_free_line_state
-rl_function_dumper
-rl_function_of_keyseq
-rl_funmap_names
-rl_generic_bind
-rl_get_keymap
-rl_get_keymap_by_name
-rl_get_keymap_name
-rl_getc
-rl_getc_function
-rl_ignore_completion_duplicates
-rl_ignore_some_completions_function
-rl_inhibit_completion
-rl_initialize
-rl_insert_completions
-rl_insert_text
-rl_instream
-rl_invoking_keyseqs
-rl_invoking_keyseqs_in_map
-rl_kill_text
-rl_library_version
-rl_line_buffer
-rl_list_funmap_names
-rl_make_bare_keymap
-rl_make_keymap
-rl_mark
-rl_message
-rl_modifying
-rl_named_function
-rl_on_new_line
-rl_on_new_line_with_prompt
-rl_outstream
-rl_parse_and_bind
-rl_pending_input
-rl_point
-rl_possible_completions
-rl_pre_input_hook
-rl_prompt
-rl_read_init_file
-rl_read_key
-rl_readline_name
-rl_redisplay
-rl_redisplay_function
-rl_reset_after_signal
-rl_reset_line_state
-rl_reset_terminal
-rl_resize_terminal
-rl_restore_prompt
-rl_save_prompt
-rl_set_keymap
-rl_set_signals
-rl_special_prefixes
-rl_startup_hook
-rl_stuff_char
-rl_terminal_name
-rl_unbind_command_in_map
-rl_unbind_function_in_map
-rl_unbind_key
-rl_unbind_key_in_map
-
-
-
-self-insert (a, b, A, 1, !, ...)
-set-mark (C-@)
-show-all-if-ambiguous
-start-kbd-macro (C-x ()
-
-
-
-tab-insert (M-TAB)
-tilde-expand (M-~)
-to_lower
-to_upper
-transpose-chars (C-t)
-transpose-words (M-t)
-
-
-
-undo (C-_, C-x C-u)
-universal-argument ()
-unix-line-discard (C-u)
-unix-word-rubout (C-w)
-upcase-word (M-u)
-uppercase_p
-username_completion_function
-
-
-
-visible-stats
-
-
-
-yank (C-y)
-yank-last-arg (M-., M-_)
-yank-nth-arg (M-C-y)
-yank-pop (M-y)
-
-
-
-
-This document was generated on 1 March 2000 using the
-texi2html
-translator version 1.52.
-
-
diff --git a/readline/doc/readline.info b/readline/doc/readline.info
deleted file mode 100644
index ae6767f..0000000
--- a/readline/doc/readline.info
+++ /dev/null
@@ -1,3107 +0,0 @@
-This is Info file readline.info, produced by Makeinfo version 1.68 from
-the input file /usr/homes/chet/src/bash/readline-src/doc/rlman.texinfo.
-
-INFO-DIR-SECTION Libraries
-START-INFO-DIR-ENTRY
-* Readline: (readline). The GNU readline library API
-END-INFO-DIR-ENTRY
-
- This document describes the GNU Readline Library, a utility which
-aids in the consistency of user interface across discrete programs that
-need to provide a command line interface.
-
- Copyright (C) 1988-1999 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice pare
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-
-File: readline.info, Node: Top, Next: Command Line Editing, Up: (dir)
-
-GNU Readline Library
-********************
-
- This document describes the GNU Readline Library, a utility which
-aids in the consistency of user interface across discrete programs that
-need to provide a command line interface.
-
-* Menu:
-
-* Command Line Editing:: GNU Readline User's Manual.
-* Programming with GNU Readline:: GNU Readline Programmer's Manual.
-* Concept Index:: Index of concepts described in this manual.
-* Function and Variable Index:: Index of externally visible functions
- and variables.
-
-
-File: readline.info, Node: Command Line Editing, Next: Programming with GNU Readline, Prev: Top, Up: Top
-
-Command Line Editing
-********************
-
- This chapter describes the basic features of the GNU command line
-editing interface.
-
-* Menu:
-
-* Introduction and Notation:: Notation used in this text.
-* Readline Interaction:: The minimum set of commands for editing a line.
-* Readline Init File:: Customizing Readline from a user's view.
-* Bindable Readline Commands:: A description of most of the Readline commands
- available for binding
-* Readline vi Mode:: A short description of how to make Readline
- behave like the vi editor.
-
-
-File: readline.info, Node: Introduction and Notation, Next: Readline Interaction, Up: Command Line Editing
-
-Introduction to Line Editing
-============================
-
- The following paragraphs describe the notation used to represent
-keystrokes.
-
- The text is read as `Control-K' and describes the character
-produced when the key is pressed while the Control key is depressed.
-
- The text is read as `Meta-K' and describes the character
-produced when the Meta key (if you have one) is depressed, and the
-key is pressed. The Meta key is labeled on many keyboards. On
-keyboards with two keys labeled (usually to either side of the
-space bar), the on the left side is generally set to work as a
-Meta key. The key on the right may also be configured to work as
-a Meta key or may be configured as some other modifier, such as a
-Compose key for typing accented characters.
-
- If you do not have a Meta or key, or another key working as a
-Meta key, the identical keystroke can be generated by typing
-first, and then typing . Either process is known as "metafying" the
- key.
-
- The text is read as `Meta-Control-k' and describes the
-character produced by "metafying" .
-
- In addition, several keys have their own names. Specifically,
-, , , , , and all stand for themselves
-when seen in this text, or in an init file (*note Readline Init
-File::.). If your keyboard lacks a key, typing will
-produce the desired character. The key may be labeled
-or on some keyboards.
-
-
-File: readline.info, Node: Readline Interaction, Next: Readline Init File, Prev: Introduction and Notation, Up: Command Line Editing
-
-Readline Interaction
-====================
-
- Often during an interactive session you type in a long line of text,
-only to notice that the first word on the line is misspelled. The
-Readline library gives you a set of commands for manipulating the text
-as you type it in, allowing you to just fix your typo, and not forcing
-you to retype the majority of the line. Using these editing commands,
-you move the cursor to the place that needs correction, and delete or
-insert the text of the corrections. Then, when you are satisfied with
-the line, you simply press . You do not have to be at the end
-of the line to press ; the entire line is accepted regardless
-of the location of the cursor within the line.
-
-* Menu:
-
-* Readline Bare Essentials:: The least you need to know about Readline.
-* Readline Movement Commands:: Moving about the input line.
-* Readline Killing Commands:: How to delete text, and how to get it back!
-* Readline Arguments:: Giving numeric arguments to commands.
-* Searching:: Searching through previous lines.
-
-
-File: readline.info, Node: Readline Bare Essentials, Next: Readline Movement Commands, Up: Readline Interaction
-
-Readline Bare Essentials
-------------------------
-
- In order to enter characters into the line, simply type them. The
-typed character appears where the cursor was, and then the cursor moves
-one space to the right. If you mistype a character, you can use your
-erase character to back up and delete the mistyped character.
-
- Sometimes you may mistype a character, and not notice the error
-until you have typed several other characters. In that case, you can
-type to move the cursor to the left, and then correct your
-mistake. Afterwards, you can move the cursor to the right with .
-
- When you add text in the middle of a line, you will notice that
-characters to the right of the cursor are `pushed over' to make room
-for the text that you have inserted. Likewise, when you delete text
-behind the cursor, characters to the right of the cursor are `pulled
-back' to fill in the blank space created by the removal of the text. A
-list of the bare essentials for editing the text of an input line
-follows.
-
-
- Move back one character.
-
-
- Move forward one character.
-
- or
- Delete the character to the left of the cursor.
-
-
- Delete the character underneath the cursor.
-
-Printing characters
- Insert the character into the line at the cursor.
-
- or
- Undo the last editing command. You can undo all the way back to an
- empty line.
-
-(Depending on your configuration, the key be set to delete
-the character to the left of the cursor and the key set to delete
-the character underneath the cursor, like , rather than the
-character to the left of the cursor.)
-
-
-File: readline.info, Node: Readline Movement Commands, Next: Readline Killing Commands, Prev: Readline Bare Essentials, Up: Readline Interaction
-
-Readline Movement Commands
---------------------------
-
- The above table describes the most basic keystrokes that you need in
-order to do editing of the input line. For your convenience, many
-other commands have been added in addition to , , , and
-. Here are some commands for moving more rapidly about the line.
-
-
- Move to the start of the line.
-
-
- Move to the end of the line.
-
-
- Move forward a word, where a word is composed of letters and
- digits.
-
-
- Move backward a word.
-
-
- Clear the screen, reprinting the current line at the top.
-
- Notice how moves forward a character, while moves
-forward a word. It is a loose convention that control keystrokes
-operate on characters while meta keystrokes operate on words.
-
-
-File: readline.info, Node: Readline Killing Commands, Next: Readline Arguments, Prev: Readline Movement Commands, Up: Readline Interaction
-
-Readline Killing Commands
--------------------------
-
- "Killing" text means to delete the text from the line, but to save
-it away for later use, usually by "yanking" (re-inserting) it back into
-the line. (`Cut' and `paste' are more recent jargon for `kill' and
-`yank'.)
-
- If the description for a command says that it `kills' text, then you
-can be sure that you can get the text back in a different (or the same)
-place later.
-
- When you use a kill command, the text is saved in a "kill-ring".
-Any number of consecutive kills save all of the killed text together, so
-that when you yank it back, you get it all. The kill ring is not line
-specific; the text that you killed on a previously typed line is
-available to be yanked back later, when you are typing another line.
-
- Here is the list of commands for killing text.
-
-
- Kill the text from the current cursor position to the end of the
- line.
-
-
- Kill from the cursor to the end of the current word, or, if between
- words, to the end of the next word. Word boundaries are the same
- as those used by .
-
-
- Kill from the cursor the start of the previous word, or, if between
- words, to the start of the previous word. Word boundaries are the
- same as those used by .
-
-
- Kill from the cursor to the previous whitespace. This is
- different than because the word boundaries differ.
-
- Here is how to "yank" the text back into the line. Yanking means to
-copy the most-recently-killed text from the kill buffer.
-
-
- Yank the most recently killed text back into the buffer at the
- cursor.
-
-
- Rotate the kill-ring, and yank the new top. You can only do this
- if the prior command is or .
-
-
-File: readline.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction
-
-Readline Arguments
-------------------
-
- You can pass numeric arguments to Readline commands. Sometimes the
-argument acts as a repeat count, other times it is the sign of the
-argument that is significant. If you pass a negative argument to a
-command which normally acts in a forward direction, that command will
-act in a backward direction. For example, to kill text back to the
-start of the line, you might type `M-- C-k'.
-
- The general way to pass numeric arguments to a command is to type
-meta digits before the command. If the first `digit' typed is a minus
-sign (`-'), then the sign of the argument will be negative. Once you
-have typed one meta digit to get the argument started, you can type the
-remainder of the digits, and then the command. For example, to give
-the