import gdb-1999-08-02 snapshot
This commit is contained in:
parent
c95b01a9b0
commit
c862e87b3e
57 changed files with 3687 additions and 1596 deletions
|
@ -75,3 +75,142 @@ examples/Makefile.in
|
||||||
---
|
---
|
||||||
configure.in
|
configure.in
|
||||||
- bumped LIBVERSION up to 2.2
|
- bumped LIBVERSION up to 2.2
|
||||||
|
|
||||||
|
4/18
|
||||||
|
----
|
||||||
|
[readline-2.2 released]
|
||||||
|
|
||||||
|
4/20
|
||||||
|
----
|
||||||
|
Makefile.in
|
||||||
|
- make `libhistory.a' a dependency of `install'
|
||||||
|
- fixed a typo in the recipe for `install' that copied libreadline.a
|
||||||
|
to libhistory.old right after installing it
|
||||||
|
|
||||||
|
4/27
|
||||||
|
----
|
||||||
|
doc/Makefile.in
|
||||||
|
- install {readline,history}.info out of the source directory if
|
||||||
|
they are not found in the current (build) directory -- only an
|
||||||
|
issue if the libraries are built in a different directory than
|
||||||
|
the source directory
|
||||||
|
|
||||||
|
5/1
|
||||||
|
---
|
||||||
|
support/shobj-conf
|
||||||
|
- script from the bash distribution to do shared object and library
|
||||||
|
configuration
|
||||||
|
|
||||||
|
shlib/Makefile.in
|
||||||
|
- new directory and makefile to handle building shared versions of
|
||||||
|
libreadline and libhistory, controlled by support/shobj-conf
|
||||||
|
|
||||||
|
5/7
|
||||||
|
---
|
||||||
|
doc/Makefile.in
|
||||||
|
- set SHELL to /bin/sh, rather than relying on make to be correct
|
||||||
|
|
||||||
|
5/14
|
||||||
|
----
|
||||||
|
savestring.c
|
||||||
|
- new file, moved from shell.c, for backwards compatibility
|
||||||
|
|
||||||
|
Makefile.in, shlib/Makefile.in
|
||||||
|
- make sure savestring.c is compiled and added to libreadline and
|
||||||
|
libhistory
|
||||||
|
|
||||||
|
[THERE ARE NO MORE #ifdef SHELL LINES IN THE C SOURCE FILES.]
|
||||||
|
|
||||||
|
5/15
|
||||||
|
----
|
||||||
|
README
|
||||||
|
- updated description of shared library creation for the new scheme
|
||||||
|
|
||||||
|
[THERE ARE NO MORE #ifdef SHELL LINES IN ANY OF THE SOURCE FILES.]
|
||||||
|
|
||||||
|
Makefile.in
|
||||||
|
- bumped SHLIB_MAJOR up to 4 since we've augmented the library
|
||||||
|
API
|
||||||
|
- rlconf.h is now one of the installed headers, so applications can
|
||||||
|
find out whether things like vi-mode are available in the installed
|
||||||
|
libreadline
|
||||||
|
|
||||||
|
5/20
|
||||||
|
----
|
||||||
|
configure.in
|
||||||
|
- changed RL_LIBRARY_VERSION to 4.0 to match the version of the
|
||||||
|
installed shared libraries
|
||||||
|
|
||||||
|
6/5
|
||||||
|
---
|
||||||
|
rlstdc.h
|
||||||
|
- new file
|
||||||
|
|
||||||
|
Makefile.in
|
||||||
|
- rlstdc.h is now one of the installed headers
|
||||||
|
|
||||||
|
8/3
|
||||||
|
---
|
||||||
|
shlib/Makefile.in
|
||||||
|
- made the suffix rule that creates xx.so from xx.c write the
|
||||||
|
compiler output to `a.o', which is then mv'd to xx.so, because
|
||||||
|
some compilers (Sun WSpro 4.2, for example) don't allow any
|
||||||
|
suffixes other than `.o' for `cc -c' (not even `a.out')
|
||||||
|
|
||||||
|
9/15
|
||||||
|
----
|
||||||
|
|
||||||
|
Makefile.in
|
||||||
|
- AR and ARFLAGS are now substituted by configure, used in recipes
|
||||||
|
that build the libraries
|
||||||
|
|
||||||
|
configure.in
|
||||||
|
- use AC_CHECK_PROG to check for ar
|
||||||
|
- set ARFLAGS if it has not already been set in the environment
|
||||||
|
|
||||||
|
10/5
|
||||||
|
----
|
||||||
|
Makefile.in
|
||||||
|
- removed savestring.o from object file list
|
||||||
|
|
||||||
|
10/28
|
||||||
|
-----
|
||||||
|
shlib/Makefile.in
|
||||||
|
- don't use a fixed filename in the .c.so suffix rule to avoid
|
||||||
|
problems with parallel makes
|
||||||
|
|
||||||
|
12/21
|
||||||
|
-----
|
||||||
|
support/shlib-install
|
||||||
|
- new script to install shared readline and history libraries
|
||||||
|
|
||||||
|
shlib/Makefile.in
|
||||||
|
- changed to call shlib-install for install and uninstall targets
|
||||||
|
|
||||||
|
[readline-4.0-beta1 frozen]
|
||||||
|
|
||||||
|
12/22
|
||||||
|
-----
|
||||||
|
configure.in
|
||||||
|
- call AC_SUBST for SHOBJ_XLDFLAGS and SHLIB_LIBS
|
||||||
|
|
||||||
|
shlib/Makefile.in
|
||||||
|
- SHOBJ_XLDFLAGS and SHLIB_LIBS are now substituted by configure
|
||||||
|
- add $(SHLIB_LIBS) at end of command line that builds the shared
|
||||||
|
libraries (currently needed only by AIX 4.2)
|
||||||
|
|
||||||
|
12/31
|
||||||
|
-----
|
||||||
|
MANIFEST, MANIFEST.doc
|
||||||
|
- the TOC html files are no longer generated and no longer part of
|
||||||
|
the distribution
|
||||||
|
|
||||||
|
2/18/1999
|
||||||
|
---------
|
||||||
|
configure.in
|
||||||
|
- set MAKE_SHELL to /bin/sh and substitute into the Makefiles
|
||||||
|
|
||||||
|
Makefile.in,{doc,examples,shlib}/Makefile.in
|
||||||
|
- set SHELL from @MAKE_SHELL@
|
||||||
|
|
||||||
|
[readline-4.0 released]
|
||||||
|
|
131
readline/CHANGES
131
readline/CHANGES
|
@ -1,22 +1,131 @@
|
||||||
This document details the changes between this version, readline-2.2.1,
|
This document details the changes between this version, readline-4.0,
|
||||||
and the previous version, readline-2.2.
|
and the previous version, readline-2.2.
|
||||||
|
|
||||||
1. Changes to Readline
|
1. Changes to Readline
|
||||||
|
|
||||||
a. The `make install' target was corrected so that it did not move the
|
a. The version number is now 4.0, to match the major and minor version
|
||||||
newly-installed libreadline.a to libhistory.old
|
numbers on the shared readline and history libraries. Future
|
||||||
|
releases will maintain the identical numbering.
|
||||||
|
|
||||||
b. The `make install' target for the documentation will now install the
|
b. Fixed a typo in the `make install' recipe that copied libreadline.a
|
||||||
info files from the source directory if they do not appear in the
|
to libhistory.old right after installing it.
|
||||||
build directory, since they are shipped in the readline tar file.
|
|
||||||
|
|
||||||
c. Fixed a problem with redisplay that showed up when the prompt string was
|
c. The readline and history info files are now installed out of the source
|
||||||
longer than the screen width and the prompt contained invisible characters.
|
directory if they are not found in the build directory.
|
||||||
|
|
||||||
d. Fixed a problem with the paren matching code -- the blink was far too
|
d. The library no longer exports a function named `savestring' -- backwards
|
||||||
short (it's specified in microseconds, not milliseconds, Chet!).
|
compatibility be damned.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
e. There is no longer any #ifdef SHELL code in the source files.
|
||||||
|
|
||||||
|
f. Some changes were made to the key binding code to fix memory leaks and
|
||||||
|
better support Win32 systems.
|
||||||
|
|
||||||
|
g. Fixed a silly typo in the paren matching code -- it's microseconds, not
|
||||||
|
milliseconds.
|
||||||
|
|
||||||
|
h. The readline library should be compilable by C++ compilers.
|
||||||
|
|
||||||
|
i. The readline.h public header file now includes function prototypes for
|
||||||
|
all readline functions, and some changes were made to fix errors in the
|
||||||
|
source files uncovered by the use of prototypes.
|
||||||
|
|
||||||
|
j. The maximum numeric argument is now clamped at 1000000.
|
||||||
|
|
||||||
|
k. Fixes to rl_yank_last_arg to make it behave better.
|
||||||
|
|
||||||
|
l. Fixed a bug in the display code that caused core dumps if the prompt
|
||||||
|
string length exceeded 1024 characters.
|
||||||
|
|
||||||
|
m. The menu completion code was fixed to properly insert a single completion
|
||||||
|
if there is only one match.
|
||||||
|
|
||||||
|
n. A bug was fixed that caused the display code to improperly display tabs
|
||||||
|
after newlines.
|
||||||
|
|
||||||
|
o. A fix was made to the completion code in which a typo caused the wrong
|
||||||
|
value to be passed to the function that computed the longest common
|
||||||
|
prefix of the list of matches.
|
||||||
|
|
||||||
|
p. The completion code now checks the value of rl_filename_completion_desired,
|
||||||
|
which is set by application-supplied completion functions to indicate
|
||||||
|
that filename completion is being performed, to decide whether or not to
|
||||||
|
call an application-supplied `ignore completions' function.
|
||||||
|
|
||||||
|
q. Code was added to the history library to catch history substitutions
|
||||||
|
using `&' without a previous history substitution or search having been
|
||||||
|
performed.
|
||||||
|
|
||||||
|
|
||||||
|
2. New Features in Readline
|
||||||
|
|
||||||
|
a. There is a new script, support/shobj-conf, to do system-specific shared
|
||||||
|
object and library configuration. It generates variables for configure
|
||||||
|
to substitute into makefiles. The README file provides a detailed
|
||||||
|
explanation of the shared library creation process.
|
||||||
|
|
||||||
|
b. Shared libraries and objects are now built in the `shlib' subdirectory.
|
||||||
|
There is a shlib/Makefile.in to control the build process. `make shared'
|
||||||
|
from the top-level directory is still the right way to build shared
|
||||||
|
versions of the libraries.
|
||||||
|
|
||||||
|
c. rlconf.h is now installed, so applications can find out which features
|
||||||
|
have been compiled into the installed readline and history libraries.
|
||||||
|
|
||||||
|
d. rlstdc.h is now an installed header file.
|
||||||
|
|
||||||
|
e. Many changes to the signal handling:
|
||||||
|
o Readline now catches SIGQUIT and cleans up the tty before returning;
|
||||||
|
o A new variable, rl_catch_signals, is available to application writers
|
||||||
|
to indicate to readline whether or not it should install its own
|
||||||
|
signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP,
|
||||||
|
SIGTTIN, and SIGTTOU;
|
||||||
|
o A new variable, rl_catch_sigwinch, is available to application
|
||||||
|
writers to indicate to readline whether or not it should install its
|
||||||
|
own signal handler for SIGWINCH, which will chain to the calling
|
||||||
|
applications's SIGWINCH handler, if one is installed;
|
||||||
|
o There is a new function, rl_free_line_state, for application signal
|
||||||
|
handlers to call to free up the state associated with the current
|
||||||
|
line after receiving a signal;
|
||||||
|
o There is a new function, rl_cleanup_after_signal, to clean up the
|
||||||
|
display and terminal state after receiving a signal;
|
||||||
|
o There is a new function, rl_reset_after_signal, to reinitialize the
|
||||||
|
terminal and display state after an application signal handler
|
||||||
|
returns and readline continues
|
||||||
|
|
||||||
|
f. There is a new function, rl_resize_terminal, to reset readline's idea of
|
||||||
|
the screen size after a SIGWINCH.
|
||||||
|
|
||||||
|
g. New public functions: rl_save_prompt and rl_restore_prompt. These were
|
||||||
|
previously private functions with a `_' prefix. These functions are
|
||||||
|
used when an application wants to write a message to the `message area'
|
||||||
|
with rl_message and have the prompt restored correctly when the message
|
||||||
|
is erased.
|
||||||
|
|
||||||
|
h. New function hook: rl_pre_input_hook, called just before readline starts
|
||||||
|
reading input, after initialization.
|
||||||
|
|
||||||
|
i. New function hook: rl_display_matches_hook, called when readline would
|
||||||
|
display the list of completion matches. The new function
|
||||||
|
rl_display_match_list is what readline uses internally, and is available
|
||||||
|
for use by application functions called via this hook.
|
||||||
|
|
||||||
|
j. New bindable function, delete-char-or-list, like tcsh.
|
||||||
|
|
||||||
|
k. A new variable, rl_erase_empty_line, which, if set by an application using
|
||||||
|
readline, will cause readline to erase, prompt and all, lines on which the
|
||||||
|
only thing typed was a newline.
|
||||||
|
|
||||||
|
l. There is a new script, support/shlib-install, to install and uninstall
|
||||||
|
the shared readline and history libraries.
|
||||||
|
|
||||||
|
m. A new bindable variable, `isearch-terminators', which is a string
|
||||||
|
containing the set of characters that should terminate an incremental
|
||||||
|
search without being executed as a command.
|
||||||
|
|
||||||
|
n. A new bindable function, forward-backward-delete-char.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
This document details the changes between this version, readline-2.2,
|
This document details the changes between this version, readline-2.2,
|
||||||
and the previous version, readline-2.1.
|
and the previous version, readline-2.1.
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
doc d
|
doc d
|
||||||
examples d
|
examples d
|
||||||
support d
|
support d
|
||||||
|
shlib d
|
||||||
COPYING f
|
COPYING f
|
||||||
README f
|
README f
|
||||||
MANIFEST f
|
MANIFEST f
|
||||||
|
@ -27,6 +28,7 @@ posixstat.h f
|
||||||
readline.h f
|
readline.h f
|
||||||
rlconf.h f
|
rlconf.h f
|
||||||
rldefs.h f
|
rldefs.h f
|
||||||
|
rlstdc.h f
|
||||||
rltty.h f
|
rltty.h f
|
||||||
rlwinsize.h f
|
rlwinsize.h f
|
||||||
tcap.h f
|
tcap.h f
|
||||||
|
@ -45,6 +47,7 @@ nls.c f
|
||||||
parens.c f
|
parens.c f
|
||||||
readline.c f
|
readline.c f
|
||||||
rltty.c f
|
rltty.c f
|
||||||
|
savestring.c f
|
||||||
search.c f
|
search.c f
|
||||||
shell.c f
|
shell.c f
|
||||||
signals.c f
|
signals.c f
|
||||||
|
@ -60,13 +63,17 @@ history.c f
|
||||||
histexpand.c f
|
histexpand.c f
|
||||||
histfile.c f
|
histfile.c f
|
||||||
histsearch.c f
|
histsearch.c f
|
||||||
|
shlib/Makefile.in f
|
||||||
support/config.guess f
|
support/config.guess f
|
||||||
support/config.sub f
|
support/config.sub f
|
||||||
support/install.sh f
|
support/install.sh f
|
||||||
support/mkdirs f
|
support/mkdirs f
|
||||||
support/mkdist f
|
support/mkdist f
|
||||||
|
support/shobj-conf f
|
||||||
|
support/shlib-install f
|
||||||
doc/Makefile.in f
|
doc/Makefile.in f
|
||||||
doc/texinfo.tex f
|
doc/texinfo.tex f
|
||||||
|
doc/manvers.texinfo f
|
||||||
doc/rlman.texinfo f
|
doc/rlman.texinfo f
|
||||||
doc/rltech.texinfo f
|
doc/rltech.texinfo f
|
||||||
doc/rluser.texinfo f
|
doc/rluser.texinfo f
|
||||||
|
@ -81,5 +88,16 @@ examples/fileman.c f
|
||||||
examples/manexamp.c f
|
examples/manexamp.c f
|
||||||
examples/rltest.c f
|
examples/rltest.c f
|
||||||
examples/rl.c f
|
examples/rl.c f
|
||||||
|
examples/rlversion.c f
|
||||||
examples/histexamp.c f
|
examples/histexamp.c f
|
||||||
examples/Inputrc f
|
examples/Inputrc f
|
||||||
|
# formatted documentation, from MANIFEST.doc
|
||||||
|
doc/readline.ps f
|
||||||
|
doc/history.ps f
|
||||||
|
doc/readline.dvi f
|
||||||
|
doc/history.dvi f
|
||||||
|
doc/readline.info f
|
||||||
|
doc/history.info f
|
||||||
|
doc/readline.html f
|
||||||
|
doc/history.html f
|
||||||
|
doc/readline.0 f
|
||||||
|
|
|
@ -28,13 +28,15 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
LD = ld # needed when building shared libraries
|
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
AR = ar
|
AR = @AR@
|
||||||
|
ARFLAGS = @ARFLAGS@
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
CP = cp
|
CP = cp
|
||||||
MV = mv
|
MV = mv
|
||||||
|
|
||||||
|
SHELL = @MAKE_SHELL@
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
|
|
||||||
|
@ -47,8 +49,6 @@ infodir = @infodir@
|
||||||
|
|
||||||
man3dir = $(mandir)/man3
|
man3dir = $(mandir)/man3
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
# Programs to make tags files.
|
# Programs to make tags files.
|
||||||
ETAGS = etags -tw
|
ETAGS = etags -tw
|
||||||
CTAGS = ctags -tw
|
CTAGS = ctags -tw
|
||||||
|
@ -56,7 +56,6 @@ CTAGS = ctags -tw
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
|
LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ @CFLAGS@
|
|
||||||
|
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
LOCAL_DEFS = @LOCAL_DEFS@
|
LOCAL_DEFS = @LOCAL_DEFS@
|
||||||
|
@ -66,34 +65,14 @@ INCLUDES = -I. -I$(srcdir) -I$(includedir)
|
||||||
|
|
||||||
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
|
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
|
||||||
|
|
||||||
# these two options need tweaking for compiler/OS versions other than gcc
|
|
||||||
# and SunOS4
|
|
||||||
PICFLAG= -fpic # -pic for some versions of cc
|
|
||||||
SHLIB_OPTS= -assert pure-text -ldl # -Bshareable for some versions of gcc
|
|
||||||
|
|
||||||
MAJOR= 3
|
|
||||||
# shared library systems like SVR4's do not use minor versions
|
|
||||||
MINOR= .0
|
|
||||||
|
|
||||||
.SUFFIXES: .so
|
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
|
${RM} $@
|
||||||
$(CC) -c $(CCFLAGS) $<
|
$(CC) -c $(CCFLAGS) $<
|
||||||
|
|
||||||
.c.so:
|
|
||||||
-mv $*.o z$*.o
|
|
||||||
$(CC) -c $(PICFLAG) $(CCFLAGS) $<
|
|
||||||
mv $*.o $@
|
|
||||||
-mv z$*.o $*.o
|
|
||||||
|
|
||||||
# The name of the main library target.
|
# The name of the main library target.
|
||||||
LIBRARY_NAME = libreadline.a
|
LIBRARY_NAME = libreadline.a
|
||||||
STATIC_LIBS = libreadline.a libhistory.a
|
STATIC_LIBS = libreadline.a libhistory.a
|
||||||
|
|
||||||
SHARED_READLINE = libreadline.so.$(MAJOR)$(MINOR)
|
|
||||||
SHARED_HISTORY = libhistory.so.$(MAJOR)$(MINOR)
|
|
||||||
SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)
|
|
||||||
|
|
||||||
# The C code source files for this library.
|
# The C code source files for this library.
|
||||||
CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
|
CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
|
||||||
$(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
|
$(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
|
||||||
|
@ -104,65 +83,50 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
|
||||||
$(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
|
$(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
|
||||||
$(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
|
$(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
|
||||||
$(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
|
$(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
|
||||||
$(srcdir)/shell.c $(srcdir)/tilde.c
|
$(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c
|
||||||
|
|
||||||
# The header files for this library.
|
# The header files for this library.
|
||||||
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
|
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 \
|
posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
|
||||||
ansi_stdlib.h tcap.h
|
ansi_stdlib.h tcap.h rlstdc.h
|
||||||
|
|
||||||
HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
|
HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
|
||||||
TILDEOBJ = tilde.o
|
TILDEOBJ = tilde.o
|
||||||
OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
|
OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
|
||||||
rltty.o complete.o bind.o isearch.o display.o signals.o \
|
rltty.o complete.o bind.o isearch.o display.o signals.o \
|
||||||
util.o kill.o undo.o macro.o input.o callback.o terminal.o \
|
util.o kill.o undo.o macro.o input.o callback.o terminal.o \
|
||||||
nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
|
nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
|
||||||
|
|
||||||
SHARED_HISTOBJ = history.so histexpand.so histfile.so histsearch.so shell.so
|
|
||||||
SHARED_TILDEOBJ = tilde.so
|
|
||||||
SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \
|
|
||||||
rltty.so complete.so bind.so isearch.so display.so signals.so \
|
|
||||||
util.so kill.so undo.so macro.so input.so callback.so terminal.so \
|
|
||||||
nls.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ)
|
|
||||||
|
|
||||||
# The texinfo files which document this library.
|
# The texinfo files which document this library.
|
||||||
DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
|
DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
|
||||||
DOCOBJECT = doc/readline.dvi
|
DOCOBJECT = doc/readline.dvi
|
||||||
DOCSUPPORT = doc/Makefile
|
DOCSUPPORT = doc/Makefile
|
||||||
DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
|
DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
|
||||||
|
|
||||||
CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile
|
CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
|
||||||
CREATED_CONFIGURE = config.status config.h config.cache config.log \
|
CREATED_CONFIGURE = config.status config.h config.cache config.log \
|
||||||
stamp-config stamp-h
|
stamp-config stamp-h
|
||||||
CREATED_TAGS = TAGS tags
|
CREATED_TAGS = TAGS tags
|
||||||
|
|
||||||
INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
|
INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
|
||||||
|
rlstdc.h rlconf.h
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
all: static
|
all: static
|
||||||
|
|
||||||
static: $(STATIC_LIBS)
|
static: $(STATIC_LIBS)
|
||||||
shared: $(SHARED_LIBS)
|
|
||||||
|
|
||||||
libreadline.a: $(OBJECTS)
|
libreadline.a: $(OBJECTS)
|
||||||
$(RM) $@
|
$(RM) $@
|
||||||
$(AR) cr $@ $(OBJECTS)
|
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||||
-test -n "$(RANLIB)" && $(RANLIB) $@
|
-test -n "$(RANLIB)" && $(RANLIB) $@
|
||||||
|
|
||||||
libhistory.a: $(HISTOBJ) xmalloc.o
|
libhistory.a: $(HISTOBJ) xmalloc.o
|
||||||
$(RM) $@
|
$(RM) $@
|
||||||
$(AR) cr $@ $(HISTOBJ) xmalloc.o
|
$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
|
||||||
-test -n "$(RANLIB)" && $(RANLIB) $@
|
-test -n "$(RANLIB)" && $(RANLIB) $@
|
||||||
|
|
||||||
$(SHARED_READLINE): $(SHARED_OBJ)
|
|
||||||
$(RM) $@
|
|
||||||
$(LD) ${SHLIB_OPTS} -o $@ $(SHARED_OBJ)
|
|
||||||
|
|
||||||
$(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so
|
|
||||||
$(RM) $@
|
|
||||||
$(LD) ${SHLIB_OPTS} -o $@ $(SHARED_HISTOBJ) xmalloc.so
|
|
||||||
|
|
||||||
readline: $(OBJECTS) readline.h rldefs.h chardefs.h
|
readline: $(OBJECTS) readline.h rldefs.h chardefs.h
|
||||||
$(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
|
$(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
|
||||||
|
|
||||||
|
@ -187,6 +151,10 @@ stamp-h: config.status $(srcdir)/config.h.in
|
||||||
#$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
|
#$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
|
||||||
# cd $(srcdir) && autoconf Comment-me-out in distribution
|
# cd $(srcdir) && autoconf Comment-me-out in distribution
|
||||||
|
|
||||||
|
shared: force
|
||||||
|
-test -d shlib || mkdir shlib
|
||||||
|
-( cd shlib ; ${MAKE} ${MFLAGS} all )
|
||||||
|
|
||||||
documentation: force
|
documentation: force
|
||||||
-test -d doc || mkdir doc
|
-test -d doc || mkdir doc
|
||||||
-( cd doc && $(MAKE) $(MFLAGS) )
|
-( cd doc && $(MAKE) $(MFLAGS) )
|
||||||
|
@ -233,13 +201,10 @@ uninstall:
|
||||||
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
|
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
|
||||||
|
|
||||||
install-shared: installdirs shared
|
install-shared: installdirs shared
|
||||||
-$(MV) $(libdir)/$(SHARED_HISTORY) $(libdir)/$(SHARED_HISTORY).old
|
-( cd shlib ; ${MAKE} ${MFLAGS} install )
|
||||||
$(INSTALL_DATA) $(SHARED_HISTORY) $(libdir)/$(SHARED_HISTORY)
|
|
||||||
-$(MV) $(libdir)/$(SHARED_READLINE) $(libdir)/$(SHARED_READLINE).old
|
|
||||||
$(INSTALL_DATA) $(SHARED_READLINE) $(libdir)/$(SHARED_READLINE)
|
|
||||||
|
|
||||||
uninstall-shared:
|
uninstall-shared:
|
||||||
-test -n "$(libdir)" && cd $(libdir) && ${RM} ${SHARED_LIBS}
|
-( cd shlib; ${MAKE} ${MFLAGS} uninstall )
|
||||||
|
|
||||||
TAGS: force
|
TAGS: force
|
||||||
$(ETAGS) $(CSOURCES) $(HSOURCES)
|
$(ETAGS) $(CSOURCES) $(HSOURCES)
|
||||||
|
@ -249,15 +214,17 @@ tags: force
|
||||||
|
|
||||||
clean: force
|
clean: force
|
||||||
$(RM) $(OBJECTS) $(STATIC_LIBS)
|
$(RM) $(OBJECTS) $(STATIC_LIBS)
|
||||||
$(RM) $(SHARED_OBJ) $(SHARED_LIBS)
|
-( cd shlib && $(MAKE) $(MFLAGS) $@ )
|
||||||
-( cd doc && $(MAKE) $(MFLAGS) $@ )
|
-( cd doc && $(MAKE) $(MFLAGS) $@ )
|
||||||
-( cd examples && $(MAKE) $(MFLAGS) $@ )
|
-( cd examples && $(MAKE) $(MFLAGS) $@ )
|
||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
-( cd shlib && $(MAKE) $(MFLAGS) $@ )
|
||||||
-( cd doc && $(MAKE) $(MFLAGS) $@ )
|
-( cd doc && $(MAKE) $(MFLAGS) $@ )
|
||||||
-( cd examples && $(MAKE) $(MFLAGS) $@ )
|
-( cd examples && $(MAKE) $(MFLAGS) $@ )
|
||||||
|
|
||||||
distclean maintainer-clean: clean
|
distclean maintainer-clean: clean
|
||||||
|
-( cd shlib && $(MAKE) $(MFLAGS) $@ )
|
||||||
-( cd doc && $(MAKE) $(MFLAGS) $@ )
|
-( cd doc && $(MAKE) $(MFLAGS) $@ )
|
||||||
-( cd examples && $(MAKE) $(MFLAGS) $@ )
|
-( cd examples && $(MAKE) $(MFLAGS) $@ )
|
||||||
$(RM) Makefile
|
$(RM) Makefile
|
||||||
|
@ -285,89 +252,89 @@ dist: force
|
||||||
# Dependencies
|
# Dependencies
|
||||||
bind.o: ansi_stdlib.h posixstat.h
|
bind.o: ansi_stdlib.h posixstat.h
|
||||||
bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
bind.o: readline.h keymaps.h chardefs.h tilde.h
|
bind.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
bind.o: history.h
|
bind.o: history.h
|
||||||
callback.o: rlconf.h
|
callback.o: rlconf.h
|
||||||
callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
callback.o: readline.h keymaps.h chardefs.h tilde.h
|
callback.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
complete.o: ansi_stdlib.h posixdir.h posixstat.h
|
complete.o: ansi_stdlib.h posixdir.h posixstat.h
|
||||||
complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
complete.o: readline.h keymaps.h chardefs.h tilde.h
|
complete.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
display.o: ansi_stdlib.h posixstat.h
|
display.o: ansi_stdlib.h posixstat.h
|
||||||
display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
display.o: tcap.h
|
display.o: tcap.h
|
||||||
display.o: readline.h keymaps.h chardefs.h tilde.h
|
display.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
display.o: history.h
|
display.o: history.h rlstdc.h
|
||||||
funmap.o: readline.h keymaps.h chardefs.h tilde.h
|
funmap.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
funmap.o: rlconf.h ansi_stdlib.h
|
funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
|
||||||
funmap.o: ${BUILD_DIR}/config.h
|
funmap.o: ${BUILD_DIR}/config.h
|
||||||
histexpand.o: ansi_stdlib.h
|
histexpand.o: ansi_stdlib.h
|
||||||
histexpand.o: history.h histlib.h
|
histexpand.o: history.h histlib.h rlstdc.h
|
||||||
histexpand.o: ${BUILD_DIR}/config.h
|
histexpand.o: ${BUILD_DIR}/config.h
|
||||||
histfile.o: ansi_stdlib.h
|
histfile.o: ansi_stdlib.h
|
||||||
histfile.o: history.h histlib.h
|
histfile.o: history.h histlib.h rlstdc.h
|
||||||
histfile.o: ${BUILD_DIR}/config.h
|
histfile.o: ${BUILD_DIR}/config.h
|
||||||
history.o: ansi_stdlib.h
|
history.o: ansi_stdlib.h
|
||||||
history.o: history.h histlib.h
|
history.o: history.h histlib.h rlstdc.h
|
||||||
history.o: ${BUILD_DIR}/config.h
|
history.o: ${BUILD_DIR}/config.h
|
||||||
histsearch.o: ansi_stdlib.h
|
histsearch.o: ansi_stdlib.h
|
||||||
histsearch.o: history.h histlib.h
|
histsearch.o: history.h histlib.h rlstdc.h
|
||||||
histsearch.o: ${BUILD_DIR}/config.h
|
histsearch.o: ${BUILD_DIR}/config.h
|
||||||
input.o: ansi_stdlib.h
|
input.o: ansi_stdlib.h
|
||||||
input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
input.o: readline.h keymaps.h chardefs.h tilde.h
|
input.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
isearch.o: readline.h keymaps.h chardefs.h tilde.h
|
isearch.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
isearch.o: ansi_stdlib.h history.h
|
isearch.o: ansi_stdlib.h history.h rlstdc.h
|
||||||
keymaps.o: emacs_keymap.c vi_keymap.c
|
keymaps.o: emacs_keymap.c vi_keymap.c
|
||||||
keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
|
keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
|
||||||
keymaps.o: readline.h keymaps.h chardefs.h tilde.h
|
keymaps.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
keymaps.o: ${BUILD_DIR}/config.h
|
keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
|
||||||
kill.o: ansi_stdlib.h
|
kill.o: ansi_stdlib.h
|
||||||
kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
kill.o: readline.h keymaps.h chardefs.h tilde.h
|
kill.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
kill.o: history.h
|
kill.o: history.h rlstdc.h
|
||||||
macro.o: ansi_stdlib.h
|
macro.o: ansi_stdlib.h
|
||||||
macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
macro.o: readline.h keymaps.h chardefs.h tilde.h
|
macro.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
macro.o: history.h
|
macro.o: history.h rlstdc.h
|
||||||
nls.o: ansi_stdlib.h
|
nls.o: ansi_stdlib.h
|
||||||
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
parens.o: rlconf.h
|
parens.o: rlconf.h
|
||||||
parens.o: ${BUILD_DIR}/config.h
|
parens.o: ${BUILD_DIR}/config.h
|
||||||
parens.o: readline.h keymaps.h chardefs.h tilde.h
|
parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
readline.o: readline.h keymaps.h chardefs.h tilde.h
|
readline.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
readline.o: history.h
|
readline.o: history.h rlstdc.h
|
||||||
readline.o: posixstat.h ansi_stdlib.h posixjmp.h
|
readline.o: posixstat.h ansi_stdlib.h posixjmp.h
|
||||||
rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
rltty.o: rltty.h
|
rltty.o: rltty.h
|
||||||
rltty.o: readline.h keymaps.h chardefs.h tilde.h
|
rltty.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
search.o: readline.h keymaps.h chardefs.h tilde.h
|
search.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
search.o: ansi_stdlib.h history.h
|
search.o: ansi_stdlib.h history.h rlstdc.h
|
||||||
shell.o: ${BUILD_DIR}/config.h
|
shell.o: ${BUILD_DIR}/config.h
|
||||||
shell.o: ansi_stdlib.h
|
shell.o: ansi_stdlib.h
|
||||||
signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
signals.o: readline.h keymaps.h chardefs.h tilde.h
|
signals.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
signals.o: history.h
|
signals.o: history.h rlstdc.h
|
||||||
terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
terminal.o: tcap.h
|
terminal.o: tcap.h
|
||||||
terminal.o: readline.h keymaps.h chardefs.h tilde.h
|
terminal.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
terminal.o: history.h
|
terminal.o: history.h rlstdc.h
|
||||||
tilde.o: ansi_stdlib.h
|
tilde.o: ansi_stdlib.h
|
||||||
tilde.o: ${BUILD_DIR}/config.h
|
tilde.o: ${BUILD_DIR}/config.h
|
||||||
tilde.o: tilde.h
|
tilde.o: tilde.h
|
||||||
undo.o: ansi_stdlib.h
|
undo.o: ansi_stdlib.h
|
||||||
undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
undo.o: readline.h keymaps.h chardefs.h tilde.h
|
undo.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
undo.o: history.h
|
undo.o: history.h rlstdc.h
|
||||||
util.o: posixjmp.h ansi_stdlib.h
|
util.o: posixjmp.h ansi_stdlib.h
|
||||||
util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
util.o: readline.h keymaps.h chardefs.h tilde.h
|
util.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
|
||||||
vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
||||||
vi_mode.o: readline.h keymaps.h chardefs.h tilde.h
|
vi_mode.o: readline.h keymaps.h chardefs.h tilde.h
|
||||||
vi_mode.o: history.h ansi_stdlib.h
|
vi_mode.o: history.h ansi_stdlib.h rlstdc.h
|
||||||
xmalloc.o: ${BUILD_DIR}/config.h
|
xmalloc.o: ${BUILD_DIR}/config.h
|
||||||
xmalloc.o: ansi_stdlib.h
|
xmalloc.o: ansi_stdlib.h
|
||||||
|
|
||||||
|
@ -396,95 +363,10 @@ history.o: $(srcdir)/history.c
|
||||||
histexpand.o: $(srcdir)/histexpand.c
|
histexpand.o: $(srcdir)/histexpand.c
|
||||||
histfile.o: $(srcdir)/histfile.c
|
histfile.o: $(srcdir)/histfile.c
|
||||||
histsearch.o: $(srcdir)/histsearch.c
|
histsearch.o: $(srcdir)/histsearch.c
|
||||||
|
savestring.o: $(srcdir)/savestring.c
|
||||||
shell.o: $(srcdir)/shell.c
|
shell.o: $(srcdir)/shell.c
|
||||||
tilde.o: $(srcdir)/tilde.c
|
tilde.o: $(srcdir)/tilde.c
|
||||||
|
|
||||||
bind.so: ansi_stdlib.h posixstat.h
|
|
||||||
bind.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
bind.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
bind.so: history.h
|
|
||||||
callback.so: rlconf.h
|
|
||||||
callback.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
callback.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
complete.so: ansi_stdlib.h posixdir.h posixstat.h
|
|
||||||
complete.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
complete.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
display.so: ansi_stdlib.h posixstat.h
|
|
||||||
display.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
display.so: tcap.h
|
|
||||||
display.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
display.so: history.h
|
|
||||||
funmap.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
funmap.so: rlconf.h ansi_stdlib.h
|
|
||||||
funmap.so: ${BUILD_DIR}/config.h
|
|
||||||
histexpand.so: ansi_stdlib.h
|
|
||||||
histexpand.so: history.h histlib.h
|
|
||||||
histexpand.so: ${BUILD_DIR}/config.h
|
|
||||||
histfile.so: ansi_stdlib.h
|
|
||||||
histfile.so: history.h histlib.h
|
|
||||||
histfile.so: ${BUILD_DIR}/config.h
|
|
||||||
history.so: ansi_stdlib.h
|
|
||||||
history.so: history.h histlib.h
|
|
||||||
history.so: ${BUILD_DIR}/config.h
|
|
||||||
histsearch.so: ansi_stdlib.h
|
|
||||||
histsearch.so: history.h histlib.h
|
|
||||||
histsearch.so: ${BUILD_DIR}/config.h
|
|
||||||
input.so: ansi_stdlib.h
|
|
||||||
input.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
input.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
isearch.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
isearch.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
isearch.so: ansi_stdlib.h history.h
|
|
||||||
keymaps.so: emacs_keymap.c vi_keymap.c
|
|
||||||
keymaps.so: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
|
|
||||||
keymaps.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
keymaps.so: ${BUILD_DIR}/config.h
|
|
||||||
kill.so: ansi_stdlib.h
|
|
||||||
kill.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
kill.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
kill.so: history.h
|
|
||||||
macro.so: ansi_stdlib.h
|
|
||||||
macro.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
macro.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
macro.so: history.h
|
|
||||||
nls.so: ansi_stdlib.h
|
|
||||||
nls.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
parens.so: rlconf.h
|
|
||||||
parens.so: ${BUILD_DIR}/config.h
|
|
||||||
parens.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
readline.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
readline.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
readline.so: history.h
|
|
||||||
readline.so: posixstat.h ansi_stdlib.h posixjmp.h
|
|
||||||
rltty.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
rltty.so: rltty.h
|
|
||||||
rltty.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
search.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
search.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
search.so: ansi_stdlib.h history.h
|
|
||||||
signals.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
signals.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
signals.so: history.h
|
|
||||||
terminal.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
terminal.so: tcap.h
|
|
||||||
terminal.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
terminal.so: history.h
|
|
||||||
tilde.so: ansi_stdlib.h
|
|
||||||
tilde.so: ${BUILD_DIR}/config.h
|
|
||||||
tilde.so: tilde.h
|
|
||||||
undo.so: ansi_stdlib.h
|
|
||||||
undo.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
undo.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
undo.so: history.h
|
|
||||||
util.so: posixjmp.h ansi_stdlib.h
|
|
||||||
util.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
util.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
vi_mode.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
|
|
||||||
vi_mode.so: readline.h keymaps.h chardefs.h tilde.h
|
|
||||||
vi_mode.so: history.h ansi_stdlib.h
|
|
||||||
xmalloc.so: ${BUILD_DIR}/config.h
|
|
||||||
xmalloc.so: ansi_stdlib.h
|
|
||||||
|
|
||||||
readline.o: readline.c
|
readline.o: readline.c
|
||||||
vi_mode.o: vi_mode.c
|
vi_mode.o: vi_mode.c
|
||||||
funmap.o: funmap.c
|
funmap.o: funmap.c
|
||||||
|
@ -510,61 +392,6 @@ history.o: history.c
|
||||||
histexpand.o: histexpand.c
|
histexpand.o: histexpand.c
|
||||||
histfile.o: histfile.c
|
histfile.o: histfile.c
|
||||||
histsearch.o: histsearch.c
|
histsearch.o: histsearch.c
|
||||||
|
savestring.o: savestring.c
|
||||||
shell.o: shell.c
|
shell.o: shell.c
|
||||||
tilde.o: tilde.c
|
tilde.o: tilde.c
|
||||||
|
|
||||||
readline.so: $(srcdir)/readline.c
|
|
||||||
vi_mode.so: $(srcdir)/vi_mode.c
|
|
||||||
funmap.so: $(srcdir)/funmap.c
|
|
||||||
keymaps.so: $(srcdir)/keymaps.c
|
|
||||||
parens.so: $(srcdir)/parens.c
|
|
||||||
search.so: $(srcdir)/search.c
|
|
||||||
rltty.so: $(srcdir)/rltty.c
|
|
||||||
complete.so: $(srcdir)/complete.c
|
|
||||||
bind.so: $(srcdir)/bind.c
|
|
||||||
isearch.so: $(srcdir)/isearch.c
|
|
||||||
display.so: $(srcdir)/display.c
|
|
||||||
signals.so: $(srcdir)/signals.c
|
|
||||||
util.so: $(srcdir)/util.c
|
|
||||||
kill.so: $(srcdir)/kill.c
|
|
||||||
undo.so: $(srcdir)/undo.c
|
|
||||||
macro.so: $(srcdir)/macro.c
|
|
||||||
input.so: $(srcdir)/input.c
|
|
||||||
callback.so: $(srcdir)/callback.c
|
|
||||||
terminal.so: $(srcdir)/terminal.c
|
|
||||||
nls.so: $(srcdir)/nls.c
|
|
||||||
xmalloc.so: $(srcdir)/xmalloc.c
|
|
||||||
history.so: $(srcdir)/history.c
|
|
||||||
histexpand.so: $(srcdir)/histexpand.c
|
|
||||||
histfile.so: $(srcdir)/histfile.c
|
|
||||||
histsearch.so: $(srcdir)/histsearch.c
|
|
||||||
shell.so: $(srcdir)/shell.c
|
|
||||||
tilde.so: $(srcdir)/tilde.c
|
|
||||||
|
|
||||||
readline.so: readline.c
|
|
||||||
vi_mode.so: vi_mode.c
|
|
||||||
funmap.so: funmap.c
|
|
||||||
keymaps.so: keymaps.c
|
|
||||||
parens.so: parens.c
|
|
||||||
search.so: search.c
|
|
||||||
rltty.so: rltty.c
|
|
||||||
complete.so: complete.c
|
|
||||||
bind.so: bind.c
|
|
||||||
isearch.so: isearch.c
|
|
||||||
display.so: display.c
|
|
||||||
signals.so: signals.c
|
|
||||||
util.so: util.c
|
|
||||||
kill.so: kill.c
|
|
||||||
undo.so: undo.c
|
|
||||||
macro.so: macro.c
|
|
||||||
input.so: input.c
|
|
||||||
callback.so: callback.c
|
|
||||||
terminal.so: terminal.c
|
|
||||||
nls.so: nls.c
|
|
||||||
xmalloc.so: xmalloc.c
|
|
||||||
history.so: history.c
|
|
||||||
histexpand.so: histexpand.c
|
|
||||||
histfile.so: histfile.c
|
|
||||||
histsearch.so: histsearch.c
|
|
||||||
shell.so: shell.c
|
|
||||||
tilde.so: tilde.c
|
|
||||||
|
|
101
readline/README
101
readline/README
|
@ -1,7 +1,7 @@
|
||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
|
|
||||||
This is the Gnu Readline library, version 2.2
|
This is the Gnu Readline library, version 4.0.
|
||||||
|
|
||||||
The Readline library provides a set of functions for use by applications
|
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
|
that allow users to edit command lines as they are typed in. Both
|
||||||
|
@ -34,8 +34,8 @@ may work:
|
||||||
Read the file INSTALL in this directory for more information about how
|
Read the file INSTALL in this directory for more information about how
|
||||||
to customize and control the build process.
|
to customize and control the build process.
|
||||||
|
|
||||||
The file rlconf.h contains defines that enable and disable certain
|
The file rlconf.h contains C preprocessor defines that enable and disable
|
||||||
Readline features.
|
certain Readline features.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
========
|
========
|
||||||
|
@ -49,32 +49,83 @@ Shared Libraries
|
||||||
================
|
================
|
||||||
|
|
||||||
There is skeletal support for building shared versions of the
|
There is skeletal support for building shared versions of the
|
||||||
Readline and History libraries.
|
Readline and History libraries. The configure script creates
|
||||||
|
a Makefile in the `shlib' subdirectory, and typing `make shared'
|
||||||
|
will cause shared versions of the Readline and History libraries
|
||||||
|
to be built on supported platforms.
|
||||||
|
|
||||||
Typing `make shared' will cause shared versions of the Readline and
|
Configure calls the script support/shobj-conf to test whether or
|
||||||
History libraries to be built on SunOS 4.1.x. For versions of Unix
|
not shared library creation is supported and to generate the values
|
||||||
other than SunOS, you will have to make some changes to Makefile.in.
|
of variables that are substituted into shlib/Makefile. If you
|
||||||
The relevant variables are:
|
try to build shared libraries on an unsupported platform, `make'
|
||||||
|
will display a message asking you to update support/shobj-conf for
|
||||||
|
your platform.
|
||||||
|
|
||||||
PICFLAG Options to give to the compiler to produce position-independent
|
If you need to update support/shobj-conf, you will need to create
|
||||||
code. The value `-fpic' works for most versions of gcc.
|
a `stanza' for your operating system and compiler. The script uses
|
||||||
SHLIB_OPTS Options to give to the linker to produce a shared library.
|
the value of host_os and ${CC} as determined by configure. For
|
||||||
The value `-assert pure-text -ldl' works on SunOS 4.1.x.
|
instance, FreeBSD 2.2.5 with any version of gcc is identified as
|
||||||
The value `-Bshareable' works for some versions of GNU ld.
|
`freebsd2.2.5-gcc*'.
|
||||||
|
|
||||||
MAJOR The major version number of the shared library. You should
|
In the stanza for your operating system-compiler pair, you will need to
|
||||||
not need to change this.
|
define several variables. They are:
|
||||||
MINOR The minor version number of the shared library. Some systems,
|
|
||||||
such as SVR4 and its descendents (e.g., Solaris, Unixware),
|
|
||||||
do not use minor version numbers. For those systems, this
|
|
||||||
variable should be left unset.
|
|
||||||
|
|
||||||
LD The linker. The value of `ld' is correct for SunOS 4.1.x.
|
SHOBJ_CC The C compiler used to compile source files into shareable
|
||||||
You may need to change it to `gcc'; make sure to change
|
object files. This is normally set to the value of ${CC}
|
||||||
SHLIB_OPTS if you do so.
|
by configure, and should not need to be changed.
|
||||||
|
|
||||||
Once you have edited Makefile.in, type `make Makefile' to rebuild the
|
SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create
|
||||||
Makefile, then `make shared' to build the shared libraries.
|
position-independent code. If you are using gcc, this
|
||||||
|
should probably be set to `-fpic'.
|
||||||
|
|
||||||
|
SHOBJ_LD The link editor to be used to create the shared library from
|
||||||
|
the object files created by $SHOBJ_CC. If you are using
|
||||||
|
gcc, a value of `gcc' will probably work.
|
||||||
|
|
||||||
|
SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation.
|
||||||
|
If you are using gcc, `-shared' may be all that is necessary.
|
||||||
|
These should be the flags needed for generic shared object
|
||||||
|
creation.
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
|
||||||
|
creation. Many systems use the -R option to the link
|
||||||
|
editor to embed a path within the library for run-time
|
||||||
|
library searches. A reasonable value for such systems would
|
||||||
|
be `-R$(libdir)'.
|
||||||
|
|
||||||
|
SHLIB_LIBS Any additional libraries that shared libraries should be
|
||||||
|
linked against when they are created.
|
||||||
|
|
||||||
|
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
|
||||||
|
generating the filename of the shared library. Many systems
|
||||||
|
use `so'; HP-UX uses `sl'.
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION The string to append to the filename to indicate the version
|
||||||
|
of the shared library. It should begin with $(SHLIB_LIBSUFF),
|
||||||
|
and possibly include version information that allows the
|
||||||
|
run-time loader to load the version of the shared library
|
||||||
|
appropriate for a particular program. Systems using shared
|
||||||
|
libraries similar to SunOS 4.x use major and minor library
|
||||||
|
version numbers; for those systems a value of
|
||||||
|
`$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
|
||||||
|
Systems based on System V Release 4 don't use minor version
|
||||||
|
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
|
||||||
|
Other Unix versions use different schemes.
|
||||||
|
|
||||||
|
SHLIB_STATUS Set this to `supported' when you have defined the other
|
||||||
|
necessary variables. Make uses this to determine whether
|
||||||
|
or not shared library creation should be attempted.
|
||||||
|
|
||||||
|
You should look at the existing stanzas in support/shobj-conf for ideas.
|
||||||
|
|
||||||
|
Once you have updated support/shobj-conf, re-run configure and type
|
||||||
|
`make shared'. The shared libraries will be created in the shlib
|
||||||
|
subdirectory.
|
||||||
|
|
||||||
|
Since shared libraries are not created on all platforms, `make install'
|
||||||
|
will not automatically install the shared libraries. To install them,
|
||||||
|
change the current directory to shlib and type `make install'. Running
|
||||||
|
`make install-shared' from the top-level build directory will also work.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
=============
|
=============
|
||||||
|
@ -93,7 +144,7 @@ Bug reports for Readline should be sent to:
|
||||||
|
|
||||||
When reporting a bug, please include the following information:
|
When reporting a bug, please include the following information:
|
||||||
|
|
||||||
* the version number and release status of Readline (e.g., 2.2-release)
|
* the version number and release status of Readline (e.g., 4.0-release)
|
||||||
* the machine and OS that it is running on
|
* the machine and OS that it is running on
|
||||||
* a list of the compilation flags or the contents of `config.h', if
|
* a list of the compilation flags or the contents of `config.h', if
|
||||||
appropriate
|
appropriate
|
||||||
|
|
167
readline/aclocal.m4
vendored
167
readline/aclocal.m4
vendored
|
@ -26,7 +26,7 @@ main()
|
||||||
exit(fl != 1);
|
exit(fl != 1);
|
||||||
}
|
}
|
||||||
], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
|
], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
|
||||||
[AC_MSG_ERROR(cannot check dup2 if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
|
||||||
bash_cv_dup2_broken=no])
|
bash_cv_dup2_broken=no])
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT($bash_cv_dup2_broken)
|
AC_MSG_RESULT($bash_cv_dup2_broken)
|
||||||
|
@ -129,7 +129,7 @@ main()
|
||||||
exit(ok ? 0 : 5);
|
exit(ok ? 0 : 5);
|
||||||
}
|
}
|
||||||
], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
|
], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
|
||||||
[AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
|
||||||
bash_cv_pgrp_pipe=no])
|
bash_cv_pgrp_pipe=no])
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT($bash_cv_pgrp_pipe)
|
AC_MSG_RESULT($bash_cv_pgrp_pipe)
|
||||||
|
@ -187,7 +187,7 @@ main()
|
||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
|
}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
|
||||||
[AC_MSG_ERROR(cannot check quad_t if cross compiling -- defaulting to long)
|
[AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
|
||||||
bash_cv_type_rlimit=long])])
|
bash_cv_type_rlimit=long])])
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT($bash_cv_type_rlimit)
|
AC_MSG_RESULT($bash_cv_type_rlimit)
|
||||||
|
@ -211,7 +211,7 @@ AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif], [ char *msg = _sys_siglist[2]; ],
|
#endif], [ char *msg = _sys_siglist[2]; ],
|
||||||
bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
|
bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
|
||||||
[AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
|
[AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
|
||||||
AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
|
AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
|
||||||
if test $bash_cv_decl_under_sys_siglist = yes; then
|
if test $bash_cv_decl_under_sys_siglist = yes; then
|
||||||
AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
|
AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
|
||||||
|
@ -237,7 +237,7 @@ char *msg = (char *)_sys_siglist[2];
|
||||||
exit(msg == 0);
|
exit(msg == 0);
|
||||||
}],
|
}],
|
||||||
bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
|
bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
|
||||||
[AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
|
||||||
bash_cv_under_sys_siglist=no])])
|
bash_cv_under_sys_siglist=no])])
|
||||||
AC_MSG_RESULT($bash_cv_under_sys_siglist)
|
AC_MSG_RESULT($bash_cv_under_sys_siglist)
|
||||||
if test $bash_cv_under_sys_siglist = yes; then
|
if test $bash_cv_under_sys_siglist = yes; then
|
||||||
|
@ -264,7 +264,7 @@ char *msg = sys_siglist[2];
|
||||||
exit(msg == 0);
|
exit(msg == 0);
|
||||||
}],
|
}],
|
||||||
bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
|
bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
|
||||||
[AC_MSG_ERROR(cannot check for sys_siglist if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
|
||||||
bash_cv_sys_siglist=no])])
|
bash_cv_sys_siglist=no])])
|
||||||
AC_MSG_RESULT($bash_cv_sys_siglist)
|
AC_MSG_RESULT($bash_cv_sys_siglist)
|
||||||
if test $bash_cv_sys_siglist = yes; then
|
if test $bash_cv_sys_siglist = yes; then
|
||||||
|
@ -325,7 +325,7 @@ dir = opendir("/tmp/not_a_directory");
|
||||||
unlink("/tmp/not_a_directory");
|
unlink("/tmp/not_a_directory");
|
||||||
exit (dir == 0);
|
exit (dir == 0);
|
||||||
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
|
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
|
||||||
[AC_MSG_ERROR(cannot check opendir if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
|
||||||
bash_cv_opendir_not_robust=no]
|
bash_cv_opendir_not_robust=no]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_opendir_not_robust)
|
AC_MSG_RESULT($bash_cv_opendir_not_robust)
|
||||||
|
@ -356,109 +356,47 @@ fi
|
||||||
|
|
||||||
AC_DEFUN(BASH_TYPE_INT32_T,
|
AC_DEFUN(BASH_TYPE_INT32_T,
|
||||||
[
|
[
|
||||||
if test "X$bash_cv_type_int32_t" = "X"; then
|
if test "$ac_cv_sizeof_int" = 4; then
|
||||||
_bash_needmsg=yes
|
AC_CHECK_TYPE(int32_t, int)
|
||||||
|
elif test "$ac_cv_sizeof_long" = 4; then
|
||||||
|
AC_CHECK_TYPE(int32_t, long)
|
||||||
else
|
else
|
||||||
AC_MSG_CHECKING(which builtin C type is 32 bits wide)
|
AC_CHECK_TYPE(int32_t, int)
|
||||||
_bash_needmsg=
|
|
||||||
fi
|
|
||||||
AC_CACHE_VAL(bash_cv_type_int32_t,
|
|
||||||
[AC_TRY_RUN([
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
#if SIZEOF_INT == 4
|
|
||||||
exit (0);
|
|
||||||
#else
|
|
||||||
# if SIZEOF_LONG == 4
|
|
||||||
exit (1);
|
|
||||||
# else
|
|
||||||
# error cannot find 32 bit type...
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}], bash_cv_type_int32_t=int, bash_cv_type_int32_t=long,
|
|
||||||
[AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
|
|
||||||
bash_cv_type_int32_t=int]
|
|
||||||
)])
|
|
||||||
if test "X$_bash_needmsg" = "Xyes"; then
|
|
||||||
AC_MSG_CHECKING(which builtin C type is 32 bits wide)
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT($bash_cv_type_int32_t);
|
|
||||||
if test "$bash_cv_type_int32_t" = "int"; then
|
|
||||||
AC_DEFINE(int32_t, int)
|
|
||||||
else
|
|
||||||
AC_DEFINE(int32_t, long)
|
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN(BASH_TYPE_U_INT32_T,
|
AC_DEFUN(BASH_TYPE_U_INT32_T,
|
||||||
[
|
[
|
||||||
if test "X$bash_cv_type_u_int32_t" = "X"; then
|
if test "$ac_cv_sizeof_int" = 4; then
|
||||||
_bash_needmsg=yes
|
AC_CHECK_TYPE(u_int32_t, unsigned int)
|
||||||
|
elif test "$ac_cv_sizeof_long" = 4; then
|
||||||
|
AC_CHECK_TYPE(u_int32_t, unsigned long)
|
||||||
else
|
else
|
||||||
AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
|
AC_CHECK_TYPE(u_int32_t, unsigned int)
|
||||||
_bash_needmsg=
|
|
||||||
fi
|
|
||||||
AC_CACHE_VAL(bash_cv_type_u_int32_t,
|
|
||||||
[AC_TRY_RUN([
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
#if SIZEOF_INT == 4
|
|
||||||
exit (0);
|
|
||||||
#else
|
|
||||||
# if SIZEOF_LONG == 4
|
|
||||||
exit (1);
|
|
||||||
# else
|
|
||||||
# error cannot find 32 bit type...
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}], bash_cv_type_u_int32_t=int, bash_cv_type_u_int32_t=long,
|
|
||||||
[AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
|
|
||||||
bash_cv_type_u_int32_t=int]
|
|
||||||
)])
|
|
||||||
if test "X$_bash_needmsg" = "Xyes"; then
|
|
||||||
AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT($bash_cv_type_u_int32_t);
|
|
||||||
if test "$bash_cv_type_u_int32_t" = "int"; then
|
|
||||||
AC_DEFINE(u_int32_t, unsigned int)
|
|
||||||
else
|
|
||||||
AC_DEFINE(u_int32_t, unsigned long)
|
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN(BASH_TYPE_PTRDIFF_T,
|
AC_DEFUN(BASH_TYPE_PTRDIFF_T,
|
||||||
[
|
[
|
||||||
if test "X$bash_cv_type_ptrdiff_t" = "X"; then
|
if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
|
||||||
_bash_needmsg=yes
|
AC_CHECK_TYPE(ptrdiff_t, int)
|
||||||
|
elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
|
||||||
|
AC_CHECK_TYPE(ptrdiff_t, long)
|
||||||
else
|
else
|
||||||
AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
|
AC_CHECK_TYPE(ptrdiff_t, int)
|
||||||
_bash_needmsg=
|
|
||||||
fi
|
fi
|
||||||
AC_CACHE_VAL(bash_cv_type_ptrdiff_t,
|
])
|
||||||
[AC_TRY_RUN([
|
|
||||||
main()
|
AC_DEFUN(BASH_TYPE_BITS64_T,
|
||||||
{
|
[
|
||||||
#if SIZEOF_CHAR_P == SIZEOF_INT
|
if test "$ac_sv_sizeof_char_p" = 8; then
|
||||||
exit (0);
|
AC_CHECK_TYPE(bits64_t, char *)
|
||||||
#else
|
elif test "$ac_cv_sizeof_double" = 8; then
|
||||||
# if SIZEOF_CHAR_P == SIZEOF_LONG
|
AC_CHECK_TYPE(bits64_t, double)
|
||||||
exit (1);
|
elif test "$ac_cv_sizeof_long" = 8; then
|
||||||
# else
|
AC_CHECK_TYPE(bits64_t, long)
|
||||||
# error cannot find type for pointer arithmetic...
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}], bash_cv_type_ptrdiff_t=int, bash_cv_type_ptrdiff_t=long,
|
|
||||||
[AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
|
|
||||||
bash_cv_type_ptrdiff_t=int]
|
|
||||||
)])
|
|
||||||
if test "X$_bash_needmsg" = "Xyes"; then
|
|
||||||
AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT($bash_cv_type_ptrdiff_t);
|
|
||||||
if test "$bash_cv_type_ptrdiff_t" = "int"; then
|
|
||||||
AC_DEFINE(ptrdiff_t, int)
|
|
||||||
else
|
else
|
||||||
AC_DEFINE(ptrdiff_t, long)
|
AC_CHECK_TYPE(bits64_t, double)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -548,7 +486,7 @@ s = getenv("ABCDE");
|
||||||
exit(s == 0); /* force optimizer to leave getenv in */
|
exit(s == 0); /* force optimizer to leave getenv in */
|
||||||
}
|
}
|
||||||
], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
|
], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
|
||||||
[AC_MSG_ERROR(cannot check getenv redefinition if cross compiling -- defaulting to yes)
|
[AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
|
||||||
bash_cv_getenv_redef=yes]
|
bash_cv_getenv_redef=yes]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_getenv_redef)
|
AC_MSG_RESULT($bash_cv_getenv_redef)
|
||||||
|
@ -574,7 +512,7 @@ pf = (_bashfunc) printf;
|
||||||
exit(pf == 0);
|
exit(pf == 0);
|
||||||
}
|
}
|
||||||
], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
|
], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
|
||||||
[AC_MSG_ERROR(cannot check printf declaration if cross compiling -- defaulting to yes)
|
[AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
|
||||||
bash_cv_printf_declared=yes]
|
bash_cv_printf_declared=yes]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_printf_declared)
|
AC_MSG_RESULT($bash_cv_printf_declared)
|
||||||
|
@ -593,7 +531,7 @@ long maxfds = ulimit(4, 0L);
|
||||||
exit (maxfds == -1L);
|
exit (maxfds == -1L);
|
||||||
}
|
}
|
||||||
], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
|
], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
|
||||||
[AC_MSG_ERROR(cannot check ulimit if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
|
||||||
bash_cv_ulimit_maxfds=no]
|
bash_cv_ulimit_maxfds=no]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_ulimit_maxfds)
|
AC_MSG_RESULT($bash_cv_ulimit_maxfds)
|
||||||
|
@ -690,7 +628,7 @@ main()
|
||||||
exit (popen_called);
|
exit (popen_called);
|
||||||
}
|
}
|
||||||
], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
|
], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
|
||||||
[AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
|
||||||
bash_cv_getcwd_calls_popen=no]
|
bash_cv_getcwd_calls_popen=no]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
|
AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
|
||||||
|
@ -814,7 +752,7 @@ main()
|
||||||
exit(nsigint != 2);
|
exit(nsigint != 2);
|
||||||
}
|
}
|
||||||
], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
|
], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
|
||||||
[AC_MSG_ERROR(cannot check signal handling if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
|
||||||
bash_cv_must_reinstall_sighandlers=no]
|
bash_cv_must_reinstall_sighandlers=no]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
|
AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
|
||||||
|
@ -883,7 +821,7 @@ exit(1);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
|
}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
|
||||||
[AC_MSG_ERROR(cannot check job control if cross-compiling -- defaulting to missing)
|
[AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
|
||||||
bash_cv_job_control_missing=missing]
|
bash_cv_job_control_missing=missing]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_job_control_missing)
|
AC_MSG_RESULT($bash_cv_job_control_missing)
|
||||||
|
@ -928,7 +866,7 @@ close(fd);
|
||||||
unlink ("/tmp/sh-np-autoconf");
|
unlink ("/tmp/sh-np-autoconf");
|
||||||
exit(0);
|
exit(0);
|
||||||
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
|
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
|
||||||
[AC_MSG_ERROR(cannot check for named pipes if cross-compiling -- defaulting to missing)
|
[AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
|
||||||
bash_cv_sys_named_pipes=missing]
|
bash_cv_sys_named_pipes=missing]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_sys_named_pipes)
|
AC_MSG_RESULT($bash_cv_sys_named_pipes)
|
||||||
|
@ -979,7 +917,7 @@ siglongjmp(xx, 10);
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
|
}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
|
||||||
[AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
|
[AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
|
||||||
bash_cv_func_sigsetjmp=missing]
|
bash_cv_func_sigsetjmp=missing]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_func_sigsetjmp)
|
AC_MSG_RESULT($bash_cv_func_sigsetjmp)
|
||||||
|
@ -1246,7 +1184,7 @@ char *v[];
|
||||||
exit (r1 > 0 && r2 > 0);
|
exit (r1 > 0 && r2 > 0);
|
||||||
}
|
}
|
||||||
], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
|
], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
|
||||||
[AC_MSG_ERROR(cannot check strcoll if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
|
||||||
bash_cv_func_strcoll_broken=no]
|
bash_cv_func_strcoll_broken=no]
|
||||||
)])
|
)])
|
||||||
AC_MSG_RESULT($bash_cv_func_strcoll_broken)
|
AC_MSG_RESULT($bash_cv_func_strcoll_broken)
|
||||||
|
@ -1336,9 +1274,28 @@ main ()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
|
], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
|
||||||
AC_MSG_ERROR(cannot check restartable syscalls if cross compiling))
|
AC_MSG_WARN(cannot check restartable syscalls if cross compiling))
|
||||||
])
|
])
|
||||||
if test $bash_cv_sys_restartable_syscalls = yes; then
|
if test $bash_cv_sys_restartable_syscalls = yes; then
|
||||||
AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
|
AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
dnl
|
||||||
|
dnl Check for 64-bit off_t -- used for malloc alignment
|
||||||
|
dnl
|
||||||
|
dnl C does not allow duplicate case labels, so the compile will fail if
|
||||||
|
dnl sizeof(off_t) is > 4.
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(BASH_CHECK_OFF_T_64,
|
||||||
|
[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#include <sys/types.h>
|
||||||
|
],[
|
||||||
|
switch (0) case 0: case (sizeof (off_t) <= 4):;
|
||||||
|
], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
|
||||||
|
if test $bash_cv_off_t_64 = yes; then
|
||||||
|
AC_DEFINE(HAVE_OFF_T_64)
|
||||||
|
fi])
|
||||||
|
|
|
@ -83,6 +83,7 @@ extern int rl_complete_with_tilde_expansion;
|
||||||
extern int rl_completion_query_items;
|
extern int rl_completion_query_items;
|
||||||
extern int rl_inhibit_completion;
|
extern int rl_inhibit_completion;
|
||||||
extern char *_rl_comment_begin;
|
extern char *_rl_comment_begin;
|
||||||
|
extern unsigned char *_rl_isearch_terminators;
|
||||||
|
|
||||||
extern int rl_explicit_arg;
|
extern int rl_explicit_arg;
|
||||||
extern int rl_editing_mode;
|
extern int rl_editing_mode;
|
||||||
|
@ -207,13 +208,17 @@ rl_unbind_function_in_map (func, map)
|
||||||
Function *func;
|
Function *func;
|
||||||
Keymap map;
|
Keymap map;
|
||||||
{
|
{
|
||||||
register int i;
|
register int i, rval;
|
||||||
|
|
||||||
for (i = 0; i < KEYMAP_SIZE; i++)
|
for (i = rval = 0; i < KEYMAP_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (map[i].type == ISFUNC && map[i].function == func)
|
if (map[i].type == ISFUNC && map[i].function == func)
|
||||||
map[i].function = (Function *)NULL;
|
{
|
||||||
|
map[i].function = (Function *)NULL;
|
||||||
|
rval = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -222,7 +227,6 @@ rl_unbind_command_in_map (command, map)
|
||||||
Keymap map;
|
Keymap map;
|
||||||
{
|
{
|
||||||
Function *func;
|
Function *func;
|
||||||
register int i;
|
|
||||||
|
|
||||||
func = rl_named_function (command);
|
func = rl_named_function (command);
|
||||||
if (func == 0)
|
if (func == 0)
|
||||||
|
@ -663,7 +667,11 @@ _rl_read_file (filename, sizep)
|
||||||
i = read (file, buffer, file_size);
|
i = read (file, buffer, file_size);
|
||||||
close (file);
|
close (file);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (i < file_size)
|
if (i < file_size)
|
||||||
|
#else
|
||||||
|
if (i < 0)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
free (buffer);
|
free (buffer);
|
||||||
return ((char *)NULL);
|
return ((char *)NULL);
|
||||||
|
@ -727,6 +735,8 @@ _rl_read_init_file (filename, include_level)
|
||||||
|
|
||||||
openname = tilde_expand (filename);
|
openname = tilde_expand (filename);
|
||||||
buffer = _rl_read_file (openname, &file_size);
|
buffer = _rl_read_file (openname, &file_size);
|
||||||
|
free (openname);
|
||||||
|
|
||||||
if (buffer == 0)
|
if (buffer == 0)
|
||||||
return (errno);
|
return (errno);
|
||||||
|
|
||||||
|
@ -1338,7 +1348,34 @@ rl_variable_bind (name, value)
|
||||||
else
|
else
|
||||||
_rl_bell_preference = AUDIBLE_BELL;
|
_rl_bell_preference = AUDIBLE_BELL;
|
||||||
}
|
}
|
||||||
|
else if (_rl_stricmp (name, "isearch-terminators") == 0)
|
||||||
|
{
|
||||||
|
/* Isolate the value and translate it into a character string. */
|
||||||
|
int beg, end;
|
||||||
|
char *v;
|
||||||
|
|
||||||
|
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';
|
||||||
|
/* 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. */
|
/* For the time being, unknown variable names are simply ignored. */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1492,7 +1529,7 @@ _rl_get_keyname (key)
|
||||||
int key;
|
int key;
|
||||||
{
|
{
|
||||||
char *keyname;
|
char *keyname;
|
||||||
int i, c, v;
|
int i, c;
|
||||||
|
|
||||||
keyname = (char *)xmalloc (8);
|
keyname = (char *)xmalloc (8);
|
||||||
|
|
||||||
|
@ -1897,6 +1934,21 @@ rl_variable_dumper (print_readably)
|
||||||
fprintf (rl_outstream, "set keymap %s\n", kname ? kname : "none");
|
fprintf (rl_outstream, "set keymap %s\n", kname ? kname : "none");
|
||||||
else
|
else
|
||||||
fprintf (rl_outstream, "keymap is set to `%s'\n", kname ? kname : "none");
|
fprintf (rl_outstream, "keymap is set to `%s'\n", kname ? kname : "none");
|
||||||
|
|
||||||
|
/* isearch-terminators */
|
||||||
|
if (_rl_isearch_terminators)
|
||||||
|
{
|
||||||
|
char *disp;
|
||||||
|
|
||||||
|
disp = _rl_untranslate_macro_value (_rl_isearch_terminators);
|
||||||
|
|
||||||
|
if (print_readably)
|
||||||
|
fprintf (rl_outstream, "set isearch-terminators \"%s\"\n", disp);
|
||||||
|
else
|
||||||
|
fprintf (rl_outstream, "isearch-terminators is set to \"%s\"\n", disp);
|
||||||
|
|
||||||
|
free (disp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print all of the current variables and their values to
|
/* Print all of the current variables and their values to
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "rldefs.h"
|
#include "rldefs.h"
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
|
|
||||||
extern void readline_internal_startup ();
|
extern void readline_internal_setup ();
|
||||||
extern char *readline_internal_teardown ();
|
extern char *readline_internal_teardown ();
|
||||||
extern int readline_internal_char ();
|
extern int readline_internal_char ();
|
||||||
extern void _rl_init_line_state ();
|
extern void _rl_init_line_state ();
|
||||||
|
|
|
@ -85,6 +85,15 @@ extern void _rl_move_vert ();
|
||||||
extern int _rl_vis_botlin;
|
extern int _rl_vis_botlin;
|
||||||
extern int rl_display_fixed;
|
extern int rl_display_fixed;
|
||||||
|
|
||||||
|
/* 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 instead of actually doing the display.
|
||||||
|
It takes three arguments: (char **matches, int num_matches, int max_length)
|
||||||
|
where MATCHES is the array of strings that matched, NUM_MATCHES is the
|
||||||
|
number of strings in that array, and MAX_LENGTH is the length of the
|
||||||
|
longest string in that array. */
|
||||||
|
VFunction *rl_completion_display_matches_hook = (VFunction *)NULL;
|
||||||
|
|
||||||
/* Forward declarations for functions defined and used in this file. */
|
/* Forward declarations for functions defined and used in this file. */
|
||||||
char *filename_completion_function ();
|
char *filename_completion_function ();
|
||||||
char **completion_matches ();
|
char **completion_matches ();
|
||||||
|
@ -674,6 +683,7 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
|
||||||
we are doing filename completion and the application has defined a
|
we are doing filename completion and the application has defined a
|
||||||
filename dequoting function. */
|
filename dequoting function. */
|
||||||
temp = (char *)NULL;
|
temp = (char *)NULL;
|
||||||
|
|
||||||
if (found_quote && our_func == (Function *)filename_completion_function &&
|
if (found_quote && our_func == (Function *)filename_completion_function &&
|
||||||
rl_filename_dequoting_function)
|
rl_filename_dequoting_function)
|
||||||
{
|
{
|
||||||
|
@ -682,7 +692,7 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
|
||||||
text = temp; /* not freeing text is not a memory leak */
|
text = temp; /* not freeing text is not a memory leak */
|
||||||
}
|
}
|
||||||
|
|
||||||
matches = completion_matches (text, our_func);
|
matches = completion_matches (text, (CPFunction *)our_func);
|
||||||
FREE (temp);
|
FREE (temp);
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
@ -813,8 +823,7 @@ compute_lcd_of_matches (match_list, matches, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
postprocess_matches (text, matchesp, matching_filenames)
|
postprocess_matches (matchesp, matching_filenames)
|
||||||
char *text;
|
|
||||||
char ***matchesp;
|
char ***matchesp;
|
||||||
int matching_filenames;
|
int matching_filenames;
|
||||||
{
|
{
|
||||||
|
@ -845,7 +854,6 @@ postprocess_matches (text, matchesp, matching_filenames)
|
||||||
if (matches == 0 || matches[0] == 0)
|
if (matches == 0 || matches[0] == 0)
|
||||||
{
|
{
|
||||||
FREE (matches);
|
FREE (matches);
|
||||||
ding ();
|
|
||||||
*matchesp = (char **)0;
|
*matchesp = (char **)0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -857,7 +865,7 @@ postprocess_matches (text, matchesp, matching_filenames)
|
||||||
if (i > 1 && i < nmatch)
|
if (i > 1 && i < nmatch)
|
||||||
{
|
{
|
||||||
t = matches[0];
|
t = matches[0];
|
||||||
compute_lcd_of_matches (matches, i - 1, text);
|
compute_lcd_of_matches (matches, i - 1, t);
|
||||||
FREE (t);
|
FREE (t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -867,66 +875,19 @@ postprocess_matches (text, matchesp, matching_filenames)
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/* A convenience function for displaying a list of strings in
|
||||||
display_matches (matches)
|
columnar format on readline's output stream. MATCHES is the list
|
||||||
|
of strings, in argv format, LEN is the number of strings in MATCHES,
|
||||||
|
and MAX is the length of the longest string in MATCHES. */
|
||||||
|
void
|
||||||
|
rl_display_match_list (matches, len, max)
|
||||||
char **matches;
|
char **matches;
|
||||||
|
int len, max;
|
||||||
{
|
{
|
||||||
int len, count, limit, max, printed_len;
|
int count, limit, printed_len;
|
||||||
int i, j, k, l;
|
int i, j, k, l;
|
||||||
char *temp;
|
char *temp;
|
||||||
|
|
||||||
/* Move to the last visible line of a possibly-multiple-line command. */
|
|
||||||
_rl_move_vert (_rl_vis_botlin);
|
|
||||||
|
|
||||||
/* Handle simple case first. What if there is only one answer? */
|
|
||||||
if (matches[1] == 0)
|
|
||||||
{
|
|
||||||
temp = printable_part (matches[0]);
|
|
||||||
crlf ();
|
|
||||||
print_filename (temp, matches[0]);
|
|
||||||
crlf ();
|
|
||||||
#if 0
|
|
||||||
rl_on_new_line ();
|
|
||||||
#else
|
|
||||||
rl_forced_update_display ();
|
|
||||||
rl_display_fixed = 1;
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* There is more than one answer. Find out how many there are,
|
|
||||||
and find the maximum printed length of a single entry. */
|
|
||||||
for (max = 0, i = 1; matches[i]; i++)
|
|
||||||
{
|
|
||||||
temp = printable_part (matches[i]);
|
|
||||||
len = strlen (temp);
|
|
||||||
|
|
||||||
if (len > max)
|
|
||||||
max = len;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = i - 1;
|
|
||||||
|
|
||||||
/* If there are many items, then ask the user if she really wants to
|
|
||||||
see them all. */
|
|
||||||
if (len >= rl_completion_query_items)
|
|
||||||
{
|
|
||||||
crlf ();
|
|
||||||
fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
|
|
||||||
fflush (rl_outstream);
|
|
||||||
if (get_y_or_n () == 0)
|
|
||||||
{
|
|
||||||
crlf ();
|
|
||||||
#if 0
|
|
||||||
rl_on_new_line ();
|
|
||||||
#else
|
|
||||||
rl_forced_update_display ();
|
|
||||||
rl_display_fixed = 1;
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* How many items of MAX length can we fit in the screen window? */
|
/* How many items of MAX length can we fit in the screen window? */
|
||||||
max += 2;
|
max += 2;
|
||||||
limit = screenwidth / max;
|
limit = screenwidth / max;
|
||||||
|
@ -993,13 +954,85 @@ display_matches (matches)
|
||||||
}
|
}
|
||||||
crlf ();
|
crlf ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Display MATCHES, a list of matching filenames in argv format. This
|
||||||
|
handles the simple case -- a single match -- first. If there is more
|
||||||
|
than one match, we compute the number of strings in the list and the
|
||||||
|
length of the longest string, which will be needed by the display
|
||||||
|
function. If the application wants to handle displaying the list of
|
||||||
|
matches itself, it sets RL_COMPLETION_DISPLAY_MATCHES_HOOK to the
|
||||||
|
address of a function, and we just call it. If we're handling the
|
||||||
|
display ourselves, we just call rl_display_match_list. We also check
|
||||||
|
that the list of matches doesn't exceed the user-settable threshold,
|
||||||
|
and ask the user if he wants to see the list if there are more matches
|
||||||
|
than RL_COMPLETION_QUERY_ITEMS. */
|
||||||
|
static void
|
||||||
|
display_matches (matches)
|
||||||
|
char **matches;
|
||||||
|
{
|
||||||
|
int len, max, i;
|
||||||
|
char *temp;
|
||||||
|
|
||||||
|
/* Move to the last visible line of a possibly-multiple-line command. */
|
||||||
|
_rl_move_vert (_rl_vis_botlin);
|
||||||
|
|
||||||
|
/* Handle simple case first. What if there is only one answer? */
|
||||||
|
if (matches[1] == 0)
|
||||||
|
{
|
||||||
|
temp = printable_part (matches[0]);
|
||||||
|
crlf ();
|
||||||
|
print_filename (temp, matches[0]);
|
||||||
|
crlf ();
|
||||||
|
|
||||||
|
rl_forced_update_display ();
|
||||||
|
rl_display_fixed = 1;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* There is more than one answer. Find out how many there are,
|
||||||
|
and find the maximum printed length of a single entry. */
|
||||||
|
for (max = 0, i = 1; matches[i]; i++)
|
||||||
|
{
|
||||||
|
temp = printable_part (matches[i]);
|
||||||
|
len = strlen (temp);
|
||||||
|
|
||||||
|
if (len > max)
|
||||||
|
max = len;
|
||||||
|
}
|
||||||
|
|
||||||
|
len = i - 1;
|
||||||
|
|
||||||
|
/* If the caller has defined a display hook, then call that now. */
|
||||||
|
if (rl_completion_display_matches_hook)
|
||||||
|
{
|
||||||
|
(*rl_completion_display_matches_hook) (matches, len, max);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If there are many items, then ask the user if she really wants to
|
||||||
|
see them all. */
|
||||||
|
if (len >= rl_completion_query_items)
|
||||||
|
{
|
||||||
|
crlf ();
|
||||||
|
fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
|
||||||
|
fflush (rl_outstream);
|
||||||
|
if (get_y_or_n () == 0)
|
||||||
|
{
|
||||||
|
crlf ();
|
||||||
|
|
||||||
|
rl_forced_update_display ();
|
||||||
|
rl_display_fixed = 1;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rl_display_match_list (matches, len, max);
|
||||||
|
|
||||||
#if 0
|
|
||||||
rl_on_new_line ();
|
|
||||||
#else
|
|
||||||
rl_forced_update_display ();
|
rl_forced_update_display ();
|
||||||
rl_display_fixed = 1;
|
rl_display_fixed = 1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
@ -1026,11 +1059,8 @@ make_quoted_replacement (match, mtype, qc)
|
||||||
rl_filename_quoting_desired;
|
rl_filename_quoting_desired;
|
||||||
|
|
||||||
if (should_quote)
|
if (should_quote)
|
||||||
#if defined (SHELL)
|
should_quote = should_quote && (!qc || !*qc ||
|
||||||
should_quote = should_quote && (!qc || !*qc || *qc == '"' || *qc == '\'');
|
(rl_completer_quote_characters && strchr (rl_completer_quote_characters, *qc)));
|
||||||
#else /* !SHELL */
|
|
||||||
should_quote = should_quote && (!qc || !*qc);
|
|
||||||
#endif /* !SHELL */
|
|
||||||
|
|
||||||
if (should_quote)
|
if (should_quote)
|
||||||
{
|
{
|
||||||
|
@ -1168,6 +1198,17 @@ insert_all_matches (matches, point, qc)
|
||||||
rl_end_undo_group ();
|
rl_end_undo_group ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
free_match_list (matches)
|
||||||
|
char **matches;
|
||||||
|
{
|
||||||
|
register int i;
|
||||||
|
|
||||||
|
for (i = 0; matches[i]; i++)
|
||||||
|
free (matches[i]);
|
||||||
|
free (matches);
|
||||||
|
}
|
||||||
|
|
||||||
/* Complete the word at or before point.
|
/* Complete the word at or before point.
|
||||||
WHAT_TO_DO says what to do with the completion.
|
WHAT_TO_DO says what to do with the completion.
|
||||||
`?' means list the possible completions.
|
`?' means list the possible completions.
|
||||||
|
@ -1210,27 +1251,34 @@ rl_complete_internal (what_to_do)
|
||||||
|
|
||||||
text = rl_copy_text (start, end);
|
text = rl_copy_text (start, end);
|
||||||
matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
|
matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
|
||||||
|
free (text);
|
||||||
|
|
||||||
if (matches == 0)
|
if (matches == 0)
|
||||||
{
|
{
|
||||||
ding ();
|
ding ();
|
||||||
FREE (saved_line_buffer);
|
FREE (saved_line_buffer);
|
||||||
free (text);
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* If we are matching filenames, our_func will have been set to
|
/* If we are matching filenames, our_func will have been set to
|
||||||
filename_completion_function */
|
filename_completion_function */
|
||||||
i = our_func == (Function *)filename_completion_function;
|
i = our_func == (Function *)filename_completion_function;
|
||||||
if (postprocess_matches (text, &matches, i) == 0)
|
#else
|
||||||
|
/* If we are matching filenames, the attempted completion function will
|
||||||
|
have set rl_filename_completion_desired to a non-zero value. The basic
|
||||||
|
filename_completion_function does this. */
|
||||||
|
i = rl_filename_completion_desired;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (postprocess_matches (&matches, i) == 0)
|
||||||
{
|
{
|
||||||
|
ding ();
|
||||||
FREE (saved_line_buffer);
|
FREE (saved_line_buffer);
|
||||||
free (text);
|
completion_changed_buffer = 0;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (text);
|
|
||||||
|
|
||||||
switch (what_to_do)
|
switch (what_to_do)
|
||||||
{
|
{
|
||||||
case TAB:
|
case TAB:
|
||||||
|
@ -1277,9 +1325,7 @@ rl_complete_internal (what_to_do)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; matches[i]; i++)
|
free_match_list (matches);
|
||||||
free (matches[i]);
|
|
||||||
free (matches);
|
|
||||||
|
|
||||||
/* Check to see if the line has changed through all of this manipulation. */
|
/* Check to see if the line has changed through all of this manipulation. */
|
||||||
if (saved_line_buffer)
|
if (saved_line_buffer)
|
||||||
|
@ -1358,10 +1404,10 @@ completion_matches (text, entry_function)
|
||||||
character (usually `~'). */
|
character (usually `~'). */
|
||||||
char *
|
char *
|
||||||
username_completion_function (text, state)
|
username_completion_function (text, state)
|
||||||
int state;
|
|
||||||
char *text;
|
char *text;
|
||||||
|
int state;
|
||||||
{
|
{
|
||||||
#if defined (__GO32__) || defined (__WIN32__)
|
#if defined (__GO32__) || defined (__WIN32__) || defined (__OPENNT)
|
||||||
return (char *)NULL;
|
return (char *)NULL;
|
||||||
#else /* !__GO32__ */
|
#else /* !__GO32__ */
|
||||||
static char *username = (char *)NULL;
|
static char *username = (char *)NULL;
|
||||||
|
@ -1415,8 +1461,8 @@ username_completion_function (text, state)
|
||||||
completion for a command. */
|
completion for a command. */
|
||||||
char *
|
char *
|
||||||
filename_completion_function (text, state)
|
filename_completion_function (text, state)
|
||||||
int state;
|
|
||||||
char *text;
|
char *text;
|
||||||
|
int state;
|
||||||
{
|
{
|
||||||
static DIR *directory = (DIR *)NULL;
|
static DIR *directory = (DIR *)NULL;
|
||||||
static char *filename = (char *)NULL;
|
static char *filename = (char *)NULL;
|
||||||
|
@ -1574,7 +1620,7 @@ filename_completion_function (text, state)
|
||||||
strcpy (temp, users_dirname);
|
strcpy (temp, users_dirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (temp + dirlen, entry->d_name); /* strcat (temp, entry->d_name); */
|
strcpy (temp + dirlen, entry->d_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
temp = savestring (entry->d_name);
|
temp = savestring (entry->d_name);
|
||||||
|
@ -1649,10 +1695,17 @@ rl_menu_complete (count, ignore)
|
||||||
matches = gen_completion_matches (orig_text, orig_start, orig_end,
|
matches = gen_completion_matches (orig_text, orig_start, orig_end,
|
||||||
our_func, found_quote, quote_char);
|
our_func, found_quote, quote_char);
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* If we are matching filenames, our_func will have been set to
|
/* If we are matching filenames, our_func will have been set to
|
||||||
filename_completion_function */
|
filename_completion_function */
|
||||||
matching_filenames = our_func == (Function *)filename_completion_function;
|
matching_filenames = our_func == (Function *)filename_completion_function;
|
||||||
if (matches == 0 || postprocess_matches (orig_text, &matches, matching_filenames) == 0)
|
#else
|
||||||
|
/* If we are matching filenames, the attempted completion function will
|
||||||
|
have set rl_filename_completion_desired to a non-zero value. The basic
|
||||||
|
filename_completion_function does this. */
|
||||||
|
matching_filenames = rl_filename_completion_desired;
|
||||||
|
#endif
|
||||||
|
if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0)
|
||||||
{
|
{
|
||||||
ding ();
|
ding ();
|
||||||
FREE (matches);
|
FREE (matches);
|
||||||
|
@ -1686,7 +1739,7 @@ rl_menu_complete (count, ignore)
|
||||||
if (match_list_index < 0)
|
if (match_list_index < 0)
|
||||||
match_list_index += match_list_size;
|
match_list_index += match_list_size;
|
||||||
|
|
||||||
if (match_list_index == 0)
|
if (match_list_index == 0 && match_list_size > 1)
|
||||||
{
|
{
|
||||||
ding ();
|
ding ();
|
||||||
insert_match (orig_text, orig_start, MULT_MATCH, "e_char);
|
insert_match (orig_text, orig_start, MULT_MATCH, "e_char);
|
||||||
|
|
366
readline/configure
vendored
366
readline/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -4,8 +4,8 @@ dnl
|
||||||
dnl report bugs to chet@po.cwru.edu
|
dnl report bugs to chet@po.cwru.edu
|
||||||
dnl
|
dnl
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_REVISION([for Readline 2.2, version 2.07, from autoconf version] AC_ACVERSION)
|
AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION)
|
||||||
LIBVERSION=2.2
|
LIBVERSION=4.0
|
||||||
|
|
||||||
AC_INIT(readline.h)
|
AC_INIT(readline.h)
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
|
@ -34,7 +34,6 @@ test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_MINIX
|
AC_MINIX
|
||||||
|
|
||||||
|
|
||||||
dnl BEGIN changes for CYGNUS cross-building for Cygwin
|
dnl BEGIN changes for CYGNUS cross-building for Cygwin
|
||||||
|
|
||||||
dnl load up the cross-building cache file -- add more cases and cache
|
dnl load up the cross-building cache file -- add more cases and cache
|
||||||
|
@ -73,15 +72,20 @@ AC_SUBST(CC_FOR_BUILD)
|
||||||
|
|
||||||
dnl END changes for CYGNUS cross-building for Cygwin
|
dnl END changes for CYGNUS cross-building for Cygwin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
|
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
|
||||||
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
|
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
|
||||||
|
|
||||||
AC_PROG_GCC_TRADITIONAL
|
AC_PROG_GCC_TRADITIONAL
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
AC_CHECK_PROG(AR, ar, ar)
|
||||||
|
dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
|
||||||
|
dnl This allows people to set it when running configure or make
|
||||||
|
test -n "$ARFLAGS" || ARFLAGS="cr"
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
|
MAKE_SHELL=/bin/sh
|
||||||
|
AC_SUBST(MAKE_SHELL)
|
||||||
|
|
||||||
AC_RETSIGTYPE
|
AC_RETSIGTYPE
|
||||||
|
|
||||||
AC_HEADER_STAT
|
AC_HEADER_STAT
|
||||||
|
@ -129,6 +133,29 @@ case "$host_os" in
|
||||||
isc*) LOCAL_CFLAGS=-Disc386 ;;
|
isc*) LOCAL_CFLAGS=-Disc386 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# shared library configuration section
|
||||||
|
#
|
||||||
|
# Shared object configuration section. These values are generated by
|
||||||
|
# ${srcdir}/support/shobj-conf
|
||||||
|
#
|
||||||
|
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}`
|
||||||
|
AC_SUBST(SHOBJ_CC)
|
||||||
|
AC_SUBST(SHOBJ_CFLAGS)
|
||||||
|
AC_SUBST(SHOBJ_LD)
|
||||||
|
AC_SUBST(SHOBJ_LDFLAGS)
|
||||||
|
AC_SUBST(SHOBJ_XLDFLAGS)
|
||||||
|
AC_SUBST(SHOBJ_LIBS)
|
||||||
|
AC_SUBST(SHOBJ_STATUS)
|
||||||
|
AC_SUBST(SHLIB_STATUS)
|
||||||
|
AC_SUBST(SHLIB_XLDFLAGS)
|
||||||
|
AC_SUBST(SHLIB_LIBSUFF)
|
||||||
|
AC_SUBST(SHLIB_LIBVERSION)
|
||||||
|
AC_SUBST(SHLIB_LIBS)
|
||||||
|
AC_MSG_RESULT($SHLIB_STATUS)
|
||||||
|
fi
|
||||||
|
|
||||||
BUILD_DIR=`pwd`
|
BUILD_DIR=`pwd`
|
||||||
AC_SUBST(BUILD_DIR)
|
AC_SUBST(BUILD_DIR)
|
||||||
|
|
||||||
|
@ -137,6 +164,9 @@ AC_SUBST(LOCAL_CFLAGS)
|
||||||
AC_SUBST(LOCAL_LDFLAGS)
|
AC_SUBST(LOCAL_LDFLAGS)
|
||||||
AC_SUBST(LOCAL_DEFS)
|
AC_SUBST(LOCAL_DEFS)
|
||||||
|
|
||||||
|
AC_SUBST(AR)
|
||||||
|
AC_SUBST(ARFLAGS)
|
||||||
|
|
||||||
AC_SUBST(host_cpu)
|
AC_SUBST(host_cpu)
|
||||||
AC_SUBST(host_os)
|
AC_SUBST(host_os)
|
||||||
|
|
||||||
|
@ -144,7 +174,7 @@ AC_SUBST(LIBVERSION)
|
||||||
|
|
||||||
AC_SUBST(TERMCAP_LIB)
|
AC_SUBST(TERMCAP_LIB)
|
||||||
|
|
||||||
AC_OUTPUT([Makefile doc/Makefile examples/Makefile],
|
AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
|
||||||
[
|
[
|
||||||
# Makefile uses this timestamp file to record whether config.h is up to date.
|
# Makefile uses this timestamp file to record whether config.h is up to date.
|
||||||
echo > stamp-h
|
echo > stamp-h
|
||||||
|
|
|
@ -280,7 +280,7 @@ rl_expand_prompt (prompt)
|
||||||
if (local_prompt_prefix)
|
if (local_prompt_prefix)
|
||||||
free (local_prompt_prefix);
|
free (local_prompt_prefix);
|
||||||
local_prompt = local_prompt_prefix = (char *)0;
|
local_prompt = local_prompt_prefix = (char *)0;
|
||||||
last_invisible = 0;
|
last_invisible = visible_length = 0;
|
||||||
|
|
||||||
if (prompt == 0 || *prompt == 0)
|
if (prompt == 0 || *prompt == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -373,6 +373,13 @@ rl_redisplay ()
|
||||||
|
|
||||||
if (local_len > 0)
|
if (local_len > 0)
|
||||||
{
|
{
|
||||||
|
temp = local_len + out + 2;
|
||||||
|
if (temp >= line_size)
|
||||||
|
{
|
||||||
|
line_size = (temp + 1024) - (temp % 1024);
|
||||||
|
visible_line = xrealloc (visible_line, line_size);
|
||||||
|
line = invisible_line = xrealloc (invisible_line, line_size);
|
||||||
|
}
|
||||||
strncpy (line + out, local_prompt, local_len);
|
strncpy (line + out, local_prompt, local_len);
|
||||||
out += local_len;
|
out += local_len;
|
||||||
}
|
}
|
||||||
|
@ -399,6 +406,13 @@ rl_redisplay ()
|
||||||
}
|
}
|
||||||
|
|
||||||
pmtlen = strlen (prompt_this_line);
|
pmtlen = strlen (prompt_this_line);
|
||||||
|
temp = pmtlen + out + 2;
|
||||||
|
if (temp >= line_size)
|
||||||
|
{
|
||||||
|
line_size = (temp + 1024) - (temp % 1024);
|
||||||
|
visible_line = xrealloc (visible_line, line_size);
|
||||||
|
line = invisible_line = xrealloc (invisible_line, line_size);
|
||||||
|
}
|
||||||
strncpy (line + out, prompt_this_line, pmtlen);
|
strncpy (line + out, prompt_this_line, pmtlen);
|
||||||
out += pmtlen;
|
out += pmtlen;
|
||||||
line[out] = '\0';
|
line[out] = '\0';
|
||||||
|
@ -407,12 +421,12 @@ rl_redisplay ()
|
||||||
|
|
||||||
#define CHECK_LPOS() \
|
#define CHECK_LPOS() \
|
||||||
do { \
|
do { \
|
||||||
lpos++; \
|
lpos++; \
|
||||||
if (lpos >= screenwidth) \
|
if (lpos >= screenwidth) \
|
||||||
{ \
|
{ \
|
||||||
inv_lbreaks[++newlines] = out; \
|
inv_lbreaks[++newlines] = out; \
|
||||||
lpos = 0; \
|
lpos = 0; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* inv_lbreaks[i] is where line i starts in the buffer. */
|
/* inv_lbreaks[i] is where line i starts in the buffer. */
|
||||||
|
@ -481,7 +495,12 @@ rl_redisplay ()
|
||||||
else if (c == '\t')
|
else if (c == '\t')
|
||||||
{
|
{
|
||||||
register int temp, newout;
|
register int temp, newout;
|
||||||
|
|
||||||
|
#if 0
|
||||||
newout = (out | (int)7) + 1;
|
newout = (out | (int)7) + 1;
|
||||||
|
#else
|
||||||
|
newout = out + 8 - lpos % 8;
|
||||||
|
#endif
|
||||||
temp = newout - out;
|
temp = newout - out;
|
||||||
if (lpos + temp >= screenwidth)
|
if (lpos + temp >= screenwidth)
|
||||||
{
|
{
|
||||||
|
@ -501,11 +520,11 @@ rl_redisplay ()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
|
else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
|
||||||
{
|
{
|
||||||
line[out++] = '\0'; /* XXX - sentinel */
|
line[out++] = '\0'; /* XXX - sentinel */
|
||||||
inv_lbreaks[++newlines] = out;
|
inv_lbreaks[++newlines] = out;
|
||||||
lpos = 0;
|
lpos = 0;
|
||||||
}
|
}
|
||||||
else if (CTRL_CHAR (c) || c == RUBOUT)
|
else if (CTRL_CHAR (c) || c == RUBOUT)
|
||||||
{
|
{
|
||||||
line[out++] = '^';
|
line[out++] = '^';
|
||||||
|
@ -616,11 +635,11 @@ rl_redisplay ()
|
||||||
{
|
{
|
||||||
_rl_move_vert (cursor_linenum);
|
_rl_move_vert (cursor_linenum);
|
||||||
/* If we moved up to the line with the prompt using term_up,
|
/* If we moved up to the line with the prompt using term_up,
|
||||||
the physical cursor position on the screen stays the same,
|
the physical cursor position on the screen stays the same,
|
||||||
but the buffer position needs to be adjusted to account
|
but the buffer position needs to be adjusted to account
|
||||||
for invisible characters. */
|
for invisible characters. */
|
||||||
if (cursor_linenum == 0 && wrap_offset)
|
if (cursor_linenum == 0 && wrap_offset)
|
||||||
_rl_last_c_pos += wrap_offset;
|
_rl_last_c_pos += wrap_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We have to reprint the prompt if it contains invisible
|
/* We have to reprint the prompt if it contains invisible
|
||||||
|
@ -677,16 +696,16 @@ rl_redisplay ()
|
||||||
ndisp = c_pos - wrap_offset;
|
ndisp = c_pos - wrap_offset;
|
||||||
nleft = visible_length + wrap_offset;
|
nleft = visible_length + wrap_offset;
|
||||||
/* Where the new cursor position will be on the screen. This can be
|
/* Where the new cursor position will be on the screen. This can be
|
||||||
longer than SCREENWIDTH; if it is, lmargin will be adjusted. */
|
longer than SCREENWIDTH; if it is, lmargin will be adjusted. */
|
||||||
phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset);
|
phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset);
|
||||||
t = screenwidth / 3;
|
t = screenwidth / 3;
|
||||||
|
|
||||||
/* If the number of characters had already exceeded the screenwidth,
|
/* If the number of characters had already exceeded the screenwidth,
|
||||||
last_lmargin will be > 0. */
|
last_lmargin will be > 0. */
|
||||||
|
|
||||||
/* If the number of characters to be displayed is more than the screen
|
/* If the number of characters to be displayed is more than the screen
|
||||||
width, compute the starting offset so that the cursor is about
|
width, compute the starting offset so that the cursor is about
|
||||||
two-thirds of the way across the screen. */
|
two-thirds of the way across the screen. */
|
||||||
if (phys_c_pos > screenwidth - 2)
|
if (phys_c_pos > screenwidth - 2)
|
||||||
{
|
{
|
||||||
lmargin = c_pos - (2 * t);
|
lmargin = c_pos - (2 * t);
|
||||||
|
@ -698,7 +717,7 @@ rl_redisplay ()
|
||||||
lmargin = nleft;
|
lmargin = nleft;
|
||||||
}
|
}
|
||||||
else if (ndisp < screenwidth - 2) /* XXX - was -1 */
|
else if (ndisp < screenwidth - 2) /* XXX - was -1 */
|
||||||
lmargin = 0;
|
lmargin = 0;
|
||||||
else if (phys_c_pos < 1)
|
else if (phys_c_pos < 1)
|
||||||
{
|
{
|
||||||
/* If we are moving back towards the beginning of the line and
|
/* If we are moving back towards the beginning of the line and
|
||||||
|
@ -708,7 +727,7 @@ rl_redisplay ()
|
||||||
lmargin = nleft;
|
lmargin = nleft;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lmargin = last_lmargin;
|
lmargin = last_lmargin;
|
||||||
|
|
||||||
/* If the first character on the screen isn't the first character
|
/* If the first character on the screen isn't the first character
|
||||||
in the display line, indicate this with a special character. */
|
in the display line, indicate this with a special character. */
|
||||||
|
@ -716,12 +735,12 @@ rl_redisplay ()
|
||||||
line[lmargin] = '<';
|
line[lmargin] = '<';
|
||||||
|
|
||||||
/* If SCREENWIDTH characters starting at LMARGIN do not encompass
|
/* If SCREENWIDTH characters starting at LMARGIN do not encompass
|
||||||
the whole line, indicate that with a special characters at the
|
the whole line, indicate that with a special character at the
|
||||||
right edge of the screen. If LMARGIN is 0, we need to take the
|
right edge of the screen. If LMARGIN is 0, we need to take the
|
||||||
wrap offset into account. */
|
wrap offset into account. */
|
||||||
t = lmargin + M_OFFSET (lmargin, wrap_offset) + screenwidth;
|
t = lmargin + M_OFFSET (lmargin, wrap_offset) + screenwidth;
|
||||||
if (t < out)
|
if (t < out)
|
||||||
line[t - 1] = '>';
|
line[t - 1] = '>';
|
||||||
|
|
||||||
if (!rl_display_fixed || forced_display || lmargin != last_lmargin)
|
if (!rl_display_fixed || forced_display || lmargin != last_lmargin)
|
||||||
{
|
{
|
||||||
|
@ -786,7 +805,7 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
|
||||||
\new first difference
|
\new first difference
|
||||||
|
|
||||||
All are character pointers for the sake of speed. Special cases for
|
All are character pointers for the sake of speed. Special cases for
|
||||||
no differences, as well as for end of line additions must be handeled.
|
no differences, as well as for end of line additions must be handled.
|
||||||
|
|
||||||
Could be made even smarter, but this works well enough */
|
Could be made even smarter, but this works well enough */
|
||||||
static void
|
static void
|
||||||
|
@ -814,7 +833,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||||
_rl_last_c_pos = 1; /* XXX */
|
_rl_last_c_pos = 1; /* XXX */
|
||||||
_rl_last_v_pos++;
|
_rl_last_v_pos++;
|
||||||
if (old[0] && new[0])
|
if (old[0] && new[0])
|
||||||
old[0] = new[0];
|
old[0] = new[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find first difference. */
|
/* Find first difference. */
|
||||||
|
@ -903,10 +922,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||||
lendiff needs to be adjusted. */
|
lendiff needs to be adjusted. */
|
||||||
if (current_line == 0 && !_rl_horizontal_scroll_mode &&
|
if (current_line == 0 && !_rl_horizontal_scroll_mode &&
|
||||||
current_invis_chars != visible_wrap_offset)
|
current_invis_chars != visible_wrap_offset)
|
||||||
{
|
lendiff += visible_wrap_offset - current_invis_chars;
|
||||||
temp = visible_wrap_offset - current_invis_chars;
|
|
||||||
lendiff += temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Insert (diff (len (old), len (new)) ch. */
|
/* Insert (diff (len (old), len (new)) ch. */
|
||||||
temp = ne - nfd;
|
temp = ne - nfd;
|
||||||
|
@ -935,7 +951,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||||
/* At the end of a line the characters do not have to
|
/* At the end of a line the characters do not have to
|
||||||
be "inserted". They can just be placed on the screen. */
|
be "inserted". They can just be placed on the screen. */
|
||||||
/* However, this screws up the rest of this block, which
|
/* However, this screws up the rest of this block, which
|
||||||
assumes you've done the insert because you can. */
|
assumes you've done the insert because you can. */
|
||||||
_rl_output_some_chars (nfd, lendiff);
|
_rl_output_some_chars (nfd, lendiff);
|
||||||
_rl_last_c_pos += lendiff;
|
_rl_last_c_pos += lendiff;
|
||||||
}
|
}
|
||||||
|
@ -995,10 +1011,13 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||||
_rl_last_c_pos += temp;
|
_rl_last_c_pos += temp;
|
||||||
}
|
}
|
||||||
lendiff = (oe - old) - (ne - new);
|
lendiff = (oe - old) - (ne - new);
|
||||||
if (_rl_term_autowrap && current_line < inv_botlin)
|
if (lendiff)
|
||||||
space_to_eol (lendiff);
|
{
|
||||||
else
|
if (_rl_term_autowrap && current_line < inv_botlin)
|
||||||
_rl_clear_to_eol (lendiff);
|
space_to_eol (lendiff);
|
||||||
|
else
|
||||||
|
_rl_clear_to_eol (lendiff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1027,7 +1046,7 @@ rl_forced_update_display ()
|
||||||
register char *temp = visible_line;
|
register char *temp = visible_line;
|
||||||
|
|
||||||
while (*temp)
|
while (*temp)
|
||||||
*temp++ = '\0';
|
*temp++ = '\0';
|
||||||
}
|
}
|
||||||
rl_on_new_line ();
|
rl_on_new_line ();
|
||||||
forced_display++;
|
forced_display++;
|
||||||
|
@ -1088,7 +1107,7 @@ _rl_move_cursor_relative (new, data)
|
||||||
putc (data[i], rl_outstream);
|
putc (data[i], rl_outstream);
|
||||||
#endif /* HACK_TERMCAP_MOTION */
|
#endif /* HACK_TERMCAP_MOTION */
|
||||||
}
|
}
|
||||||
else if (_rl_last_c_pos != new)
|
else if (_rl_last_c_pos > new)
|
||||||
_rl_backspace (_rl_last_c_pos - new);
|
_rl_backspace (_rl_last_c_pos - new);
|
||||||
_rl_last_c_pos = new;
|
_rl_last_c_pos = new;
|
||||||
}
|
}
|
||||||
|
@ -1253,7 +1272,7 @@ static int saved_last_invisible;
|
||||||
static int saved_visible_length;
|
static int saved_visible_length;
|
||||||
|
|
||||||
void
|
void
|
||||||
_rl_save_prompt ()
|
rl_save_prompt ()
|
||||||
{
|
{
|
||||||
saved_local_prompt = local_prompt;
|
saved_local_prompt = local_prompt;
|
||||||
saved_local_prefix = local_prompt_prefix;
|
saved_local_prefix = local_prompt_prefix;
|
||||||
|
@ -1265,7 +1284,7 @@ _rl_save_prompt ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_rl_restore_prompt ()
|
rl_restore_prompt ()
|
||||||
{
|
{
|
||||||
if (local_prompt)
|
if (local_prompt)
|
||||||
free (local_prompt);
|
free (local_prompt);
|
||||||
|
@ -1285,14 +1304,14 @@ _rl_make_prompt_for_search (pchar)
|
||||||
int len;
|
int len;
|
||||||
char *pmt;
|
char *pmt;
|
||||||
|
|
||||||
_rl_save_prompt ();
|
rl_save_prompt ();
|
||||||
|
|
||||||
if (saved_local_prompt == 0)
|
if (saved_local_prompt == 0)
|
||||||
{
|
{
|
||||||
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
|
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
|
||||||
pmt = xmalloc (len + 2);
|
pmt = xmalloc (len + 2);
|
||||||
if (len)
|
if (len)
|
||||||
strcpy (pmt, rl_prompt);
|
strcpy (pmt, rl_prompt);
|
||||||
pmt[len] = pchar;
|
pmt[len] = pchar;
|
||||||
pmt[len+1] = '\0';
|
pmt[len+1] = '\0';
|
||||||
}
|
}
|
||||||
|
@ -1301,7 +1320,7 @@ _rl_make_prompt_for_search (pchar)
|
||||||
len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
|
len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
|
||||||
pmt = xmalloc (len + 2);
|
pmt = xmalloc (len + 2);
|
||||||
if (len)
|
if (len)
|
||||||
strcpy (pmt, saved_local_prompt);
|
strcpy (pmt, saved_local_prompt);
|
||||||
pmt[len] = pchar;
|
pmt[len] = pchar;
|
||||||
pmt[len+1] = '\0';
|
pmt[len+1] = '\0';
|
||||||
local_prompt = savestring (pmt);
|
local_prompt = savestring (pmt);
|
||||||
|
@ -1561,6 +1580,15 @@ _rl_clean_up_for_exit ()
|
||||||
_rl_move_vert (_rl_vis_botlin);
|
_rl_move_vert (_rl_vis_botlin);
|
||||||
_rl_vis_botlin = 0;
|
_rl_vis_botlin = 0;
|
||||||
fflush (rl_outstream);
|
fflush (rl_outstream);
|
||||||
rl_restart_output ();
|
rl_restart_output (1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_rl_erase_entire_line ()
|
||||||
|
{
|
||||||
|
cr ();
|
||||||
|
_rl_clear_to_eol (0);
|
||||||
|
cr ();
|
||||||
|
fflush (rl_outstream);
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ infodir = @infodir@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
man3dir = $(mandir)/man3
|
man3dir = $(mandir)/man3
|
||||||
|
|
||||||
|
SHELL = @MAKE_SHELL@
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
TEXINPUTDIR = $(srcdir)
|
TEXINPUTDIR = $(srcdir)
|
||||||
|
@ -25,9 +26,9 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
|
||||||
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
|
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
|
||||||
$(srcdir)/rltech.texinfo
|
$(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo
|
||||||
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
|
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
|
||||||
$(srcdir)/hstech.texinfo
|
$(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo
|
||||||
|
|
||||||
# This should be a program that converts troff to an ascii-readable format
|
# This should be a program that converts troff to an ascii-readable format
|
||||||
NROFF = groff -Tascii
|
NROFF = groff -Tascii
|
||||||
|
@ -42,6 +43,8 @@ HTMLOBJ = readline.html history.html
|
||||||
HTMLTOC = readline_toc.html history_toc.html
|
HTMLTOC = readline_toc.html history_toc.html
|
||||||
TEXTOBJ = readline.0
|
TEXTOBJ = readline.0
|
||||||
|
|
||||||
|
INTERMEDIATE_OBJ = rlman.dvi hist.dvi
|
||||||
|
|
||||||
CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
|
CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
|
||||||
|
|
||||||
.SUFFIXES: .0 .3 .ps .txt .dvi
|
.SUFFIXES: .0 .3 .ps .txt .dvi
|
||||||
|
@ -76,16 +79,14 @@ history.ps: history.dvi
|
||||||
$(DVIPS) history.dvi
|
$(DVIPS) history.dvi
|
||||||
|
|
||||||
readline.html: ${RLSRC}
|
readline.html: ${RLSRC}
|
||||||
$(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
|
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
|
||||||
sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html
|
sed -e 's:rlman.html:readline.html:' rlman.html > readline.html
|
||||||
sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html
|
$(RM) rlman.html
|
||||||
$(RM) rlman.html rlman_toc.html
|
|
||||||
|
|
||||||
history.html: ${HISTSRC}
|
history.html: ${HISTSRC}
|
||||||
$(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
|
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
|
||||||
sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html
|
sed -e 's:hist.html:history.html:' hist.html > history.html
|
||||||
sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html
|
$(RM) hist.html
|
||||||
$(RM) hist.html hist_toc.html
|
|
||||||
|
|
||||||
info: $(INFOOBJ)
|
info: $(INFOOBJ)
|
||||||
dvi: $(DVIOBJ)
|
dvi: $(DVIOBJ)
|
||||||
|
@ -101,18 +102,20 @@ clean:
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
$(RM) $(CREATED_DOCS)
|
$(RM) $(CREATED_DOCS)
|
||||||
|
$(RM) $(INTERMEDIATE_OBJ)
|
||||||
$(RM) Makefile
|
$(RM) Makefile
|
||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
maintainer-clean: clean
|
maintainer-clean: clean
|
||||||
$(RM) $(CREATED_DOCS)
|
$(RM) $(CREATED_DOCS)
|
||||||
|
$(RM) $(INTERMEDIATE_OBJ)
|
||||||
$(RM) Makefile
|
$(RM) Makefile
|
||||||
|
|
||||||
installdirs: $(top_srcdir)/support/mkdirs
|
installdirs: $(top_srcdir)/support/mkdirs
|
||||||
-$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
|
-$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
|
||||||
|
|
||||||
install: installdirs info
|
install: installdirs
|
||||||
if test -f readline.info; then \
|
if test -f readline.info; then \
|
||||||
${INSTALL_DATA} readline.info $(infodir)/readline.info; \
|
${INSTALL_DATA} readline.info $(infodir)/readline.info; \
|
||||||
else \
|
else \
|
||||||
|
|
|
@ -6,26 +6,19 @@
|
||||||
|
|
||||||
@setchapternewpage odd
|
@setchapternewpage odd
|
||||||
|
|
||||||
@ignore
|
@include manvers.texinfo
|
||||||
last change: Thu Apr 2 14:38:22 EST 1998
|
|
||||||
@end ignore
|
|
||||||
|
|
||||||
@set EDITION 2.2
|
|
||||||
@set VERSION 2.2
|
|
||||||
@set UPDATED 2 April 1998
|
|
||||||
@set UPDATE-MONTH April 1998
|
|
||||||
|
|
||||||
|
@ifinfo
|
||||||
@dircategory Libraries
|
@dircategory Libraries
|
||||||
@direntry
|
@direntry
|
||||||
* History: (history). The GNU history library API
|
* History: (history). The GNU history library API
|
||||||
@end direntry
|
@end direntry
|
||||||
|
|
||||||
@ifinfo
|
|
||||||
This document describes the GNU History library, a programming tool that
|
This document describes the GNU History library, a programming tool that
|
||||||
provides a consistent user interface for recalling lines of previously
|
provides a consistent user interface for recalling lines of previously
|
||||||
typed input.
|
typed input.
|
||||||
|
|
||||||
Copyright (C) 1988, 1991, 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
|
Copyright (C) 1988-1999 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to make and distribute verbatim copies of
|
Permission is granted to make and distribute verbatim copies of
|
||||||
this manual provided the copyright notice and this permission notice
|
this manual provided the copyright notice and this permission notice
|
||||||
|
@ -46,7 +39,7 @@ notice identical to this one.
|
||||||
Permission is granted to copy and distribute translations of this manual
|
Permission is granted to copy and distribute translations of this manual
|
||||||
into another language, under the above conditions for modified versions,
|
into another language, under the above conditions for modified versions,
|
||||||
except that this permission notice may be stated in a translation approved
|
except that this permission notice may be stated in a translation approved
|
||||||
by the Foundation.
|
by the Free Software Foundation.
|
||||||
@end ifinfo
|
@end ifinfo
|
||||||
|
|
||||||
@titlepage
|
@titlepage
|
||||||
|
@ -77,10 +70,10 @@ notice identical to this one.
|
||||||
Permission is granted to copy and distribute translations of this manual
|
Permission is granted to copy and distribute translations of this manual
|
||||||
into another language, under the above conditions for modified versions,
|
into another language, under the above conditions for modified versions,
|
||||||
except that this permission notice may be stated in a translation approved
|
except that this permission notice may be stated in a translation approved
|
||||||
by the Foundation.
|
by the Free Software Foundation.
|
||||||
|
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
|
||||||
@end titlepage
|
@end titlepage
|
||||||
|
|
||||||
@ifinfo
|
@ifinfo
|
||||||
|
|
|
@ -117,7 +117,7 @@ history list and history file.
|
||||||
@table @code
|
@table @code
|
||||||
|
|
||||||
@item fc
|
@item fc
|
||||||
@comment btindex fc
|
@btindex fc
|
||||||
@example
|
@example
|
||||||
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
|
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
|
||||||
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
|
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
|
||||||
|
@ -149,7 +149,7 @@ that typing @samp{r cc} runs the last command beginning with @code{cc}
|
||||||
and typing @samp{r} re-executes the last command (@pxref{Aliases}).
|
and typing @samp{r} re-executes the last command (@pxref{Aliases}).
|
||||||
|
|
||||||
@item history
|
@item history
|
||||||
@comment btindex history
|
@btindex history
|
||||||
@example
|
@example
|
||||||
history [-c] [@var{n}]
|
history [-c] [@var{n}]
|
||||||
history [-anrw] [@var{filename}]
|
history [-anrw] [@var{filename}]
|
||||||
|
|
6
readline/doc/manvers.texinfo
Normal file
6
readline/doc/manvers.texinfo
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
@set EDITION 4.0
|
||||||
|
@set VERSION 4.0
|
||||||
|
@set UPDATED 31 December 1998
|
||||||
|
@set UPDATE-MONTH December 1998
|
||||||
|
|
||||||
|
@set LASTCHANGE Thu Dec 31 10:17:05 EST 1998
|
|
@ -8,6 +8,7 @@ NNAAMMEE
|
||||||
readline - get a line from a user with editing
|
readline - get a line from a user with editing
|
||||||
|
|
||||||
SSYYNNOOPPSSIISS
|
SSYYNNOOPPSSIISS
|
||||||
|
##iinncclluuddee <<ssttddiioo..hh>>
|
||||||
##iinncclluuddee <<rreeaaddlliinnee..hh>>
|
##iinncclluuddee <<rreeaaddlliinnee..hh>>
|
||||||
##iinncclluuddee <<hhiissttoorryy..hh>>
|
##iinncclluuddee <<hhiissttoorryy..hh>>
|
||||||
|
|
||||||
|
@ -57,11 +58,10 @@ NNOOTTAATTIIOONN
|
||||||
ments deviates from this are noted.
|
ments deviates from this are noted.
|
||||||
|
|
||||||
When a command is described as _k_i_l_l_i_n_g text, the text
|
When a command is described as _k_i_l_l_i_n_g text, the text
|
||||||
deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 1
|
GNU 1998 Dec 31 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ GNU 1998 Feb 19 1
|
||||||
READLINE(3) READLINE(3)
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
|
||||||
The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive
|
The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive
|
||||||
kills cause the text to be accumulated into one unit,
|
kills cause the text to be accumulated into one unit,
|
||||||
which can be yanked all at once. Commands which do not
|
which can be yanked all at once. Commands which do not
|
||||||
|
@ -126,8 +127,7 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 2
|
||||||
GNU 1998 Feb 19 2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 3
|
GNU 1998 Dec 31 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 4
|
GNU 1998 Dec 31 4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,6 +274,18 @@ READLINE(3) READLINE(3)
|
||||||
for display, scrolling the input horizontally on a
|
for display, scrolling the input horizontally on a
|
||||||
single screen line when it becomes longer than the
|
single screen line when it becomes longer than the
|
||||||
screen width rather than wrapping to a new line.
|
screen width rather than wrapping to a new line.
|
||||||
|
iinnppuutt--mmeettaa ((OOffff))
|
||||||
|
If set to OOnn, readline will enable eight-bit input
|
||||||
|
(that is, it will not strip the high bit from the
|
||||||
|
characters it reads), regardless of what the termi-
|
||||||
|
nal claims it can support. The name mmeettaa--ffllaagg is a
|
||||||
|
synonym for this variable.
|
||||||
|
iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ''''))
|
||||||
|
The string of characters that should terminate an
|
||||||
|
incremental search without subsequently executing
|
||||||
|
the character as a command. If this variable has
|
||||||
|
not been given a value, the characters _E_S_C and _C_-_J
|
||||||
|
will terminate an incremental search.
|
||||||
kkeeyymmaapp ((eemmaaccss))
|
kkeeyymmaapp ((eemmaaccss))
|
||||||
Set the current readline keymap. The set of legal
|
Set the current readline keymap. The set of legal
|
||||||
keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_,
|
keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_,
|
||||||
|
@ -288,44 +300,32 @@ READLINE(3) READLINE(3)
|
||||||
mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
|
mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
|
||||||
If set to OOnn, history lines that have been modified
|
If set to OOnn, history lines that have been modified
|
||||||
are displayed with a preceding asterisk (**).
|
are displayed with a preceding asterisk (**).
|
||||||
mmeettaa--ffllaagg ((OOffff))
|
|
||||||
If set to OOnn, readline will enable eight-bit input
|
|
||||||
(that is, it will not strip the high bit from the
|
|
||||||
characters it reads), regardless of what the termi-
|
|
||||||
nal claims it can support.
|
|
||||||
oouuttppuutt--mmeettaa ((OOffff))
|
oouuttppuutt--mmeettaa ((OOffff))
|
||||||
If set to OOnn, readline will display characters with
|
If set to OOnn, readline will display characters with
|
||||||
the eighth bit set directly rather than as a meta-
|
the eighth bit set directly rather than as a meta-
|
||||||
prefixed escape sequence.
|
prefixed escape sequence.
|
||||||
pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff))
|
pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff))
|
||||||
If set to OOnn, readline will display completions
|
If set to OOnn, readline will display completions
|
||||||
with matches sorted horizontally in alphabetical
|
with matches sorted horizontally in alphabetical
|
||||||
order, rather than down the screen.
|
order, rather than down the screen.
|
||||||
sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
|
sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
|
||||||
This alters the default behavior of the completion
|
This alters the default behavior of the completion
|
||||||
functions. If set to oonn, words which have more
|
functions. If set to oonn, words which have more
|
||||||
than one possible completion cause the matches to
|
than one possible completion cause the matches to
|
||||||
be listed immediately instead of ringing the bell.
|
be listed immediately instead of ringing the bell.
|
||||||
vviissiibbllee--ssttaattss ((OOffff))
|
vviissiibbllee--ssttaattss ((OOffff))
|
||||||
If set to OOnn, a character denoting a file's type as
|
If set to OOnn, a character denoting a file's type as
|
||||||
reported by ssttaatt(2) is appended to the filename
|
reported by ssttaatt(2) is appended to the filename
|
||||||
when listing possible completions.
|
when listing possible completions.
|
||||||
|
|
||||||
CCoonnddiittiioonnaall CCoonnssttrruuccttss
|
CCoonnddiittiioonnaall CCoonnssttrruuccttss
|
||||||
Readline implements a facility similar in spirit to the
|
Readline implements a facility similar in spirit to the
|
||||||
conditional compilation features of the C preprocessor
|
conditional compilation features of the C preprocessor
|
||||||
which allows key bindings and variable settings to be per-
|
which allows key bindings and variable settings to be
|
||||||
formed as the result of tests. There are four parser
|
|
||||||
directives used.
|
|
||||||
|
|
||||||
$$iiff The $$iiff 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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 5
|
GNU 1998 Dec 31 5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -334,21 +334,28 @@ GNU 1998 Feb 19 5
|
||||||
READLINE(3) READLINE(3)
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
performed as the result of tests. There are four parser
|
||||||
|
directives used.
|
||||||
|
|
||||||
|
$$iiff The $$iiff 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.
|
are required to isolate it.
|
||||||
|
|
||||||
mmooddee The mmooddee== form of the $$iiff directive is used
|
mmooddee The mmooddee== form of the $$iiff directive is used
|
||||||
to test whether readline is in emacs or vi
|
to test whether readline is in emacs or vi
|
||||||
mode. This may be used in conjunction with
|
mode. This may be used in conjunction with
|
||||||
the sseett kkeeyymmaapp command, for instance, to set
|
the sseett kkeeyymmaapp command, for instance, to set
|
||||||
bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
|
bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
|
||||||
_c_t_l_x keymaps only if readline is starting
|
_c_t_l_x keymaps only if readline is starting
|
||||||
out in emacs mode.
|
out in emacs mode.
|
||||||
|
|
||||||
tteerrmm The tteerrmm== form may be used to include termi-
|
tteerrmm The tteerrmm== form may be used to include termi-
|
||||||
nal-specific key bindings, perhaps to bind
|
nal-specific key bindings, perhaps to bind
|
||||||
the key sequences output by the terminal's
|
the key sequences output by the terminal's
|
||||||
function keys. The word on the right side
|
function keys. The word on the right side
|
||||||
of the == is tested against the full name of
|
of the == is tested against the full name of
|
||||||
the terminal and the portion of the terminal
|
the terminal and the portion of the terminal
|
||||||
name before the first --. This allows _s_u_n to
|
name before the first --. This allows _s_u_n to
|
||||||
match both _s_u_n and _s_u_n_-_c_m_d, for instance.
|
match both _s_u_n and _s_u_n_-_c_m_d, for instance.
|
||||||
|
@ -357,12 +364,12 @@ READLINE(3) READLINE(3)
|
||||||
The aapppplliiccaattiioonn construct is used to include
|
The aapppplliiccaattiioonn construct is used to include
|
||||||
application-specific settings. Each program
|
application-specific settings. Each program
|
||||||
using the readline library sets the _a_p_p_l_i_c_a_-
|
using the readline library sets the _a_p_p_l_i_c_a_-
|
||||||
_t_i_o_n _n_a_m_e, and an initialization file can
|
_t_i_o_n _n_a_m_e, and an initialization file can
|
||||||
test for a particular value. This could be
|
test for a particular value. This could be
|
||||||
used to bind key sequences to functions use-
|
used to bind key sequences to functions use-
|
||||||
ful for a specific program. For instance,
|
ful for a specific program. For instance,
|
||||||
the following command adds a key sequence
|
the following command adds a key sequence
|
||||||
that quotes the current or previous word in
|
that quotes the current or previous word in
|
||||||
Bash:
|
Bash:
|
||||||
|
|
||||||
$$iiff bash
|
$$iiff bash
|
||||||
|
@ -373,25 +380,18 @@ READLINE(3) READLINE(3)
|
||||||
$$eennddiiff This command, as seen in the previous example, ter-
|
$$eennddiiff This command, as seen in the previous example, ter-
|
||||||
minates an $$iiff command.
|
minates an $$iiff command.
|
||||||
|
|
||||||
$$eellssee Commands in this branch of the $$iiff directive are
|
$$eellssee Commands in this branch of the $$iiff directive are
|
||||||
executed if the test fails.
|
executed if the test fails.
|
||||||
|
|
||||||
$$iinncclluuddee
|
$$iinncclluuddee
|
||||||
This directive takes a single filename as an argu-
|
This directive takes a single filename as an argu-
|
||||||
ment and reads commands and bindings from that
|
ment and reads commands and bindings from that
|
||||||
file. For example, the following directive would
|
file. For example, the following directive would
|
||||||
read _/_e_t_c_/_i_n_p_u_t_r_c:
|
read _/_e_t_c_/_i_n_p_u_t_r_c:
|
||||||
|
|
||||||
$$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c
|
|
||||||
|
|
||||||
SSEEAARRCCHHIINNGG
|
|
||||||
Readline provides commands for searching through the com-
|
|
||||||
mand history for lines containing a specified string.
|
|
||||||
There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 6
|
||||||
GNU 1998 Feb 19 6
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -400,36 +400,44 @@ GNU 1998 Feb 19 6
|
||||||
READLINE(3) READLINE(3)
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
_i_n_c_r_e_m_e_n_t_a_l.
|
$$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c
|
||||||
|
|
||||||
Incremental searches begin before the user has finished
|
SSEEAARRCCHHIINNGG
|
||||||
|
Readline provides commands for searching through the com-
|
||||||
|
mand history for lines containing a specified string.
|
||||||
|
There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_-
|
||||||
|
_t_a_l.
|
||||||
|
|
||||||
|
Incremental searches begin before the user has finished
|
||||||
typing the search string. As each character of the search
|
typing the search string. As each character of the search
|
||||||
string is typed, readline displays the next entry from the
|
string is typed, readline displays the next entry from the
|
||||||
history matching the string typed so far. An incremental
|
history matching the string typed so far. An incremental
|
||||||
search requires only as many characters as needed to find
|
search requires only as many characters as needed to find
|
||||||
the desired history entry. The Escape character is used
|
the desired history entry. The characters present in the
|
||||||
to terminate an incremental search. Control-J will also
|
value of the _i_s_e_a_r_c_h_-_t_e_r_m_i_n_a_t_o_r_s variable are used to ter-
|
||||||
terminate the search. Control-G will abort an incremental
|
minate an incremental search. If that variable has not
|
||||||
search and restore the original line. When the search is
|
been assigned a value the Escape and Control-J characters
|
||||||
terminated, the history entry containing the search string
|
will terminate an incremental search. Control-G will
|
||||||
becomes the current line. To find other matching entries
|
abort an incremental search and restore the original line.
|
||||||
in the history list, type Control-S or Control-R as appro-
|
When the search is terminated, the history entry contain-
|
||||||
priate. This will search backward or forward in the his-
|
ing the search string becomes the current line. To find
|
||||||
tory for the next line matching the search string typed so
|
other matching entries in the history list, type Control-S
|
||||||
far. Any other key sequence bound to a readline command
|
or Control-R as appropriate. This will search backward or
|
||||||
will terminate the search and execute that command. For
|
forward in the history for the next line matching the
|
||||||
instance, a _n_e_w_l_i_n_e will terminate the search and accept
|
search string typed so far. Any other key sequence bound
|
||||||
the line, thereby executing the command from the history
|
to a readline command will terminate the search and exe-
|
||||||
list.
|
cute that command. For instance, a _n_e_w_l_i_n_e will terminate
|
||||||
|
the search and accept the line, thereby executing the com-
|
||||||
|
mand from the history list.
|
||||||
|
|
||||||
Non-incremental searches read the entire search string
|
Non-incremental searches read the entire search string
|
||||||
before starting to search for matching history lines. The
|
before starting to search for matching history lines. The
|
||||||
search string may be typed by the user or be part of the
|
search string may be typed by the user or be part of the
|
||||||
contents of the current line.
|
contents of the current line.
|
||||||
|
|
||||||
EEDDIITTIINNGG CCOOMMMMAANNDDSS
|
EEDDIITTIINNGG CCOOMMMMAANNDDSS
|
||||||
The following is a list of the names of the commands and
|
The following is a list of the names of the commands and
|
||||||
the default key sequences to which they are bound. Com-
|
the default key sequences to which they are bound. Com-
|
||||||
mand names without an accompanying key sequence are
|
mand names without an accompanying key sequence are
|
||||||
unbound by default.
|
unbound by default.
|
||||||
|
|
||||||
|
@ -443,21 +451,13 @@ EEDDIITTIINNGG CCOOMMMMAANNDDSS
|
||||||
bbaacckkwwaarrdd--cchhaarr ((CC--bb))
|
bbaacckkwwaarrdd--cchhaarr ((CC--bb))
|
||||||
Move back a character.
|
Move back a character.
|
||||||
ffoorrwwaarrdd--wwoorrdd ((MM--ff))
|
ffoorrwwaarrdd--wwoorrdd ((MM--ff))
|
||||||
Move forward to the end of the next word. Words
|
Move forward to the end of the next word. Words
|
||||||
are composed of alphanumeric characters (letters
|
are composed of alphanumeric characters (letters
|
||||||
and digits).
|
and digits).
|
||||||
bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
|
|
||||||
Move back to the start of this, or the previous,
|
|
||||||
word. Words are composed of alphanumeric charac-
|
|
||||||
ters (letters and digits).
|
|
||||||
cclleeaarr--ssccrreeeenn ((CC--ll))
|
|
||||||
Clear the screen leaving the current line at the
|
|
||||||
top of the screen. With an argument, refresh the
|
|
||||||
current line without clearing the screen.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 7
|
GNU 1998 Dec 31 7
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -466,64 +466,64 @@ GNU 1998 Feb 19 7
|
||||||
READLINE(3) READLINE(3)
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
|
||||||
|
Move back to the start of this, or the previous,
|
||||||
|
word. Words are composed of alphanumeric charac-
|
||||||
|
ters (letters and digits).
|
||||||
|
cclleeaarr--ssccrreeeenn ((CC--ll))
|
||||||
|
Clear the screen leaving the current line at the
|
||||||
|
top of the screen. With an argument, refresh the
|
||||||
|
current line without clearing the screen.
|
||||||
rreeddrraaww--ccuurrrreenntt--lliinnee
|
rreeddrraaww--ccuurrrreenntt--lliinnee
|
||||||
Refresh the current line.
|
Refresh the current line.
|
||||||
|
|
||||||
CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy
|
CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy
|
||||||
aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn))
|
aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn))
|
||||||
Accept the line regardless of where the cursor is.
|
Accept the line regardless of where the cursor is.
|
||||||
If this line is non-empty, add it to the history
|
If this line is non-empty, add it to the history
|
||||||
list. If the line is a modified history line, then
|
list. If the line is a modified history line, then
|
||||||
restore the history line to its original state.
|
restore the history line to its original state.
|
||||||
pprreevviioouuss--hhiissttoorryy ((CC--pp))
|
pprreevviioouuss--hhiissttoorryy ((CC--pp))
|
||||||
Fetch the previous command from the history list,
|
Fetch the previous command from the history list,
|
||||||
moving back in the list.
|
moving back in the list.
|
||||||
nneexxtt--hhiissttoorryy ((CC--nn))
|
nneexxtt--hhiissttoorryy ((CC--nn))
|
||||||
Fetch the next command from the history list, mov-
|
Fetch the next command from the history list, mov-
|
||||||
ing forward in the list.
|
ing forward in the list.
|
||||||
bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<))
|
bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<))
|
||||||
Move to the first line in the history.
|
Move to the first line in the history.
|
||||||
eenndd--ooff--hhiissttoorryy ((MM-->>))
|
eenndd--ooff--hhiissttoorryy ((MM-->>))
|
||||||
Move to the end of the input history, i.e., the
|
Move to the end of the input history, i.e., the
|
||||||
line currently being entered.
|
line currently being entered.
|
||||||
rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr))
|
rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr))
|
||||||
Search backward starting at the current line and
|
Search backward starting at the current line and
|
||||||
moving `up' through the history as necessary. This
|
moving `up' through the history as necessary. This
|
||||||
is an incremental search.
|
is an incremental search.
|
||||||
ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss))
|
ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss))
|
||||||
Search forward starting at the current line and
|
Search forward starting at the current line and
|
||||||
moving `down' through the history as necessary.
|
moving `down' through the history as necessary.
|
||||||
This is an incremental search.
|
This is an incremental search.
|
||||||
nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp))
|
nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp))
|
||||||
Search backward through the history starting at the
|
Search backward through the history starting at the
|
||||||
current line using a non-incremental search for a
|
current line using a non-incremental search for a
|
||||||
string supplied by the user.
|
string supplied by the user.
|
||||||
nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn))
|
nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn))
|
||||||
Search forward through the history using a non-
|
Search forward through the history using a non-
|
||||||
incremental search for a string supplied by the
|
incremental search for a string supplied by the
|
||||||
user.
|
user.
|
||||||
hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd
|
hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd
|
||||||
Search forward through the history for the string
|
Search forward through the history for the string
|
||||||
of characters between the start of the current line
|
of characters between the start of the current line
|
||||||
and the current cursor position (the _p_o_i_n_t). This
|
and the current cursor position (the _p_o_i_n_t). This
|
||||||
is a non-incremental search.
|
is a non-incremental search.
|
||||||
hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd
|
hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd
|
||||||
Search backward through the history for the string
|
Search backward through the history for the string
|
||||||
of characters between the start of the current line
|
of characters between the start of the current line
|
||||||
and the point. This is a non-incremental search.
|
and the point. This is a non-incremental search.
|
||||||
yyaannkk--nntthh--aarrgg ((MM--CC--yy))
|
|
||||||
Insert the first argument to the previous command
|
|
||||||
(usually the second word on the previous line) at
|
|
||||||
point (the current cursor position). With an argu-
|
|
||||||
ment _n, insert the _nth word from the previous com-
|
|
||||||
mand (the words in the previous command begin with
|
|
||||||
word 0). A negative argument inserts the _nth word
|
|
||||||
from the end of the previous command.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 8
|
GNU 1998 Dec 31 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -532,24 +532,37 @@ GNU 1998 Feb 19 8
|
||||||
READLINE(3) READLINE(3)
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
yyaannkk--nntthh--aarrgg ((MM--CC--yy))
|
||||||
|
Insert the first argument to the previous command
|
||||||
|
(usually the second word on the previous line) at
|
||||||
|
point (the current cursor position). With an argu-
|
||||||
|
ment _n, insert the _nth word from the previous com-
|
||||||
|
mand (the words in the previous command begin with
|
||||||
|
word 0). A negative argument inserts the _nth word
|
||||||
|
from the end of the previous command.
|
||||||
yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__))
|
yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__))
|
||||||
Insert the last argument to the previous command
|
Insert the last argument to the previous command
|
||||||
(the last word of the previous history entry).
|
(the last word of the previous history entry).
|
||||||
With an argument, behave exactly like yyaannkk--nntthh--aarrgg.
|
With an argument, behave exactly like yyaannkk--nntthh--aarrgg.
|
||||||
Successive calls to yyaannkk--llaasstt--aarrgg move back through
|
Successive calls to yyaannkk--llaasstt--aarrgg move back through
|
||||||
the history list, inserting the last argument of
|
the history list, inserting the last argument of
|
||||||
each line in turn.
|
each line in turn.
|
||||||
|
|
||||||
CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt
|
CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt
|
||||||
ddeelleettee--cchhaarr ((CC--dd))
|
ddeelleettee--cchhaarr ((CC--dd))
|
||||||
Delete the character under the cursor. If point is
|
Delete the character under the cursor. If point is
|
||||||
at the beginning of the line, there are no charac-
|
at the beginning of the line, there are no charac-
|
||||||
ters in the line, and the last character typed was
|
ters in the line, and the last character typed was
|
||||||
not bound to BBddeelleettee--cchhaarr, then return EEOOFF.
|
not bound to BBddeelleettee--cchhaarr, then return EEOOFF.
|
||||||
bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt))
|
bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt))
|
||||||
Delete the character behind the cursor. When given
|
Delete the character behind the cursor. When given
|
||||||
a numeric argument, save the deleted text on the
|
a numeric argument, save the deleted text on the
|
||||||
kill ring.
|
kill ring.
|
||||||
|
ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr
|
||||||
|
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.
|
||||||
qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv))
|
qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv))
|
||||||
Add the next character that you type to the line
|
Add the next character that you type to the line
|
||||||
verbatim. This is how to insert characters like
|
verbatim. This is how to insert characters like
|
||||||
|
@ -572,6 +585,19 @@ READLINE(3) READLINE(3)
|
||||||
Uppercase the current (or following) word. With a
|
Uppercase the current (or following) word. With a
|
||||||
negative argument, uppercase the previous word, but
|
negative argument, uppercase the previous word, but
|
||||||
do not move point.
|
do not move point.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 9
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
ddoowwnnccaassee--wwoorrdd ((MM--ll))
|
ddoowwnnccaassee--wwoorrdd ((MM--ll))
|
||||||
Lowercase the current (or following) word. With a
|
Lowercase the current (or following) word. With a
|
||||||
negative argument, lowercase the previous word, but
|
negative argument, lowercase the previous word, but
|
||||||
|
@ -585,19 +611,6 @@ READLINE(3) READLINE(3)
|
||||||
kkiillll--lliinnee ((CC--kk))
|
kkiillll--lliinnee ((CC--kk))
|
||||||
Kill the text from the current cursor position to
|
Kill the text from the current cursor position to
|
||||||
the end of the line.
|
the end of the line.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 9
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt))
|
bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt))
|
||||||
Kill backward to the beginning of the line.
|
Kill backward to the beginning of the line.
|
||||||
uunniixx--lliinnee--ddiissccaarrdd ((CC--uu))
|
uunniixx--lliinnee--ddiissccaarrdd ((CC--uu))
|
||||||
|
@ -639,6 +652,18 @@ READLINE(3) READLINE(3)
|
||||||
Rotate the kill ring, and yank the new top. Only
|
Rotate the kill ring, and yank the new top. Only
|
||||||
works following yyaannkk or yyaannkk--ppoopp.
|
works following yyaannkk or yyaannkk--ppoopp.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 10
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
NNuummeerriicc AArrgguummeennttss
|
NNuummeerriicc AArrgguummeennttss
|
||||||
ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----))
|
ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----))
|
||||||
Add this digit to the argument already accumulat-
|
Add this digit to the argument already accumulat-
|
||||||
|
@ -651,20 +676,8 @@ READLINE(3) READLINE(3)
|
||||||
define the argument. If the command is followed by
|
define the argument. If the command is followed by
|
||||||
digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the
|
digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the
|
||||||
numeric argument, but is otherwise ignored. As a
|
numeric argument, but is otherwise ignored. As a
|
||||||
special case, if this command is immediately
|
special case, if this command is immediately fol-
|
||||||
|
lowed by a character that is neither a digit or
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 10
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
followed by a character that is neither a digit or
|
|
||||||
minus sign, the argument count for the next command
|
minus sign, the argument count for the next command
|
||||||
is multiplied by four. The argument count is ini-
|
is multiplied by four. The argument count is ini-
|
||||||
tially one, so executing this function the first
|
tially one, so executing this function the first
|
||||||
|
@ -705,6 +718,25 @@ READLINE(3) READLINE(3)
|
||||||
the list. This command is intended to be bound to
|
the list. This command is intended to be bound to
|
||||||
TTAABB, but is unbound by default.
|
TTAABB, but is unbound by default.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 11
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
|
ddeelleettee--cchhaarr--oorr--lliisstt
|
||||||
|
Deletes the character under the cursor if not at
|
||||||
|
the beginning or end of the line (like ddeelleettee--
|
||||||
|
cchhaarr). If at the end of the line, behaves identi-
|
||||||
|
cally to ppoossssiibbllee--ccoommpplleettiioonnss. This command is
|
||||||
|
unbound by default.
|
||||||
|
|
||||||
KKeeyybbooaarrdd MMaaccrrooss
|
KKeeyybbooaarrdd MMaaccrrooss
|
||||||
ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
|
ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
|
||||||
Begin saving the characters typed into the current
|
Begin saving the characters typed into the current
|
||||||
|
@ -717,19 +749,6 @@ READLINE(3) READLINE(3)
|
||||||
ing the characters in the macro appear as if typed
|
ing the characters in the macro appear as if typed
|
||||||
at the keyboard.
|
at the keyboard.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 11
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
MMiisscceellllaanneeoouuss
|
MMiisscceellllaanneeoouuss
|
||||||
rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr))
|
rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr))
|
||||||
Read in the contents of the _i_n_p_u_t_r_c file, and
|
Read in the contents of the _i_n_p_u_t_r_c file, and
|
||||||
|
@ -753,7 +772,7 @@ READLINE(3) READLINE(3)
|
||||||
Undo all changes made to this line. This is like
|
Undo all changes made to this line. This is like
|
||||||
executing the uunnddoo command enough times to return
|
executing the uunnddoo command enough times to return
|
||||||
the line to its initial state.
|
the line to its initial state.
|
||||||
ttiillddee--eexxppaanndd ((MM--~~))
|
ttiillddee--eexxppaanndd ((MM--&&))
|
||||||
Perform tilde expansion on the current word.
|
Perform tilde expansion on the current word.
|
||||||
sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>))
|
sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>))
|
||||||
Set the mark to the current point. If a numeric
|
Set the mark to the current point. If a numeric
|
||||||
|
@ -765,6 +784,18 @@ READLINE(3) READLINE(3)
|
||||||
cursor position is saved as the mark.
|
cursor position is saved as the mark.
|
||||||
cchhaarraacctteerr--sseeaarrcchh ((CC--]]))
|
cchhaarraacctteerr--sseeaarrcchh ((CC--]]))
|
||||||
A character is read and point is moved to the next
|
A character is read and point is moved to the next
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 12
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
occurrence of that character. A negative count
|
occurrence of that character. A negative count
|
||||||
searches for previous occurrences.
|
searches for previous occurrences.
|
||||||
cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]]))
|
cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]]))
|
||||||
|
@ -783,20 +814,8 @@ READLINE(3) READLINE(3)
|
||||||
ment is supplied, the output is formatted in such a
|
ment is supplied, the output is formatted in such a
|
||||||
way that it can be made part of an _i_n_p_u_t_r_c file.
|
way that it can be made part of an _i_n_p_u_t_r_c file.
|
||||||
dduummpp--vvaarriiaabblleess
|
dduummpp--vvaarriiaabblleess
|
||||||
Print all of the settable variables and their
|
Print all of the settable variables and their val-
|
||||||
|
ues to the readline output stream. If a numeric
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 12
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
values to the readline output stream. If a numeric
|
|
||||||
argument is supplied, the output is formatted in
|
argument is supplied, the output is formatted in
|
||||||
such a way that it can be made part of an _i_n_p_u_t_r_c
|
such a way that it can be made part of an _i_n_p_u_t_r_c
|
||||||
file.
|
file.
|
||||||
|
@ -830,6 +849,19 @@ DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
|
||||||
the bell (subject to the setting of the bbeellll--ssttyyllee vari-
|
the bell (subject to the setting of the bbeellll--ssttyyllee vari-
|
||||||
able).
|
able).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 13
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
EEmmaaccss MMooddee
|
EEmmaaccss MMooddee
|
||||||
Emacs Standard bindings
|
Emacs Standard bindings
|
||||||
|
|
||||||
|
@ -850,18 +882,6 @@ DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
|
||||||
"C-P" previous-history
|
"C-P" previous-history
|
||||||
"C-Q" quoted-insert
|
"C-Q" quoted-insert
|
||||||
"C-R" reverse-search-history
|
"C-R" reverse-search-history
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 13
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
"C-S" forward-search-history
|
"C-S" forward-search-history
|
||||||
"C-T" transpose-chars
|
"C-T" transpose-chars
|
||||||
"C-U" unix-line-discard
|
"C-U" unix-line-discard
|
||||||
|
@ -896,6 +916,18 @@ READLINE(3) READLINE(3)
|
||||||
"M-1" digit-argument
|
"M-1" digit-argument
|
||||||
"M-2" digit-argument
|
"M-2" digit-argument
|
||||||
"M-3" digit-argument
|
"M-3" digit-argument
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 14
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
"M-4" digit-argument
|
"M-4" digit-argument
|
||||||
"M-5" digit-argument
|
"M-5" digit-argument
|
||||||
"M-6" digit-argument
|
"M-6" digit-argument
|
||||||
|
@ -916,18 +948,6 @@ READLINE(3) READLINE(3)
|
||||||
"M-R" revert-line
|
"M-R" revert-line
|
||||||
"M-T" transpose-words
|
"M-T" transpose-words
|
||||||
"M-U" upcase-word
|
"M-U" upcase-word
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 14
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
"M-Y" yank-pop
|
"M-Y" yank-pop
|
||||||
"M-\" delete-horizontal-space
|
"M-\" delete-horizontal-space
|
||||||
"M-~" tilde-expand
|
"M-~" tilde-expand
|
||||||
|
@ -962,6 +982,18 @@ READLINE(3) READLINE(3)
|
||||||
"C-W" unix-word-rubout
|
"C-W" unix-word-rubout
|
||||||
"C-Y" yank
|
"C-Y" yank
|
||||||
"C-[" vi-movement-mode
|
"C-[" vi-movement-mode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 15
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
"C-_" undo
|
"C-_" undo
|
||||||
" " to "~" self-insert
|
" " to "~" self-insert
|
||||||
"C-?" backward-delete-char
|
"C-?" backward-delete-char
|
||||||
|
@ -982,18 +1014,6 @@ READLINE(3) READLINE(3)
|
||||||
"C-R" reverse-search-history
|
"C-R" reverse-search-history
|
||||||
"C-S" forward-search-history
|
"C-S" forward-search-history
|
||||||
"C-T" transpose-chars
|
"C-T" transpose-chars
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 15
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
"C-U" unix-line-discard
|
"C-U" unix-line-discard
|
||||||
"C-V" quoted-insert
|
"C-V" quoted-insert
|
||||||
"C-W" unix-word-rubout
|
"C-W" unix-word-rubout
|
||||||
|
@ -1028,6 +1048,18 @@ READLINE(3) READLINE(3)
|
||||||
"S" vi-subst
|
"S" vi-subst
|
||||||
"T" vi-char-search
|
"T" vi-char-search
|
||||||
"U" revert-line
|
"U" revert-line
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 16
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
"W" vi-next-word
|
"W" vi-next-word
|
||||||
"X" backward-delete-char
|
"X" backward-delete-char
|
||||||
"Y" vi-yank-to
|
"Y" vi-yank-to
|
||||||
|
@ -1048,18 +1080,6 @@ READLINE(3) READLINE(3)
|
||||||
"l" forward-char
|
"l" forward-char
|
||||||
"m" vi-set-mark
|
"m" vi-set-mark
|
||||||
"n" vi-search-again
|
"n" vi-search-again
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 16
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
READLINE(3) READLINE(3)
|
|
||||||
|
|
||||||
|
|
||||||
"p" vi-put
|
"p" vi-put
|
||||||
"r" vi-change-char
|
"r" vi-change-char
|
||||||
"s" vi-subst
|
"s" vi-subst
|
||||||
|
@ -1094,6 +1114,18 @@ BBUUGG RREEPPOORRTTSS
|
||||||
library that you have.
|
library that you have.
|
||||||
|
|
||||||
Once you have determined that a bug actually exists, mail
|
Once you have determined that a bug actually exists, mail
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 17
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READLINE(3) READLINE(3)
|
||||||
|
|
||||||
|
|
||||||
a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix,
|
a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix,
|
||||||
you are welcome to mail that as well! Suggestions and
|
you are welcome to mail that as well! Suggestions and
|
||||||
`philosophical' bug reports may be mailed to _b_u_g_-_r_e_a_d_-
|
`philosophical' bug reports may be mailed to _b_u_g_-_r_e_a_d_-
|
||||||
|
@ -1117,6 +1149,40 @@ BBUUGGSS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU 1998 Feb 19 17
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNU 1998 Dec 31 18
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
.\" Case Western Reserve University
|
.\" Case Western Reserve University
|
||||||
.\" chet@ins.CWRU.Edu
|
.\" chet@ins.CWRU.Edu
|
||||||
.\"
|
.\"
|
||||||
.\" Last Change: Thu Feb 19 10:26:47 EST 1998
|
.\" Last Change: Thu Dec 31 10:16:30 EST 1998
|
||||||
.\"
|
.\"
|
||||||
.TH READLINE 3 "1998 Feb 19" GNU
|
.TH READLINE 3 "1998 Dec 31" GNU
|
||||||
.\"
|
.\"
|
||||||
.\" File Name macro. This used to be `.PN', for Path Name,
|
.\" File Name macro. This used to be `.PN', for Path Name,
|
||||||
.\" but Sun doesn't seem to like that very much.
|
.\" but Sun doesn't seem to like that very much.
|
||||||
|
@ -22,6 +22,7 @@ readline \- get a line from a user with editing
|
||||||
.LP
|
.LP
|
||||||
.nf
|
.nf
|
||||||
.ft B
|
.ft B
|
||||||
|
#include <stdio.h>
|
||||||
#include <readline.h>
|
#include <readline.h>
|
||||||
#include <history.h>
|
#include <history.h>
|
||||||
.ft
|
.ft
|
||||||
|
@ -380,6 +381,19 @@ When set to \fBOn\fP, makes readline use a single line for display,
|
||||||
scrolling the input horizontally on a single screen line when it
|
scrolling the input horizontally on a single screen line when it
|
||||||
becomes longer than the screen width rather than wrapping to a new line.
|
becomes longer than the screen width rather than wrapping to a new line.
|
||||||
.TP
|
.TP
|
||||||
|
.B input\-meta (Off)
|
||||||
|
If set to \fBOn\fP, readline will enable eight-bit input (that is,
|
||||||
|
it will not strip the high bit from the characters it reads),
|
||||||
|
regardless of what the terminal claims it can support. The name
|
||||||
|
.B meta\-flag
|
||||||
|
is a synonym for this variable.
|
||||||
|
.TP
|
||||||
|
.B isearch\-terminators (``C\-[C\-J'')
|
||||||
|
The string of characters that should terminate an incremental
|
||||||
|
search without subsequently executing the character as a command.
|
||||||
|
If this variable has not been given a value, the characters
|
||||||
|
\fIESC\fP and \fIC\-J\fP will terminate an incremental search.
|
||||||
|
.TP
|
||||||
.B keymap (emacs)
|
.B keymap (emacs)
|
||||||
Set the current readline keymap. The set of legal keymap names is
|
Set the current readline keymap. The set of legal keymap names is
|
||||||
\fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
|
\fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
|
||||||
|
@ -400,11 +414,6 @@ appended.
|
||||||
If set to \fBOn\fP, history lines that have been modified are displayed
|
If set to \fBOn\fP, history lines that have been modified are displayed
|
||||||
with a preceding asterisk (\fB*\fP).
|
with a preceding asterisk (\fB*\fP).
|
||||||
.TP
|
.TP
|
||||||
.B meta\-flag (Off)
|
|
||||||
If set to \fBOn\fP, readline will enable eight-bit input (that is,
|
|
||||||
it will not strip the high bit from the characters it reads),
|
|
||||||
regardless of what the terminal claims it can support.
|
|
||||||
.TP
|
|
||||||
.B output\-meta (Off)
|
.B output\-meta (Off)
|
||||||
If set to \fBOn\fP, readline will display characters with the
|
If set to \fBOn\fP, readline will display characters with the
|
||||||
eighth bit set directly rather than as a meta-prefixed escape
|
eighth bit set directly rather than as a meta-prefixed escape
|
||||||
|
@ -509,8 +518,10 @@ As each character of the search string is typed, readline displays
|
||||||
the next entry from the history matching the string typed so far.
|
the next entry from the history matching the string typed so far.
|
||||||
An incremental search requires only as many characters as needed to
|
An incremental search requires only as many characters as needed to
|
||||||
find the desired history entry.
|
find the desired history entry.
|
||||||
The Escape character is used to terminate an incremental search.
|
The characters present in the value of the \fIisearch-terminators\fP
|
||||||
Control-J will also terminate the search.
|
variable are used to terminate an incremental search.
|
||||||
|
If that variable has not been assigned a value the Escape and
|
||||||
|
Control-J characters will terminate an incremental search.
|
||||||
Control-G will abort an incremental search and restore the original
|
Control-G will abort an incremental search and restore the original
|
||||||
line.
|
line.
|
||||||
When the search is terminated, the history entry containing the
|
When the search is terminated, the history entry containing the
|
||||||
|
@ -647,6 +658,11 @@ the last character typed was not bound to \fBBdelete\-char\fP, then return
|
||||||
Delete the character behind the cursor. When given a numeric argument,
|
Delete the character behind the cursor. When given a numeric argument,
|
||||||
save the deleted text on the kill ring.
|
save the deleted text on the kill ring.
|
||||||
.TP
|
.TP
|
||||||
|
.B 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.
|
||||||
|
.TP
|
||||||
.B quoted\-insert (C\-q, C\-v)
|
.B quoted\-insert (C\-q, C\-v)
|
||||||
Add the next character that you type to the line verbatim. This is
|
Add the next character that you type to the line verbatim. This is
|
||||||
how to insert characters like \fBC\-q\fP, for example.
|
how to insert characters like \fBC\-q\fP, for example.
|
||||||
|
@ -798,6 +814,13 @@ of matches; a negative argument may be used to move backward
|
||||||
through the list.
|
through the list.
|
||||||
This command is intended to be bound to \fBTAB\fP, but is unbound
|
This command is intended to be bound to \fBTAB\fP, but is unbound
|
||||||
by default.
|
by default.
|
||||||
|
.TP
|
||||||
|
.B delete\-char\-or\-list
|
||||||
|
Deletes the character under the cursor if not at the beginning or
|
||||||
|
end of the line (like \fBdelete-char\fP).
|
||||||
|
If at the end of the line, behaves identically to
|
||||||
|
\fBpossible-completions\fP.
|
||||||
|
This command is unbound by default.
|
||||||
.PD
|
.PD
|
||||||
.SS Keyboard Macros
|
.SS Keyboard Macros
|
||||||
.PP
|
.PP
|
||||||
|
@ -847,7 +870,7 @@ Undo all changes made to this line. This is like executing the
|
||||||
.B undo
|
.B undo
|
||||||
command enough times to return the line to its initial state.
|
command enough times to return the line to its initial state.
|
||||||
.TP
|
.TP
|
||||||
.B tilde\-expand (M\-~)
|
.B tilde\-expand (M\-&)
|
||||||
Perform tilde expansion on the current word.
|
Perform tilde expansion on the current word.
|
||||||
.TP
|
.TP
|
||||||
.B set\-mark (C\-@, M-<space>)
|
.B set\-mark (C\-@, M-<space>)
|
||||||
|
|
|
@ -6,26 +6,19 @@
|
||||||
@synindex vr fn
|
@synindex vr fn
|
||||||
@setchapternewpage odd
|
@setchapternewpage odd
|
||||||
|
|
||||||
@ignore
|
@include manvers.texinfo
|
||||||
last change: Thu Apr 2 14:39:03 EST 1998
|
|
||||||
@end ignore
|
|
||||||
|
|
||||||
@set EDITION 2.2
|
|
||||||
@set VERSION 2.2
|
|
||||||
@set UPDATED 2 April 1998
|
|
||||||
@set UPDATE-MONTH April 1998
|
|
||||||
|
|
||||||
|
@ifinfo
|
||||||
@dircategory Libraries
|
@dircategory Libraries
|
||||||
@direntry
|
@direntry
|
||||||
* Readline: (readline). The GNU readline library API
|
* Readline: (readline). The GNU readline library API
|
||||||
@end direntry
|
@end direntry
|
||||||
|
|
||||||
@ifinfo
|
|
||||||
This document describes the GNU Readline Library, a utility which aids
|
This document describes the GNU Readline Library, a utility which aids
|
||||||
in the consistency of user interface across discrete programs that need
|
in the consistency of user interface across discrete programs that need
|
||||||
to provide a command line interface.
|
to provide a command line interface.
|
||||||
|
|
||||||
Copyright (C) 1988, 1991, 1993, 1996, 1998 Free Software Foundation, Inc.
|
Copyright (C) 1988-1999 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to make and distribute verbatim copies of
|
Permission is granted to make and distribute verbatim copies of
|
||||||
this manual provided the copyright notice and this permission notice
|
this manual provided the copyright notice and this permission notice
|
||||||
|
@ -46,7 +39,7 @@ notice identical to this one.
|
||||||
Permission is granted to copy and distribute translations of this manual
|
Permission is granted to copy and distribute translations of this manual
|
||||||
into another language, under the above conditions for modified versions,
|
into another language, under the above conditions for modified versions,
|
||||||
except that this permission notice may be stated in a translation approved
|
except that this permission notice may be stated in a translation approved
|
||||||
by the Foundation.
|
by the Free Software Foundation.
|
||||||
@end ifinfo
|
@end ifinfo
|
||||||
|
|
||||||
@titlepage
|
@titlepage
|
||||||
|
@ -77,10 +70,10 @@ notice identical to this one.
|
||||||
Permission is granted to copy and distribute translations of this manual
|
Permission is granted to copy and distribute translations of this manual
|
||||||
into another language, under the above conditions for modified versions,
|
into another language, under the above conditions for modified versions,
|
||||||
except that this permission notice may be stated in a translation approved
|
except that this permission notice may be stated in a translation approved
|
||||||
by the Foundation.
|
by the Free Software Foundation.
|
||||||
|
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
|
||||||
@end titlepage
|
@end titlepage
|
||||||
|
|
||||||
@ifinfo
|
@ifinfo
|
||||||
|
|
|
@ -8,7 +8,7 @@ This document describes the GNU Readline Library, a utility for aiding
|
||||||
in the consitency of user interface across discrete programs that need
|
in the consitency of user interface across discrete programs that need
|
||||||
to provide a command line interface.
|
to provide a command line interface.
|
||||||
|
|
||||||
Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc.
|
Copyright (C) 1988, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to make and distribute verbatim copies of
|
Permission is granted to make and distribute verbatim copies of
|
||||||
this manual provided the copyright notice and this permission notice
|
this manual provided the copyright notice and this permission notice
|
||||||
|
@ -47,7 +47,9 @@ in your own programs, this section is for you.
|
||||||
* Readline Variables:: Variables accessible to custom
|
* Readline Variables:: Variables accessible to custom
|
||||||
functions.
|
functions.
|
||||||
* Readline Convenience Functions:: Functions which Readline supplies to
|
* Readline Convenience Functions:: Functions which Readline supplies to
|
||||||
aid in writing your own
|
aid in writing your own custom
|
||||||
|
functions.
|
||||||
|
* Readline Signal Handling:: How Readline behaves when it receives signals.
|
||||||
* Custom Completers:: Supplanting or supplementing Readline's
|
* Custom Completers:: Supplanting or supplementing Readline's
|
||||||
completion functions.
|
completion functions.
|
||||||
@end menu
|
@end menu
|
||||||
|
@ -268,6 +270,13 @@ Setting this to a value makes it the next keystroke read. This is a
|
||||||
way to stuff a single character into the input stream.
|
way to stuff a single character into the input stream.
|
||||||
@end deftypevar
|
@end deftypevar
|
||||||
|
|
||||||
|
@deftypevar 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.
|
||||||
|
@end deftypevar
|
||||||
|
|
||||||
@deftypevar {char *} rl_prompt
|
@deftypevar {char *} rl_prompt
|
||||||
The prompt Readline uses. This is set from the argument to
|
The prompt Readline uses. This is set from the argument to
|
||||||
@code{readline ()}, and should not be assigned to directly.
|
@code{readline ()}, and should not be assigned to directly.
|
||||||
|
@ -300,6 +309,12 @@ If non-zero, this is the address of a function to call just
|
||||||
before @code{readline} prints the first prompt.
|
before @code{readline} prints the first prompt.
|
||||||
@end deftypevar
|
@end deftypevar
|
||||||
|
|
||||||
|
@deftypevar {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 @code{readline}
|
||||||
|
starts reading input characters.
|
||||||
|
@end deftypevar
|
||||||
|
|
||||||
@deftypevar {Function *} rl_event_hook
|
@deftypevar {Function *} rl_event_hook
|
||||||
If non-zero, this is the address of a function to call periodically
|
If non-zero, this is the address of a function to call periodically
|
||||||
when readline is waiting for terminal input.
|
when readline is waiting for terminal input.
|
||||||
|
@ -619,6 +634,16 @@ is also used to display numeric arguments and search strings.
|
||||||
Clear the message in the echo area.
|
Clear the message in the echo area.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun void rl_save_prompt ()
|
||||||
|
Save the local Readline prompt display state in preparation for
|
||||||
|
displaying a new message in the message area with @code{rl_message}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun void rl_restore_prompt ()
|
||||||
|
Restore the local Readline prompt display state saved by the most
|
||||||
|
recent call to @code{rl_save_prompt}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
@node Modifying Text
|
@node Modifying Text
|
||||||
@subsection Modifying Text
|
@subsection Modifying Text
|
||||||
|
|
||||||
|
@ -689,6 +714,16 @@ Return 1 if @var{c} is a numeric character.
|
||||||
Ring the terminal bell, obeying the setting of @code{bell-style}.
|
Ring the terminal bell, obeying the setting of @code{bell-style}.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun 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. @code{matches} is the list
|
||||||
|
of strings, in argv format, such as a list of completion matches.
|
||||||
|
@code{len} is the number of strings in @code{matches}, and @code{max}
|
||||||
|
is the length of the longest string in @code{matches}. This function uses
|
||||||
|
the setting of @code{print-completions-horizontally} to select how the
|
||||||
|
matches are displayed (@pxref{Readline Init File Syntax}).
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
The following are implemented as macros, defined in @code{chartypes.h}.
|
The following are implemented as macros, defined in @code{chartypes.h}.
|
||||||
|
|
||||||
@deftypefun int uppercase_p (int c)
|
@deftypefun int uppercase_p (int c)
|
||||||
|
@ -814,6 +849,116 @@ invert_case_line (count, key)
|
||||||
@}
|
@}
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
@node Readline Signal Handling
|
||||||
|
@section Readline Signal Handling
|
||||||
|
|
||||||
|
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 (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM},
|
||||||
|
@code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}).
|
||||||
|
When one of these signals is received, the signal handler
|
||||||
|
will reset the terminal attributes to those that were in effect before
|
||||||
|
@code{readline ()} was called, reset the signal handling to what it was
|
||||||
|
before @code{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 @code{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 @code{rl_free_line_state ()}).
|
||||||
|
|
||||||
|
There is an additional Readline signal handler, for @code{SIGWINCH}, which
|
||||||
|
the kernel sends to a process whenever the terminal's size changes (for
|
||||||
|
example, if a user resizes an @code{xterm}). The Readline @code{SIGWINCH}
|
||||||
|
handler updates Readline's internal screen size state, and then calls any
|
||||||
|
@code{SIGWINCH} signal handler the calling application has installed.
|
||||||
|
Readline calls the application's @code{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 @code{longjmp} back to a main processing loop), it @emph{must}
|
||||||
|
call @code{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 @code{readline ()}, not in
|
||||||
|
a signal handler, so Readline's internal signal state is not corrupted.
|
||||||
|
|
||||||
|
@deftypevar int rl_catch_signals
|
||||||
|
If this variable is non-zero, Readline will install signal handlers for
|
||||||
|
@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGALRM},
|
||||||
|
@code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}.
|
||||||
|
|
||||||
|
The default value of @code{rl_catch_signals} is 1.
|
||||||
|
@end deftypevar
|
||||||
|
|
||||||
|
@deftypevar int rl_catch_sigwinch
|
||||||
|
If this variable is non-zero, Readline will install a signal handler for
|
||||||
|
@code{SIGWINCH}.
|
||||||
|
|
||||||
|
The default value of @code{rl_catch_sigwinch} is 1.
|
||||||
|
@end deftypevar
|
||||||
|
|
||||||
|
If an application does not wish to have Readline catch any signals, or
|
||||||
|
to handle signals other than those Readline catches (@code{SIGHUP},
|
||||||
|
for example),
|
||||||
|
Readline provides convenience functions to do the necessary terminal
|
||||||
|
and internal state cleanup upon receipt of a signal.
|
||||||
|
|
||||||
|
@deftypefun void rl_cleanup_after_signal (void)
|
||||||
|
This function will reset the state of the terminal to what it was before
|
||||||
|
@code{readline ()} was called, and remove the Readline signal handlers for
|
||||||
|
all signals, depending on the values of @code{rl_catch_signals} and
|
||||||
|
@code{rl_catch_sigwinch}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun 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 @code{rl_cleanup_after_signal ()}. The
|
||||||
|
Readline signal handler for @code{SIGINT} calls this to abort the
|
||||||
|
current input line.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun void rl_reset_after_signal (void)
|
||||||
|
This will reinitialize the terminal and reinstall any Readline signal
|
||||||
|
handlers, depending on the values of @code{rl_catch_signals} and
|
||||||
|
@code{rl_catch_sigwinch}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
If an application does not wish Readline to catch @code{SIGWINCH}, it may
|
||||||
|
call @code{rl_resize_terminal ()} to force Readline to update its idea of
|
||||||
|
the terminal size when a @code{SIGWINCH} is received.
|
||||||
|
|
||||||
|
@deftypefun void rl_resize_terminal (void)
|
||||||
|
Update Readline's internal screen size.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
The following functions install and remove Readline's signal handlers.
|
||||||
|
|
||||||
|
@deftypefun int rl_set_signals (void)
|
||||||
|
Install Readline's signal handler for @code{SIGINT}, @code{SIGQUIT},
|
||||||
|
@code{SIGTERM}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN},
|
||||||
|
@code{SIGTTOU}, and @code{SIGWINCH}, depending on the values of
|
||||||
|
@code{rl_catch_signals} and @code{rl_catch_sigwinch}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun int rl_clear_signals (void)
|
||||||
|
Remove all of the Readline signal handlers installed by
|
||||||
|
@code{rl_set_signals ()}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
@node Custom Completers
|
@node Custom Completers
|
||||||
@section Custom Completers
|
@section Custom Completers
|
||||||
|
|
||||||
|
@ -1108,6 +1253,20 @@ string (the current directory name) as an argument. It could be used
|
||||||
to expand symbolic links or shell variables in pathnames.
|
to expand symbolic links or shell variables in pathnames.
|
||||||
@end deftypevar
|
@end deftypevar
|
||||||
|
|
||||||
|
@deftypevar {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:
|
||||||
|
(@code{char **}@var{matches}, @code{int} @var{num_matches}, @code{int} @var{max_length})
|
||||||
|
where @var{matches} is the array of matching strings,
|
||||||
|
@var{num_matches} is the number of strings in that array, and
|
||||||
|
@var{max_length} is the length of the longest string in that array.
|
||||||
|
Readline provides a convenience function, @code{rl_display_match_list},
|
||||||
|
that takes care of doing the display to Readline's output stream. That
|
||||||
|
function may be called from this hook.
|
||||||
|
@end deftypevar
|
||||||
|
|
||||||
@node A Short Completion Example
|
@node A Short Completion Example
|
||||||
@subsection A Short Completion Example
|
@subsection A Short Completion Example
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ regardless of the location of the cursor within the line.
|
||||||
* Readline Killing Commands:: How to delete text, and how to get it back!
|
* Readline Killing Commands:: How to delete text, and how to get it back!
|
||||||
* Readline Arguments:: Giving numeric arguments to commands.
|
* Readline Arguments:: Giving numeric arguments to commands.
|
||||||
* Searching:: Searching through previous lines.
|
* Searching:: Searching through previous lines.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Readline Bare Essentials
|
@node Readline Bare Essentials
|
||||||
@subsection Readline Bare Essentials
|
@subsection Readline Bare Essentials
|
||||||
|
@ -252,8 +252,10 @@ As each character of the search string is typed, Readline displays
|
||||||
the next entry from the history matching the string typed so far.
|
the next entry from the history matching the string typed so far.
|
||||||
An incremental search requires only as many characters as needed to
|
An incremental search requires only as many characters as needed to
|
||||||
find the desired history entry.
|
find the desired history entry.
|
||||||
The @key{ESC} character is used to terminate an incremental search.
|
The characters present in the value of the @var{isearch-terminators} variable
|
||||||
@key{C-j} will also terminate the search.
|
are used to terminate an incremental search.
|
||||||
|
If that variable has not been assigned a value, the @key{ESC} and
|
||||||
|
@key{C-J} characters will terminate an incremental search.
|
||||||
@key{C-g} will abort an incremental search and restore the original line.
|
@key{C-g} will abort an incremental search and restore the original line.
|
||||||
When the search is terminated, the history entry containing the
|
When the search is terminated, the history entry containing the
|
||||||
search string becomes the current line.
|
search string becomes the current line.
|
||||||
|
@ -396,6 +398,22 @@ 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,
|
of the screen, instead of wrapping onto a new screen line. By default,
|
||||||
this variable is set to @samp{off}.
|
this variable is set to @samp{off}.
|
||||||
|
|
||||||
|
@item input-meta
|
||||||
|
@vindex input-meta
|
||||||
|
@vindex meta-flag
|
||||||
|
If set to @samp{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 @samp{off}. The name @code{meta-flag} is a
|
||||||
|
synonym for this variable.
|
||||||
|
|
||||||
|
@item isearch-terminators
|
||||||
|
@vindex isearch-terminators
|
||||||
|
The string of characters that should terminate an incremental search without
|
||||||
|
subsequently executing the character as a command (@pxref{Searching}).
|
||||||
|
If this variable has not been given a value, the characters @key{ESC} and
|
||||||
|
@key{C-J} will terminate an incremental search.
|
||||||
|
|
||||||
@item keymap
|
@item keymap
|
||||||
@vindex keymap
|
@vindex keymap
|
||||||
Sets Readline's idea of the current keymap for key binding commands.
|
Sets Readline's idea of the current keymap for key binding commands.
|
||||||
|
@ -422,15 +440,6 @@ This variable, when set to @samp{on}, causes Readline to display an
|
||||||
asterisk (@samp{*}) at the start of history lines which have been modified.
|
asterisk (@samp{*}) at the start of history lines which have been modified.
|
||||||
This variable is @samp{off} by default.
|
This variable is @samp{off} by default.
|
||||||
|
|
||||||
@item input-meta
|
|
||||||
@vindex input-meta
|
|
||||||
@vindex meta-flag
|
|
||||||
If set to @samp{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 @samp{off}. The name @code{meta-flag} is a
|
|
||||||
synonym for this variable.
|
|
||||||
|
|
||||||
@item output-meta
|
@item output-meta
|
||||||
@vindex output-meta
|
@vindex output-meta
|
||||||
If set to @samp{on}, Readline will display characters with the
|
If set to @samp{on}, Readline will display characters with the
|
||||||
|
@ -876,6 +885,11 @@ return @code{EOF}.
|
||||||
Delete the character behind the cursor. A numeric argument means
|
Delete the character behind the cursor. A numeric argument means
|
||||||
to kill the characters instead of deleting them.
|
to kill the characters instead of deleting them.
|
||||||
|
|
||||||
|
@item 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.
|
||||||
|
|
||||||
@item quoted-insert (C-q, C-v)
|
@item quoted-insert (C-q, C-v)
|
||||||
Add the next character typed to the line verbatim. This is
|
Add the next character typed to the line verbatim. This is
|
||||||
how to insert key sequences like @key{C-q}, for example.
|
how to insert key sequences like @key{C-q}, for example.
|
||||||
|
@ -1039,6 +1053,13 @@ through the list.
|
||||||
This command is intended to be bound to @code{TAB}, but is unbound
|
This command is intended to be bound to @code{TAB}, but is unbound
|
||||||
by default.
|
by default.
|
||||||
|
|
||||||
|
@item delete-char-or-list ()
|
||||||
|
Deletes the character under the cursor if not at the beginning or
|
||||||
|
end of the line (like @code{delete-char}).
|
||||||
|
If at the end of the line, behaves identically to
|
||||||
|
@code{possible-completions}.
|
||||||
|
This command is unbound by default.
|
||||||
|
|
||||||
@ifset BashFeatures
|
@ifset BashFeatures
|
||||||
@item complete-filename (M-/)
|
@item complete-filename (M-/)
|
||||||
Attempt filename completion on the text before point.
|
Attempt filename completion on the text before point.
|
||||||
|
@ -1141,7 +1162,12 @@ Incremental undo, separately remembered for each line.
|
||||||
Undo all changes made to this line. This is like executing the @code{undo}
|
Undo all changes made to this line. This is like executing the @code{undo}
|
||||||
command enough times to get back to the beginning.
|
command enough times to get back to the beginning.
|
||||||
|
|
||||||
|
@ifset BashFeatures
|
||||||
|
@item tilde-expand (M-&)
|
||||||
|
@end ifset
|
||||||
|
@ifclear BashFeatures
|
||||||
@item tilde-expand (M-~)
|
@item tilde-expand (M-~)
|
||||||
|
@end ifclear
|
||||||
Perform tilde expansion on the current word.
|
Perform tilde expansion on the current word.
|
||||||
|
|
||||||
@item set-mark (C-@@)
|
@item set-mark (C-@@)
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# texi2dvi --- smartly produce DVI files from texinfo sources
|
# texi2dvi --- smartly produce DVI files from texinfo sources
|
||||||
|
|
||||||
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
#
|
||||||
|
# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
@ -19,28 +18,27 @@
|
||||||
# along with this program; if not, you can either send email to this
|
# along with this program; if not, you can either send email to this
|
||||||
# program's maintainer or write to: The Free Software Foundation,
|
# program's maintainer or write to: The Free Software Foundation,
|
||||||
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
|
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
# Commentary:
|
# Commentary:
|
||||||
|
#
|
||||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
# Author: Noah Friedman <friedman@gnu.org>
|
||||||
|
#
|
||||||
# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
|
# Please send bug reports, etc. to bug-texinfo@gnu.org.
|
||||||
# If possible, please send a copy of the output of the script called with
|
# If possible, please send a copy of the output of the script called with
|
||||||
# the `--debug' option when making a bug report.
|
# the `--debug' option when making a bug report.
|
||||||
|
#
|
||||||
# In the interest of general portability, some common bourne shell
|
# In the interest of general portability, some common bourne shell
|
||||||
# constructs were avoided because they weren't guaranteed to be available
|
# constructs were avoided because they weren't guaranteed to be available
|
||||||
# in some earlier implementations. I've tried to make this program as
|
# in some earlier implementations. I've tried to make this program as
|
||||||
# portable as possible. Welcome to unix, where the lowest common
|
# portable as possible. Welcome to unix, where the lowest common
|
||||||
# denominator is rapidly diminishing.
|
# denominator is rapidly diminishing.
|
||||||
#
|
#
|
||||||
# Among the more interesting lossages I noticed with some bourne shells
|
# Among the more interesting lossages I noticed among Bourne shells:
|
||||||
# are:
|
|
||||||
# * No shell functions.
|
# * No shell functions.
|
||||||
# * No `unset' builtin.
|
# * No `unset' builtin.
|
||||||
# * `shift' cannot take a numeric argument, and signals an error if
|
# * `shift' cannot take a numeric argument, and signals an error if
|
||||||
# there are no arguments to shift.
|
# there are no arguments to shift.
|
||||||
|
#
|
||||||
# Code:
|
# Code:
|
||||||
|
|
||||||
# Name by which this script was invoked.
|
# Name by which this script was invoked.
|
||||||
|
@ -54,30 +52,39 @@ version=`set - $rcs_revision; echo $2`
|
||||||
bq='`'
|
bq='`'
|
||||||
eq="'"
|
eq="'"
|
||||||
|
|
||||||
usage="Usage: $progname {options} [file1] {file2 {...}}
|
usage="Usage: $0 [OPTION]... FILE...
|
||||||
(version $version)
|
Run a Texinfo document through TeX.
|
||||||
|
|
||||||
Options are:
|
Options:
|
||||||
|
-b, --batch No interaction (\nonstopmode in TeX).
|
||||||
|
-c, --clean Remove all auxiliary files.
|
||||||
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
|
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
|
||||||
-h, --help You're looking at it.
|
-t, --texinfo CMD Insert CMD after @setfilename before running TeX.
|
||||||
-v, --version Print version number.
|
--verbose Report on what is done.
|
||||||
|
-h, --help Display this help and exit.
|
||||||
|
-v, --version Display version information and exit.
|
||||||
|
|
||||||
Arguments in brackets are required. Those in braces are optional.
|
The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
|
||||||
"
|
used to run those commands, if they are set.
|
||||||
|
|
||||||
|
Email bug reports to bug-texinfo@gnu.org."
|
||||||
|
|
||||||
# Initialize variables.
|
# Initialize variables.
|
||||||
# Don't use `unset' since old bourne shells don't have this command.
|
# Don't use `unset' since old bourne shells don't have this command.
|
||||||
# Instead, assign them an empty value.
|
# Instead, assign them an empty value.
|
||||||
# Some of these, like TEX and TEXINDEX, may be inherited from the environment
|
# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
|
||||||
backup_extension=.bak
|
backup_extension=.bak # these files get deleted if all goes well.
|
||||||
|
batch=
|
||||||
|
clean=
|
||||||
debug=
|
debug=
|
||||||
orig_pwd="`pwd`"
|
orig_pwd="`pwd`"
|
||||||
verbose=
|
textra=
|
||||||
|
verbose=false
|
||||||
|
makeinfo="${MAKEINFO-makeinfo}"
|
||||||
texindex="${TEXINDEX-texindex}"
|
texindex="${TEXINDEX-texindex}"
|
||||||
tex="${TEX-tex}"
|
tex="${TEX-tex}"
|
||||||
|
|
||||||
# Save this so we can construct a new TEXINPUTS path for each file to be
|
# Save this so we can construct a new TEXINPUTS path for each file.
|
||||||
# processed.
|
|
||||||
TEXINPUTS_orig="$TEXINPUTS"
|
TEXINPUTS_orig="$TEXINPUTS"
|
||||||
export TEXINPUTS
|
export TEXINPUTS
|
||||||
|
|
||||||
|
@ -86,190 +93,270 @@ export TEXINPUTS
|
||||||
# It's a good idea to document the full long option name in each case.
|
# It's a good idea to document the full long option name in each case.
|
||||||
# Long options which take arguments will need a `*' appended to the
|
# Long options which take arguments will need a `*' appended to the
|
||||||
# canonical name to match the value appended after the `=' character.
|
# canonical name to match the value appended after the `=' character.
|
||||||
while : ; do
|
while :; do
|
||||||
case $# in 0) break ;; esac
|
test $# -eq 0 && break
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-D | --debug | --d* )
|
-b | --batch | --b* ) batch=t; shift ;;
|
||||||
debug=t
|
-c | --clean | --c* ) clean=t; shift ;;
|
||||||
shift
|
-D | --debug | --d* ) debug=t; shift ;;
|
||||||
;;
|
-h | --help | --h* ) echo "$usage"; exit 0 ;;
|
||||||
-h | --help | --h* )
|
# OK, we should do real option parsing here, but be lazy for now.
|
||||||
echo "$usage" 1>&2
|
-t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
|
||||||
exit 0
|
-v | --vers* )
|
||||||
;;
|
echo "$progname (GNU Texinfo 3.12) $version"
|
||||||
-v | --version | --v* )
|
echo "Copyright (C) 1998 Free Software Foundation, Inc.
|
||||||
echo "texi2dvi version $version" 1>&2
|
There is NO warranty. You may redistribute this software
|
||||||
exit 0
|
under the terms of the GNU General Public License.
|
||||||
;;
|
For more information about these matters, see the files named COPYING."
|
||||||
|
exit 0 ;;
|
||||||
|
--verb* ) verbose=echo; shift ;;
|
||||||
-- ) # Stop option processing
|
-- ) # Stop option processing
|
||||||
shift
|
shift
|
||||||
break
|
break ;;
|
||||||
;;
|
|
||||||
-* )
|
-* )
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
|
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
|
||||||
* ) arg="$1" ;;
|
* ) arg="$1" ;;
|
||||||
esac
|
esac
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
echo "$progname: unknown or ambiguous option $bq$arg$eq"
|
echo "$progname: Unknown or ambiguous option $bq$arg$eq."
|
||||||
echo "$progname: Use $bq--help$eq for a list of options."
|
echo "$progname: Try $bq--help$eq for more information."
|
||||||
exit 1
|
exit 1 ;;
|
||||||
;;
|
* ) break ;;
|
||||||
* )
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# See if there are any command line args left (which will be interpreted as
|
# See if there are any command line args left (which will be interpreted as
|
||||||
# filename arguments)
|
# filename arguments).
|
||||||
case $# in
|
if test $# -eq 0; then
|
||||||
0 )
|
exec 1>&2
|
||||||
exec 1>&2
|
echo "$progname: At least one file name is required as an argument."
|
||||||
echo "$progname: at least one file name is required as an argument."
|
echo "$progname: Try $bq--help$eq for more information."
|
||||||
echo "$progname: Use $bq--help$eq for a description of command syntax."
|
exit 2
|
||||||
exit 2
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$debug" in t ) set -x ;; esac
|
test "$debug" = t && set -x
|
||||||
|
|
||||||
# Texify files
|
# Texify files
|
||||||
for command_line_filename in ${1+"$@"} ; do
|
for command_line_filename in ${1+"$@"}; do
|
||||||
# Roughly equivalent to `dirname ...`, but more portable
|
$verbose "Processing $command_line_filename ..."
|
||||||
directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
|
|
||||||
filename_texi="`basename ${command_line_filename}`"
|
|
||||||
# Strip off the last extension part (probably .texinfo or .texi)
|
|
||||||
filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
|
|
||||||
|
|
||||||
# If directory and file are the same, then it's probably because there's
|
# See if file exists. If it doesn't we're in trouble since, even
|
||||||
# no pathname component. Set dirname to `.', the current directory.
|
# though the user may be able to reenter a valid filename at the tex
|
||||||
if test "z${directory}" = "z${command_line_filename}" ; then
|
# prompt (assuming they're attending the terminal), this script won't
|
||||||
directory="."
|
# be able to find the right index files and so forth.
|
||||||
fi
|
if test ! -r "${command_line_filename}"; then
|
||||||
|
echo "$0: Could not read ${command_line_filename}." >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
# Source file might @include additional texinfo sources. Put `.' and
|
# Roughly equivalent to `dirname ...`, but more portable
|
||||||
# directory where source file(s) reside in TEXINPUTS before anything
|
directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
|
||||||
# else. `.' goes first to ensure that any old .aux, .cps, etc. files in
|
filename_texi="`basename ${command_line_filename}`"
|
||||||
# ${directory} don't get used in preference to fresher files in `.'.
|
# Strip off the last extension part (probably .texinfo or .texi)
|
||||||
TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
|
filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
|
||||||
|
|
||||||
# "Unset" variables that might have values from previous iterations and
|
# Use same basename since we want to generate aux files with the same
|
||||||
# which won't be completely reset later.
|
# basename as the manual. Use extension .texi for the temp file so
|
||||||
definite_index_files=""
|
# that TeX will ignore it. Thus, we must use a subdirectory.
|
||||||
|
#
|
||||||
|
# Output the macro-expanded file to here. The vastly abbreviated
|
||||||
|
# temporary directory name is so we don't have collisions on 8.3 or
|
||||||
|
# 14-character filesystems.
|
||||||
|
tmp_dir=${TMPDIR-/tmp}/txi2d.$$
|
||||||
|
filename_tmp=$tmp_dir/$filename_noext.texi
|
||||||
|
# Output the file with the user's extra commands to here.
|
||||||
|
tmp_dir2=${tmp_dir}.2
|
||||||
|
filename_tmp2=$tmp_dir2/$filename_noext.texi
|
||||||
|
mkdir $tmp_dir $tmp_dir2
|
||||||
|
# Always remove the temporary directories.
|
||||||
|
trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
|
||||||
|
|
||||||
# See if file exists here. If it doesn't we're in trouble since, even
|
# If directory and file are the same, then it's probably because there's
|
||||||
# though the user may be able to reenter a valid filename at the tex
|
# no pathname component. Set dirname to `.', the current directory.
|
||||||
# prompt (assuming they're attending the terminal), this script won't be
|
if test "z${directory}" = "z${command_line_filename}"; then
|
||||||
# able to find the right index files and so forth.
|
directory=.
|
||||||
if test ! -r "${command_line_filename}" ; then
|
fi
|
||||||
echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2
|
|
||||||
continue;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find all files having root filename with a two-letter extension,
|
# Source file might @include additional texinfo sources. Put `.' and
|
||||||
# determine whether they're really index files, and save them. Foo.aux
|
# directory where source file(s) reside in TEXINPUTS before anything
|
||||||
# is actually the cross-references file, but we need to keep track of
|
# else. `.' goes first to ensure that any old .aux, .cps, etc. files in
|
||||||
# that too.
|
# ${directory} don't get used in preference to fresher files in `.'.
|
||||||
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
|
TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
|
||||||
for this_file in ${possible_index_files} ; do
|
|
||||||
|
# Expand macro commands in the original source file using Makeinfo;
|
||||||
|
# the macro syntax bfox implemented is impossible to implement in TeX.
|
||||||
|
# Always use `end' footnote style, since the `separate' style
|
||||||
|
# generates different output (arguably this is a bug in -E).
|
||||||
|
# Discard main info output, the user asked to run TeX, not makeinfo.
|
||||||
|
# Redirect output to /dev/null to throw away `Making info file...' msg.
|
||||||
|
$verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
|
||||||
|
$makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
|
||||||
|
$command_line_filename >/dev/null
|
||||||
|
|
||||||
|
# But if there were no macros, or makeinfo failed for some reason,
|
||||||
|
# just use the original file. (It shouldn't make any difference, but
|
||||||
|
# let's be safe.)
|
||||||
|
if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
|
||||||
|
$verbose "Reverting to $command_line_filename ..."
|
||||||
|
cp -p $command_line_filename $filename_tmp
|
||||||
|
fi
|
||||||
|
filename_input=$filename_tmp
|
||||||
|
dirname_input=$tmp_dir
|
||||||
|
|
||||||
|
# Used most commonly for @finalout, @smallbook, etc.
|
||||||
|
if test -n "$textra"; then
|
||||||
|
$verbose "Inserting extra commands: $textra."
|
||||||
|
sed '/^@setfilename/a\
|
||||||
|
'"$textra" $filename_input >$filename_tmp2
|
||||||
|
filename_input=$filename_tmp2
|
||||||
|
dirname_input=$tmp_dir2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If clean mode was specified, then move to the temporary directory.
|
||||||
|
if test "$clean" = t; then
|
||||||
|
$verbose "cd $dirname_input"
|
||||||
|
cd $dirname_input || exit 1
|
||||||
|
filename_input=`basename $filename_input`
|
||||||
|
fi
|
||||||
|
|
||||||
|
while true; do # will break out of loop below
|
||||||
|
# "Unset" variables that might have values from previous iterations and
|
||||||
|
# which won't be completely reset later.
|
||||||
|
definite_index_files=
|
||||||
|
|
||||||
|
# Find all files having root filename with a two-letter extension,
|
||||||
|
# determine whether they're really index files, and save them. Foo.aux
|
||||||
|
# is actually the cross-references file, but we need to keep track of
|
||||||
|
# that too.
|
||||||
|
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
|
||||||
|
for this_file in ${possible_index_files}; do
|
||||||
# If file is empty, forget it.
|
# If file is empty, forget it.
|
||||||
if test ! -s "${this_file}" ; then
|
test -s "${this_file}" || continue
|
||||||
continue;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Examine first character of file. If it's not a backslash or
|
# Examine first character of file. If it's not suitable to be an
|
||||||
# single quote, then it's definitely not an index or xref file.
|
# index or xref file, don't process it.
|
||||||
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
|
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
|
||||||
if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
|
if test "x${first_character}" = "x\\" \
|
||||||
definite_index_files="${definite_index_files} ${this_file}"
|
|| test "x${first_character}" = "x'"; then
|
||||||
|
definite_index_files="${definite_index_files} ${this_file}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
orig_index_files="${definite_index_files}"
|
orig_index_files="${definite_index_files}"
|
||||||
orig_index_files_sans_aux="`echo ${definite_index_files} \
|
orig_index_files_sans_aux="`echo ${definite_index_files} \
|
||||||
| sed 's/'${filename_noext}'\.aux//;
|
| sed 's/'${filename_noext}'\.aux//;
|
||||||
s/^[ ]*//;s/[ ]*$//;'`"
|
s/^[ ]*//;s/[ ]*$//;'`"
|
||||||
|
|
||||||
# Now save copies of original index files so we have some means of
|
# Now save copies of original index files so we have some means of
|
||||||
# comparison later.
|
# comparison later.
|
||||||
for index_file_to_save in ${orig_index_files} ; do
|
$verbose "Backing up current index files: $orig_index_files ..."
|
||||||
cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
|
for index_file_to_save in ${orig_index_files}; do
|
||||||
done
|
cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
|
||||||
|
done
|
||||||
|
|
||||||
# Run texindex on current index files. If they already exist, and
|
# Run texindex on current index files. If they already exist, and
|
||||||
# after running TeX a first time the index files don't change, then
|
# after running TeX a first time the index files don't change, then
|
||||||
# there's no reason to run TeX again. But we won't know that if the
|
# there's no reason to run TeX again. But we won't know that if the
|
||||||
# index files are out of date or nonexistent.
|
# index files are out of date or nonexistent.
|
||||||
if test "${orig_index_files_sans_aux}" ; then
|
if test -n "${orig_index_files_sans_aux}"; then
|
||||||
|
$verbose "Running $texindex $orig_index_files_sans_aux ..."
|
||||||
${texindex} ${orig_index_files_sans_aux}
|
${texindex} ${orig_index_files_sans_aux}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ${tex} ${command_line_filename} ; then # TeX run first time
|
# Finally, run TeX.
|
||||||
definite_index_files=""
|
if test "$batch" = t; then
|
||||||
# Get list of new index files
|
tex_mode='\nonstopmode'
|
||||||
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
|
else
|
||||||
for this_file in ${possible_index_files} ; do
|
tex_mode=
|
||||||
# If file is empty, forget it.
|
fi
|
||||||
if test ! -s ${this_file} ; then
|
$verbose "Running $tex $filename_input ..."
|
||||||
continue;
|
cmd="$tex $tex_mode \\input $filename_input"
|
||||||
fi
|
$cmd
|
||||||
|
|
||||||
# Examine first character of file. If it's not a backslash or
|
# Check if index files changed.
|
||||||
# single quote, then it's definitely not an index or xref file.
|
#
|
||||||
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
|
definite_index_files=
|
||||||
if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
|
# Get list of new index files.
|
||||||
definite_index_files="${definite_index_files} ${this_file}"
|
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
|
||||||
fi
|
for this_file in ${possible_index_files}; do
|
||||||
|
# If file is empty, forget it.
|
||||||
|
test -s "${this_file}" || continue
|
||||||
|
|
||||||
|
# Examine first character of file. If it's not a backslash or
|
||||||
|
# single quote, then it's definitely not an index or xref file.
|
||||||
|
# (Will have to check for @ when we switch to Texinfo syntax in
|
||||||
|
# all these files...)
|
||||||
|
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
|
||||||
|
if test "x${first_character}" = "x\\" \
|
||||||
|
|| test "x${first_character}" = "x'"; then
|
||||||
|
definite_index_files="${definite_index_files} ${this_file}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
new_index_files="${definite_index_files}"
|
||||||
|
new_index_files_sans_aux="`echo ${definite_index_files} \
|
||||||
|
| sed 's/'${filename_noext}'\.aux//;
|
||||||
|
s/^[ ]*//;s/[ ]*$//;'`"
|
||||||
|
|
||||||
|
# If old and new list don't at least have the same file list, then one
|
||||||
|
# file or another has definitely changed.
|
||||||
|
$verbose "Original index files =$orig_index_files"
|
||||||
|
$verbose "New index files =$new_index_files"
|
||||||
|
if test "z${orig_index_files}" != "z${new_index_files}"; then
|
||||||
|
index_files_changed_p=t
|
||||||
|
else
|
||||||
|
# File list is the same. We must compare each file until we find a
|
||||||
|
# difference.
|
||||||
|
index_files_changed_p=
|
||||||
|
for this_file in ${new_index_files}; do
|
||||||
|
$verbose "Comparing index file $this_file ..."
|
||||||
|
# cmp -s will return nonzero exit status if files differ.
|
||||||
|
cmp -s "${this_file}" "${this_file}${backup_extension}"
|
||||||
|
if test $? -ne 0; then
|
||||||
|
# We only need to keep comparing until we find *one* that
|
||||||
|
# differs, because we'll have to run texindex & tex no
|
||||||
|
# matter what.
|
||||||
|
index_files_changed_p=t
|
||||||
|
$verbose "Index file $this_file differed:"
|
||||||
|
test $verbose = echo \
|
||||||
|
&& diff -c "${this_file}${backup_extension}" "${this_file}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
new_index_files="${definite_index_files}"
|
fi
|
||||||
new_index_files_sans_aux="`echo ${definite_index_files} \
|
|
||||||
| sed 's/'${filename_noext}'\.aux//;
|
|
||||||
s/^[ ]*//;s/[ ]*$//;'`"
|
|
||||||
|
|
||||||
# If old and new list don't at least have the same file list, then one
|
# If index files have changed since TeX has been run, or if the aux
|
||||||
# file or another has definitely changed.
|
# file wasn't present originally, run texindex and TeX again.
|
||||||
if test "${orig_index_files}" != "${new_index_files}" ; then
|
if test "${index_files_changed_p}"; then :; else
|
||||||
index_files_changed_p=t
|
# Nothing changed. We're done with TeX.
|
||||||
else
|
break
|
||||||
# File list is the same. We must compare each file until we find a
|
fi
|
||||||
# difference.
|
done
|
||||||
index_files_changed_p=""
|
|
||||||
for this_file in ${new_index_files} ; do
|
|
||||||
# cmp -s will return nonzero exit status if files differ.
|
|
||||||
cmp -s "${this_file}" "${this_file}${backup_extension}"
|
|
||||||
if test $? -ne 0 ; then
|
|
||||||
# We only need to keep comparing until we find *one* that
|
|
||||||
# differs, because we'll have to run texindex & tex no
|
|
||||||
# matter what.
|
|
||||||
index_files_changed_p=t
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If index files have changed since TeX has been run, or if the aux
|
# If we were in clean mode, compilation was in a tmp directory.
|
||||||
# file wasn't present originally, run texindex and TeX again.
|
# Copy the DVI file into the directory where the compilation
|
||||||
if test "${index_files_changed_p}" ; then
|
# has been done. (The temp dir is about to get removed anyway.)
|
||||||
retval=0
|
# We also return to the original directory so that
|
||||||
if test "${new_index_files_sans_aux}" ; then
|
# - the next file is processed in correct conditions
|
||||||
${texindex} ${new_index_files_sans_aux}
|
# - the temporary file can be removed
|
||||||
retval=$?
|
if test -n "$clean"; then
|
||||||
fi
|
$verbose "Copying DVI file from `pwd` to $orig_pwd"
|
||||||
if test ${retval} -eq 0 ; then
|
cp -p $filename_noext.dvi $orig_pwd
|
||||||
${tex} "${command_line_filename}"
|
cd $orig_pwd || exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generate list of files to delete, then call rm once with the entire
|
# Generate list of files to delete, then call rm once with the entire
|
||||||
# list. This is significantly faster than multiple executions of rm.
|
# list. This is significantly faster than multiple executions of rm.
|
||||||
file_list=""
|
file_list=
|
||||||
for file in ${orig_index_files} ; do
|
for file in ${orig_index_files}; do
|
||||||
file_list="${file_list} ${file}${backup_extension}"
|
file_list="${file_list} ${file}${backup_extension}"
|
||||||
done
|
done
|
||||||
if test "${file_list}" ; then
|
if test -n "${file_list}"; then
|
||||||
rm -f ${file_list}
|
$verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
|
||||||
fi
|
rm -f ${file_list}
|
||||||
|
rm -rf $tmp_dir $tmp_dir2
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# texi2dvi ends here
|
$verbose "$0 done."
|
||||||
|
true # exit successfully.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/local/bin/perl
|
||||||
'di ';
|
'di ';
|
||||||
'ig 00 ';
|
'ig 00 ';
|
||||||
#+##############################################################################
|
#+##############################################################################
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
# #
|
# #
|
||||||
#-##############################################################################
|
#-##############################################################################
|
||||||
|
|
||||||
# @(#)texi2html 1.51 09/10/96 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
|
# @(#)texi2html 1.52 01/05/98 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
|
||||||
|
|
||||||
# The man page for this program is included at the end of this file and can be
|
# The man page for this program is included at the end of this file and can be
|
||||||
# viewed using the command 'nroff -man texi2html'.
|
# viewed using the command 'nroff -man texi2html'.
|
||||||
|
@ -29,7 +29,7 @@ $DEBUG_DEF = 16;
|
||||||
$DEBUG_HTML = 32;
|
$DEBUG_HTML = 32;
|
||||||
$DEBUG_USER = 64;
|
$DEBUG_USER = 64;
|
||||||
|
|
||||||
$BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference
|
$BIBRE = '\[[\w\/-]+\]'; # RE for a bibliography reference
|
||||||
$FILERE = '[\/\w.+-]+'; # RE for a file name
|
$FILERE = '[\/\w.+-]+'; # RE for a file name
|
||||||
$VARRE = '[^\s\{\}]+'; # RE for a variable name
|
$VARRE = '[^\s\{\}]+'; # RE for a variable name
|
||||||
$NODERE = '[^@{}:\'`",]+'; # RE for a node name
|
$NODERE = '[^@{}:\'`",]+'; # RE for a node name
|
||||||
|
@ -37,8 +37,8 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names
|
||||||
$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE)
|
$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE)
|
||||||
|
|
||||||
$ERROR = "***"; # prefix for errors and warnings
|
$ERROR = "***"; # prefix for errors and warnings
|
||||||
$THISPROG = "texi2html 1.51"; # program name and version
|
$THISPROG = "texi2html 1.52"; # program name and version
|
||||||
$HOMEPAGE = "http://wwwcn.cern.ch/dci/texi2html/"; # program home page
|
$HOMEPAGE = "http://wwwinfo.cern.ch/dis/texi2html/"; # program home page
|
||||||
$TODAY = &pretty_date; # like "20 September 1993"
|
$TODAY = &pretty_date; # like "20 September 1993"
|
||||||
$SPLITTAG = "<!-- SPLIT HERE -->\n"; # tag to know where to split
|
$SPLITTAG = "<!-- SPLIT HERE -->\n"; # tag to know where to split
|
||||||
$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections
|
$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections
|
||||||
|
@ -129,6 +129,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
|
||||||
"!", "!",
|
"!", "!",
|
||||||
"?", "?",
|
"?", "?",
|
||||||
".", ".",
|
".", ".",
|
||||||
|
"-", "",
|
||||||
);
|
);
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -159,19 +160,23 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
|
||||||
'cite', 'CITE',
|
'cite', 'CITE',
|
||||||
'code', 'CODE',
|
'code', 'CODE',
|
||||||
'ctrl', '&do_ctrl', # special case
|
'ctrl', '&do_ctrl', # special case
|
||||||
'dfn', 'STRONG', # DFN tag is illegal in the standard
|
'dfn', 'EM', # DFN tag is illegal in the standard
|
||||||
'dmn', '', # useless
|
'dmn', '', # useless
|
||||||
|
'email', '&do_email', # insert a clickable email address
|
||||||
'emph', 'EM',
|
'emph', 'EM',
|
||||||
'file', '"TT', # will put quotes, cf. &apply_style
|
'file', '"TT', # will put quotes, cf. &apply_style
|
||||||
'i', 'I',
|
'i', 'I',
|
||||||
'kbd', 'KBD',
|
'kbd', 'KBD',
|
||||||
'key', 'KBD',
|
'key', 'KBD',
|
||||||
|
'math', 'EM',
|
||||||
'r', '', # unsupported
|
'r', '', # unsupported
|
||||||
'samp', '"SAMP', # will put quotes, cf. &apply_style
|
'samp', '"SAMP', # will put quotes, cf. &apply_style
|
||||||
'sc', '&do_sc', # special case
|
'sc', '&do_sc', # special case
|
||||||
'strong', 'STRONG',
|
'strong', 'STRONG',
|
||||||
't', 'TT',
|
't', 'TT',
|
||||||
'titlefont', '', # useless
|
'titlefont', '', # useless
|
||||||
|
'uref', '&do_uref', # insert a clickable URL
|
||||||
|
'url', '&do_url', # insert a clickable URL
|
||||||
'var', 'VAR',
|
'var', 'VAR',
|
||||||
'w', '', # unsupported
|
'w', '', # unsupported
|
||||||
);
|
);
|
||||||
|
@ -270,6 +275,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
|
||||||
'smallbook', 1,
|
'smallbook', 1,
|
||||||
'vskip', 1,
|
'vskip', 1,
|
||||||
'filbreak', 1,
|
'filbreak', 1,
|
||||||
|
'paragraphindent', 1,
|
||||||
# unsupported formats
|
# unsupported formats
|
||||||
'cartouche', 1,
|
'cartouche', 1,
|
||||||
'end cartouche', 1,
|
'end cartouche', 1,
|
||||||
|
@ -283,6 +289,8 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
|
||||||
# #
|
# #
|
||||||
#---############################################################################
|
#---############################################################################
|
||||||
|
|
||||||
|
%value = (); # hold texinfo variables, see also -D
|
||||||
|
|
||||||
$use_bibliography = 1;
|
$use_bibliography = 1;
|
||||||
$use_acc = 0;
|
$use_acc = 0;
|
||||||
$debug = 0;
|
$debug = 0;
|
||||||
|
@ -306,6 +314,7 @@ To convert a Texinfo file to HMTL: $0 [options] file
|
||||||
-expandinfo : use \@ifinfo sections, not \@iftex
|
-expandinfo : use \@ifinfo sections, not \@iftex
|
||||||
-glossary : handle a glossary
|
-glossary : handle a glossary
|
||||||
-invisible name: use 'name' as an invisible anchor
|
-invisible name: use 'name' as an invisible anchor
|
||||||
|
-Dname : define name like with \@set
|
||||||
-I dir : search also for files in 'dir'
|
-I dir : search also for files in 'dir'
|
||||||
-menu : handle menus
|
-menu : handle menus
|
||||||
-monolithic : output only one file including ToC
|
-monolithic : output only one file including ToC
|
||||||
|
@ -317,7 +326,7 @@ To convert a Texinfo file to HMTL: $0 [options] file
|
||||||
To check converted files: $0 -check [-verbose] files
|
To check converted files: $0 -check [-verbose] files
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
|
while (@ARGV && $ARGV[0] =~ /^-/) {
|
||||||
$_ = shift(@ARGV);
|
$_ = shift(@ARGV);
|
||||||
if (/^-acc$/) { $use_acc = 1; next; }
|
if (/^-acc$/) { $use_acc = 1; next; }
|
||||||
if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; }
|
if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; }
|
||||||
|
@ -327,6 +336,7 @@ while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
|
||||||
if (/^-g(lossary)?$/) { $use_glossary = 1; next; }
|
if (/^-g(lossary)?$/) { $use_glossary = 1; next; }
|
||||||
if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; }
|
if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; }
|
||||||
if (/^-iso$/) { $use_iso = 1; next; }
|
if (/^-iso$/) { $use_iso = 1; next; }
|
||||||
|
if (/^-D(.+)?$/) { $value{$1 || shift(@ARGV)} = 1; next; }
|
||||||
if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; }
|
if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; }
|
||||||
if (/^-m(enu)?$/) { $show_menu = 1; next; }
|
if (/^-m(enu)?$/) { $show_menu = 1; next; }
|
||||||
if (/^-mono(lithic)?$/) { $monolithic = 1; next; }
|
if (/^-mono(lithic)?$/) { $monolithic = 1; next; }
|
||||||
|
@ -383,9 +393,8 @@ if ($monolithic) {
|
||||||
#
|
#
|
||||||
# variables
|
# variables
|
||||||
#
|
#
|
||||||
%value = (); # hold texinfo variables
|
|
||||||
$value{'html'} = 1; # predefine html (the output format)
|
$value{'html'} = 1; # predefine html (the output format)
|
||||||
$value{'texi2html'} = '1.51'; # predefine texi2html (the translator)
|
$value{'texi2html'} = '1.52'; # predefine texi2html (the translator)
|
||||||
# _foo: internal to track @foo
|
# _foo: internal to track @foo
|
||||||
foreach ('_author', '_title', '_subtitle',
|
foreach ('_author', '_title', '_subtitle',
|
||||||
'_settitle', '_setfilename') {
|
'_settitle', '_setfilename') {
|
||||||
|
@ -453,7 +462,7 @@ $toplevel = 0; # top level seen in hierarchy
|
||||||
$curlevel = 0; # current level in TOC
|
$curlevel = 0; # current level in TOC
|
||||||
$node = ''; # current node name
|
$node = ''; # current node name
|
||||||
$in_table = 0; # am I inside a table
|
$in_table = 0; # am I inside a table
|
||||||
$table_type = ''; # type of table ('', 'f', 'v')
|
$table_type = ''; # type of table ('', 'f', 'v', 'multi')
|
||||||
@tables = (); # nested table support
|
@tables = (); # nested table support
|
||||||
$in_bibliography = 0; # am I inside a bibliography
|
$in_bibliography = 0; # am I inside a bibliography
|
||||||
$in_glossary = 0; # am I inside a glossary
|
$in_glossary = 0; # am I inside a glossary
|
||||||
|
@ -554,9 +563,11 @@ while ($_ = &next_line) {
|
||||||
#
|
#
|
||||||
s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/;
|
s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/;
|
||||||
# non-@ substitutions cf. texinfmt.el
|
# non-@ substitutions cf. texinfmt.el
|
||||||
s/``/\"/g;
|
unless ($in_pre) {
|
||||||
s/''/\"/g;
|
s/``/\"/g;
|
||||||
s/([\w ])---([\w ])/$1--$2/g;
|
s/''/\"/g;
|
||||||
|
s/([\w ])---([\w ])/$1--$2/g;
|
||||||
|
}
|
||||||
#
|
#
|
||||||
# analyze the tag
|
# analyze the tag
|
||||||
#
|
#
|
||||||
|
@ -570,14 +581,9 @@ while ($_ = &next_line) {
|
||||||
}
|
}
|
||||||
&skip_until($tag), next if $tag eq 'tex';
|
&skip_until($tag), next if $tag eq 'tex';
|
||||||
# handle special tables
|
# handle special tables
|
||||||
if ($tag eq 'table') {
|
if ($tag =~ /^(|f|v|multi)table$/) {
|
||||||
$table_type = '';
|
$table_type = $1;
|
||||||
} elsif ($tag eq 'ftable') {
|
|
||||||
$tag = 'table';
|
$tag = 'table';
|
||||||
$table_type = 'f';
|
|
||||||
} elsif ($tag eq 'vtable') {
|
|
||||||
$tag = 'table';
|
|
||||||
$table_type = 'v';
|
|
||||||
}
|
}
|
||||||
# special cases
|
# special cases
|
||||||
if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) {
|
if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) {
|
||||||
|
@ -647,11 +653,16 @@ while ($_ = &next_line) {
|
||||||
push(@lines, &debug("<$format_map{$tag}>\n", __LINE__));
|
push(@lines, &debug("<$format_map{$tag}>\n", __LINE__));
|
||||||
next;
|
next;
|
||||||
} elsif ($tag eq 'table') {
|
} elsif ($tag eq 'table') {
|
||||||
if (/^\@[fv]?table\s+\@(\w+)\s*$/) {
|
if (/^\@(|f|v|multi)table\s+\@(\w+)/) {
|
||||||
$in_table = $1;
|
$in_table = $2;
|
||||||
unshift(@tables, join($;, $table_type, $in_table));
|
unshift(@tables, join($;, $table_type, $in_table));
|
||||||
push(@lines, &debug("<DL COMPACT>\n", __LINE__));
|
if ($table_type eq "multi") {
|
||||||
&html_push_if('DL');
|
push(@lines, &debug("<TABLE BORDER>\n", __LINE__));
|
||||||
|
&html_push_if('TABLE');
|
||||||
|
} else {
|
||||||
|
push(@lines, &debug("<DL COMPACT>\n", __LINE__));
|
||||||
|
&html_push_if('DL');
|
||||||
|
}
|
||||||
push(@lines, &html_debug("\n", __LINE__));
|
push(@lines, &html_debug("\n", __LINE__));
|
||||||
} else {
|
} else {
|
||||||
warn "$ERROR Bad table line: $_";
|
warn "$ERROR Bad table line: $_";
|
||||||
|
@ -776,18 +787,29 @@ while ($_ = &next_line) {
|
||||||
&html_pop_if();
|
&html_pop_if();
|
||||||
push(@lines, &debug("</$format_map{$end_tag}>\n", __LINE__));
|
push(@lines, &debug("</$format_map{$end_tag}>\n", __LINE__));
|
||||||
push(@lines, &html_debug("\n", __LINE__));
|
push(@lines, &html_debug("\n", __LINE__));
|
||||||
} elsif ($end_tag eq 'table' ||
|
} elsif ($end_tag =~ /^(|f|v|multi)table$/) {
|
||||||
$end_tag eq 'ftable' ||
|
unless (@tables) {
|
||||||
$end_tag eq 'vtable') {
|
warn "$ERROR \@end $end_tag without \@*table\n";
|
||||||
shift(@tables);
|
next;
|
||||||
|
}
|
||||||
|
($table_type, $in_table) = split($;, shift(@tables));
|
||||||
|
unless ($1 eq $table_type) {
|
||||||
|
warn "$ERROR \@end $end_tag without matching \@$end_tag\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($table_type eq "multi") {
|
||||||
|
push(@lines, "</TR></TABLE>\n");
|
||||||
|
&html_pop_if('TR');
|
||||||
|
} else {
|
||||||
|
push(@lines, "</DL>\n");
|
||||||
|
&html_pop_if('DD');
|
||||||
|
}
|
||||||
|
&html_pop_if();
|
||||||
if (@tables) {
|
if (@tables) {
|
||||||
($table_type, $in_table) = split($;, $tables[0]);
|
($table_type, $in_table) = split($;, $tables[0]);
|
||||||
} else {
|
} else {
|
||||||
$in_table = 0;
|
$in_table = 0;
|
||||||
}
|
}
|
||||||
push(@lines, "</DL>\n");
|
|
||||||
&html_pop_if('DD');
|
|
||||||
&html_pop_if();
|
|
||||||
} elsif (defined($def_map{$end_tag})) {
|
} elsif (defined($def_map{$end_tag})) {
|
||||||
push(@lines, &debug("</DL>\n", __LINE__));
|
push(@lines, &debug("</DL>\n", __LINE__));
|
||||||
} elsif ($end_tag eq 'menu') {
|
} elsif ($end_tag eq 'menu') {
|
||||||
|
@ -986,6 +1008,12 @@ EOC
|
||||||
if ($table_type) { # add also an index
|
if ($table_type) { # add also an index
|
||||||
unshift(@input_spool, "\@${table_type}index $what\n");
|
unshift(@input_spool, "\@${table_type}index $what\n");
|
||||||
}
|
}
|
||||||
|
} elsif ($html_element eq 'TABLE') {
|
||||||
|
push(@lines, &debug("<TR><TD>$what</TD>\n", __LINE__));
|
||||||
|
&html_push('TR');
|
||||||
|
} elsif ($html_element eq 'TR') {
|
||||||
|
push(@lines, &debug("</TR>\n", __LINE__));
|
||||||
|
push(@lines, &debug("<TR><TD>$what</TD>\n", __LINE__));
|
||||||
} else {
|
} else {
|
||||||
push(@lines, &debug("<LI>$what\n", __LINE__));
|
push(@lines, &debug("<LI>$what\n", __LINE__));
|
||||||
&html_push('LI') unless $html_element eq 'LI';
|
&html_push('LI') unless $html_element eq 'LI';
|
||||||
|
@ -996,6 +1024,9 @@ EOC
|
||||||
$deferred_ref = '';
|
$deferred_ref = '';
|
||||||
}
|
}
|
||||||
next;
|
next;
|
||||||
|
} elsif (/^\@tab\s+(.*)$/) {
|
||||||
|
push(@lines, "<TD>$1</TD>\n");
|
||||||
|
next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1088,13 +1119,25 @@ while (@lines) {
|
||||||
print "# index $key sorted as $_\n"
|
print "# index $key sorted as $_\n"
|
||||||
if $key ne $_ && $debug & $DEBUG_INDEX;
|
if $key ne $_ && $debug & $DEBUG_INDEX;
|
||||||
}
|
}
|
||||||
|
push(@lines2, "Jump to:\n");
|
||||||
|
$last_letter = undef;
|
||||||
|
foreach $key (sort byalpha @keys) {
|
||||||
|
$letter = substr($key2alpha{$key}, 0, 1);
|
||||||
|
$letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
|
||||||
|
if (!defined($last_letter) || $letter ne $last_letter) {
|
||||||
|
push(@lines2, "-\n") if defined($last_letter);
|
||||||
|
push(@lines2, "<A HREF=\"#$index\_$letter\">" . &protect_html($letter) . "</A>\n");
|
||||||
|
$last_letter = $letter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
push(@lines2, "<P>\n");
|
||||||
$last_letter = undef;
|
$last_letter = undef;
|
||||||
foreach $key (sort byalpha @keys) {
|
foreach $key (sort byalpha @keys) {
|
||||||
$letter = substr($key2alpha{$key}, 0, 1);
|
$letter = substr($key2alpha{$key}, 0, 1);
|
||||||
$letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
|
$letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
|
||||||
if (!defined($last_letter) || $letter ne $last_letter) {
|
if (!defined($last_letter) || $letter ne $last_letter) {
|
||||||
push(@lines2, "</DIR>\n") if defined($last_letter);
|
push(@lines2, "</DIR>\n") if defined($last_letter);
|
||||||
push(@lines2, "<H2>" . &protect_html($letter) . "</H2>\n");
|
push(@lines2, "<H2><A NAME=\"$index\_$letter\">" . &protect_html($letter) . "</A></H2>\n");
|
||||||
push(@lines2, "<DIR>\n");
|
push(@lines2, "<DIR>\n");
|
||||||
$last_letter = $letter;
|
$last_letter = $letter;
|
||||||
}
|
}
|
||||||
|
@ -1657,8 +1700,24 @@ sub menu_entry {
|
||||||
|
|
||||||
sub do_ctrl { "^$_[0]" }
|
sub do_ctrl { "^$_[0]" }
|
||||||
|
|
||||||
|
sub do_email {
|
||||||
|
local($addr, $text) = split(/,\s*/, $_[0]);
|
||||||
|
|
||||||
|
$text = $addr unless $text;
|
||||||
|
&anchor('', "mailto:$addr", $text);
|
||||||
|
}
|
||||||
|
|
||||||
sub do_sc { "\U$_[0]\E" }
|
sub do_sc { "\U$_[0]\E" }
|
||||||
|
|
||||||
|
sub do_uref {
|
||||||
|
local($url, $text) = split(/,\s*/, $_[0]);
|
||||||
|
|
||||||
|
$text = $url unless $text;
|
||||||
|
&anchor('', $url, $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub do_url { &anchor('', $_[0], $_[0]) }
|
||||||
|
|
||||||
sub apply_style {
|
sub apply_style {
|
||||||
local($texi_style, $text) = @_;
|
local($texi_style, $text) = @_;
|
||||||
local($style);
|
local($style);
|
||||||
|
@ -1822,7 +1881,7 @@ sub print_toplevel_footer {
|
||||||
print FILE <<EOT;
|
print FILE <<EOT;
|
||||||
This document was generated on $TODAY using the
|
This document was generated on $TODAY using the
|
||||||
<A HREF=\"$HOMEPAGE\">texi2html</A>
|
<A HREF=\"$HOMEPAGE\">texi2html</A>
|
||||||
translator version 1.51.</P>
|
translator version 1.52.</P>
|
||||||
EOT
|
EOT
|
||||||
&print_footer;
|
&print_footer;
|
||||||
}
|
}
|
||||||
|
@ -1879,7 +1938,7 @@ sub byalpha {
|
||||||
.nr nl 0-1 \" fake up transition to first page again
|
.nr nl 0-1 \" fake up transition to first page again
|
||||||
.nr % 0 \" start at page 1
|
.nr % 0 \" start at page 1
|
||||||
'; __END__ ############# From here on it's a standard manual page ############
|
'; __END__ ############# From here on it's a standard manual page ############
|
||||||
.TH TEXI2HTML 1 "09/10/96"
|
.TH TEXI2HTML 1 "01/05/98"
|
||||||
.AT 3
|
.AT 3
|
||||||
.SH NAME
|
.SH NAME
|
||||||
texi2html \- a Texinfo to HTML converter
|
texi2html \- a Texinfo to HTML converter
|
||||||
|
@ -1924,8 +1983,9 @@ Use the section named 'Glossary' to build a list of terms and put links in the H
|
||||||
document from each term toward its definition.
|
document from each term toward its definition.
|
||||||
.TP
|
.TP
|
||||||
.B \-invisible \fIname\fP
|
.B \-invisible \fIname\fP
|
||||||
Use \fIname\fP to create invisible destination anchors for index links. This is a workaround
|
Use \fIname\fP to create invisible destination anchors for index links
|
||||||
for a known bug of many WWW browsers, including xmosaic.
|
(you can for instance use the invisible.xbm file shipped with this program).
|
||||||
|
This is a workaround for a known bug of many WWW browsers, including netscape.
|
||||||
.TP
|
.TP
|
||||||
.B \-I \fIdir\fP
|
.B \-I \fIdir\fP
|
||||||
Look also in \fIdir\fP to find included files.
|
Look also in \fIdir\fP to find included files.
|
||||||
|
@ -1985,21 +2045,21 @@ option, it creates only one file:
|
||||||
predefines the following variables: \fBhtml\fP, \fBtexi2html\fP.
|
predefines the following variables: \fBhtml\fP, \fBtexi2html\fP.
|
||||||
.SH ADDITIONAL COMMANDS
|
.SH ADDITIONAL COMMANDS
|
||||||
.I texi2html
|
.I texi2html
|
||||||
implements the following non-Texinfo commands:
|
implements the following non-Texinfo commands (maybe they are in Texinfo now...):
|
||||||
.TP 16
|
.TP 16
|
||||||
.B @ifhtml
|
.B @ifhtml
|
||||||
This indicates the start of an HTML section, this section will passed through
|
This indicates the start of an HTML section, this section will passed through
|
||||||
without any modofication.
|
without any modification.
|
||||||
.TP
|
.TP
|
||||||
.B @end ifhtml
|
.B @end ifhtml
|
||||||
This indcates the end of an HTML section.
|
This indicates the end of an HTML section.
|
||||||
.SH VERSION
|
.SH VERSION
|
||||||
This is \fItexi2html\fP version 1.51, 09/10/96.
|
This is \fItexi2html\fP version 1.52, 01/05/98.
|
||||||
.PP
|
.PP
|
||||||
The latest version of \fItexi2html\fP can be found in WWW, cf. URL
|
The latest version of \fItexi2html\fP can be found in WWW, cf. URL
|
||||||
http://wwwcn.cern.ch/dci/texi2html/
|
http://wwwinfo.cern.ch/dis/texi2html/
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
The main author is Lionel Cons, CERN CN/DCI/UWS, Lionel.Cons@cern.ch.
|
The main author is Lionel Cons, CERN IT/DIS/OSE, Lionel.Cons@cern.ch.
|
||||||
Many other people around the net contributed to this program.
|
Many other people around the net contributed to this program.
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
This program is the intellectual property of the European
|
This program is the intellectual property of the European
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# This is the Makefile for the examples subdirectory of readline. -*- text -*-
|
# This is the Makefile for the examples subdirectory of readline. -*- text -*-
|
||||||
#
|
#
|
||||||
SHELL = /bin/sh
|
SHELL = @MAKE_SHELL@
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
@ -14,7 +14,7 @@ CFLAGS = @CFLAGS@
|
||||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@
|
LOCAL_CFLAGS = @LOCAL_CFLAGS@
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
|
||||||
INCLUDES = -I $(srcdir) -I $(top_srcdir) -I..
|
INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
|
||||||
|
|
||||||
CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
|
CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
|
||||||
LDFLAGS = -g -L..
|
LDFLAGS = -g -L..
|
||||||
|
@ -22,10 +22,11 @@ LDFLAGS = -g -L..
|
||||||
TERMCAP_LIB = @TERMCAP_LIB@
|
TERMCAP_LIB = @TERMCAP_LIB@
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
|
${RM} $@
|
||||||
$(CC) $(CCFLAGS) -c $<
|
$(CC) $(CCFLAGS) -c $<
|
||||||
|
|
||||||
EXECUTABLES = fileman rltest rl
|
EXECUTABLES = fileman rltest rl rlversion
|
||||||
OBJECTS = fileman.o rltest.o rl.o
|
OBJECTS = fileman.o rltest.o rl.o rlversion.o
|
||||||
|
|
||||||
all: $(EXECUTABLES)
|
all: $(EXECUTABLES)
|
||||||
|
|
||||||
|
@ -38,6 +39,9 @@ fileman: fileman.o
|
||||||
rltest: rltest.o
|
rltest: rltest.o
|
||||||
$(CC) $(LDFLAGS) -o $@ rltest.o -lreadline $(TERMCAP_LIB)
|
$(CC) $(LDFLAGS) -o $@ rltest.o -lreadline $(TERMCAP_LIB)
|
||||||
|
|
||||||
|
rlversion: rlversion.o
|
||||||
|
$(CC) $(LDFLAGS) -o $@ rlversion.o -lreadline $(TERMCAP_LIB)
|
||||||
|
|
||||||
clean mostlyclean:
|
clean mostlyclean:
|
||||||
$(RM) $(OBJECTS)
|
$(RM) $(OBJECTS)
|
||||||
$(RM) $(EXECUTABLES)
|
$(RM) $(EXECUTABLES)
|
||||||
|
@ -48,3 +52,4 @@ distclean maintainer-clean: clean
|
||||||
fileman.o: fileman.c
|
fileman.o: fileman.c
|
||||||
rltest.o: rltest.c
|
rltest.o: rltest.c
|
||||||
rl.o: rl.c
|
rl.o: rl.c
|
||||||
|
rlversion.o: rlversion.c
|
||||||
|
|
|
@ -42,6 +42,7 @@ set_deftext ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default]\n",
|
fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default]\n",
|
||||||
|
@ -54,7 +55,7 @@ main (argc, argv)
|
||||||
{
|
{
|
||||||
char *temp, *prompt;
|
char *temp, *prompt;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int done, opt, fd;
|
int opt, fd;
|
||||||
FILE *ifp;
|
FILE *ifp;
|
||||||
|
|
||||||
progname = strrchr(argv[0], '/');
|
progname = strrchr(argv[0], '/');
|
||||||
|
|
21
readline/examples/rlversion.c
Normal file
21
readline/examples/rlversion.c
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* rlversion -- print out readline's version number
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define READLINE_LIBRARY
|
||||||
|
|
||||||
|
#if defined (HAVE_CONFIG_H)
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include "posixstat.h"
|
||||||
|
|
||||||
|
#include "readline.h"
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
printf ("%s\n", rl_library_version ? rl_library_version : "unknown");
|
||||||
|
exit (0);
|
||||||
|
}
|
|
@ -71,6 +71,7 @@ static FUNMAP default_funmap[] = {
|
||||||
{ "copy-forward-word", rl_copy_forward_word },
|
{ "copy-forward-word", rl_copy_forward_word },
|
||||||
{ "copy-region-as-kill", rl_copy_region_to_kill },
|
{ "copy-region-as-kill", rl_copy_region_to_kill },
|
||||||
{ "delete-char", rl_delete },
|
{ "delete-char", rl_delete },
|
||||||
|
{ "delete-char-or-list", rl_delete_or_show_completions },
|
||||||
{ "delete-horizontal-space", rl_delete_horizontal_space },
|
{ "delete-horizontal-space", rl_delete_horizontal_space },
|
||||||
{ "digit-argument", rl_digit_argument },
|
{ "digit-argument", rl_digit_argument },
|
||||||
{ "do-lowercase-version", rl_do_lowercase_version },
|
{ "do-lowercase-version", rl_do_lowercase_version },
|
||||||
|
@ -83,6 +84,7 @@ static FUNMAP default_funmap[] = {
|
||||||
{ "end-of-history", rl_end_of_history },
|
{ "end-of-history", rl_end_of_history },
|
||||||
{ "end-of-line", rl_end_of_line },
|
{ "end-of-line", rl_end_of_line },
|
||||||
{ "exchange-point-and-mark", rl_exchange_point_and_mark },
|
{ "exchange-point-and-mark", rl_exchange_point_and_mark },
|
||||||
|
{ "forward-backward-delete-char", rl_rubout_or_delete },
|
||||||
{ "forward-char", rl_forward },
|
{ "forward-char", rl_forward },
|
||||||
{ "forward-search-history", rl_forward_search_history },
|
{ "forward-search-history", rl_forward_search_history },
|
||||||
{ "forward-word", rl_forward_word },
|
{ "forward-word", rl_forward_word },
|
||||||
|
|
|
@ -365,6 +365,10 @@ hist_error(s, start, current, errtype)
|
||||||
emsg = "unrecognized history modifier";
|
emsg = "unrecognized history modifier";
|
||||||
elen = 29;
|
elen = 29;
|
||||||
break;
|
break;
|
||||||
|
case NO_PREV_SUBST:
|
||||||
|
emsg = "no previous substitution";
|
||||||
|
elen = 24;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
emsg = "unknown expansion error";
|
emsg = "unknown expansion error";
|
||||||
elen = 23;
|
elen = 23;
|
||||||
|
@ -654,15 +658,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there is no lhs, the substitution can't succeed. */
|
|
||||||
if (subst_lhs_len == 0)
|
|
||||||
{
|
|
||||||
*ret_string = hist_error (string, starting_index, i, SUBST_FAILED);
|
|
||||||
free (result);
|
|
||||||
free (temp);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
FREE (subst_rhs);
|
FREE (subst_rhs);
|
||||||
subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len);
|
subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len);
|
||||||
|
|
||||||
|
@ -674,6 +669,15 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
||||||
else
|
else
|
||||||
i += 2;
|
i += 2;
|
||||||
|
|
||||||
|
/* If there is no lhs, the substitution can't succeed. */
|
||||||
|
if (subst_lhs_len == 0)
|
||||||
|
{
|
||||||
|
*ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST);
|
||||||
|
free (result);
|
||||||
|
free (temp);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
l_temp = strlen (temp);
|
l_temp = strlen (temp);
|
||||||
/* Ignore impossible cases. */
|
/* Ignore impossible cases. */
|
||||||
if (subst_lhs_len > l_temp)
|
if (subst_lhs_len > l_temp)
|
||||||
|
|
|
@ -155,7 +155,11 @@ read_history_range (filename, from, to)
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = xmalloc (file_size + 1);
|
buffer = xmalloc (file_size + 1);
|
||||||
|
#if 0
|
||||||
if (read (file, buffer, file_size) != file_size)
|
if (read (file, buffer, file_size) != file_size)
|
||||||
|
#else
|
||||||
|
if (read (file, buffer, file_size) < 0)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
error_and_exit:
|
error_and_exit:
|
||||||
if (file >= 0)
|
if (file >= 0)
|
||||||
|
@ -217,7 +221,7 @@ read_history_range (filename, from, to)
|
||||||
int
|
int
|
||||||
history_truncate_file (fname, lines)
|
history_truncate_file (fname, lines)
|
||||||
char *fname;
|
char *fname;
|
||||||
register int lines;
|
int lines;
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
int file, chars_read;
|
int file, chars_read;
|
||||||
|
@ -276,6 +280,12 @@ history_truncate_file (fname, lines)
|
||||||
if (i && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
|
if (i && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
|
||||||
{
|
{
|
||||||
write (file, buffer + i, file_size - i);
|
write (file, buffer + i, file_size - i);
|
||||||
|
|
||||||
|
#if defined (__BEOS__)
|
||||||
|
/* BeOS ignores O_TRUNC. */
|
||||||
|
ftruncate (file, file_size - i);
|
||||||
|
#endif
|
||||||
|
|
||||||
close (file);
|
close (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ extern char *strchr ();
|
||||||
#define BAD_WORD_SPEC 1
|
#define BAD_WORD_SPEC 1
|
||||||
#define SUBST_FAILED 2
|
#define SUBST_FAILED 2
|
||||||
#define BAD_MODIFIER 3
|
#define BAD_MODIFIER 3
|
||||||
|
#define NO_PREV_SUBST 4
|
||||||
|
|
||||||
/* Possible definitions for history starting point specification. */
|
/* Possible definitions for history starting point specification. */
|
||||||
#define ANCHORED_SEARCH 1
|
#define ANCHORED_SEARCH 1
|
||||||
|
|
|
@ -278,7 +278,7 @@ HIST_ENTRY *
|
||||||
replace_history_entry (which, line, data)
|
replace_history_entry (which, line, data)
|
||||||
int which;
|
int which;
|
||||||
char *line;
|
char *line;
|
||||||
char *data;
|
histdata_t data;
|
||||||
{
|
{
|
||||||
HIST_ENTRY *temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
|
HIST_ENTRY *temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
|
||||||
HIST_ENTRY *old_value;
|
HIST_ENTRY *old_value;
|
||||||
|
|
|
@ -22,6 +22,16 @@
|
||||||
#ifndef _HISTORY_H_
|
#ifndef _HISTORY_H_
|
||||||
#define _HISTORY_H_
|
#define _HISTORY_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined READLINE_LIBRARY
|
||||||
|
# include "rlstdc.h"
|
||||||
|
#else
|
||||||
|
# include <readline/rlstdc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined (_FUNCTION_DEF)
|
#if !defined (_FUNCTION_DEF)
|
||||||
# define _FUNCTION_DEF
|
# define _FUNCTION_DEF
|
||||||
typedef int Function ();
|
typedef int Function ();
|
||||||
|
@ -30,10 +40,16 @@ typedef char *CPFunction ();
|
||||||
typedef char **CPPFunction ();
|
typedef char **CPPFunction ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
||||||
|
typedef void *histdata_t;
|
||||||
|
#else
|
||||||
|
typedef char *histdata_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The structure used to store a history entry. */
|
/* The structure used to store a history entry. */
|
||||||
typedef struct _hist_entry {
|
typedef struct _hist_entry {
|
||||||
char *line;
|
char *line;
|
||||||
char *data;
|
histdata_t data;
|
||||||
} HIST_ENTRY;
|
} HIST_ENTRY;
|
||||||
|
|
||||||
/* A structure used to pass the current state of the history stuff around. */
|
/* A structure used to pass the current state of the history stuff around. */
|
||||||
|
@ -52,81 +68,81 @@ typedef struct _hist_state {
|
||||||
|
|
||||||
/* Begin a session in which the history functions might be used. This
|
/* Begin a session in which the history functions might be used. This
|
||||||
just initializes the interactive variables. */
|
just initializes the interactive variables. */
|
||||||
extern void using_history ();
|
extern void using_history __P((void));
|
||||||
|
|
||||||
/* Return the current HISTORY_STATE of the history. */
|
/* Return the current HISTORY_STATE of the history. */
|
||||||
extern HISTORY_STATE *history_get_history_state ();
|
extern HISTORY_STATE *history_get_history_state __P((void));
|
||||||
|
|
||||||
/* Set the state of the current history array to STATE. */
|
/* Set the state of the current history array to STATE. */
|
||||||
extern void history_set_history_state ();
|
extern void history_set_history_state __P((HISTORY_STATE *));
|
||||||
|
|
||||||
/* Manage the history list. */
|
/* Manage the history list. */
|
||||||
|
|
||||||
/* Place STRING at the end of the history list.
|
/* Place STRING at the end of the history list.
|
||||||
The associated data field (if any) is set to NULL. */
|
The associated data field (if any) is set to NULL. */
|
||||||
extern void add_history ();
|
extern void add_history __P((char *));
|
||||||
|
|
||||||
/* A reasonably useless function, only here for completeness. WHICH
|
/* A reasonably useless function, only here for completeness. WHICH
|
||||||
is the magic number that tells us which element to delete. The
|
is the magic number that tells us which element to delete. The
|
||||||
elements are numbered from 0. */
|
elements are numbered from 0. */
|
||||||
extern HIST_ENTRY *remove_history ();
|
extern HIST_ENTRY *remove_history __P((int));
|
||||||
|
|
||||||
/* Make the history entry at WHICH have LINE and DATA. This returns
|
/* Make the history entry at WHICH have LINE and DATA. This returns
|
||||||
the old entry so you can dispose of the data. In the case of an
|
the old entry so you can dispose of the data. In the case of an
|
||||||
invalid WHICH, a NULL pointer is returned. */
|
invalid WHICH, a NULL pointer is returned. */
|
||||||
extern HIST_ENTRY *replace_history_entry ();
|
extern HIST_ENTRY *replace_history_entry __P((int, char *, histdata_t));
|
||||||
|
|
||||||
/* Clear the history list and start over. */
|
/* Clear the history list and start over. */
|
||||||
extern void clear_history ();
|
extern void clear_history __P((void));
|
||||||
|
|
||||||
/* Stifle the history list, remembering only MAX number of entries. */
|
/* Stifle the history list, remembering only MAX number of entries. */
|
||||||
extern void stifle_history ();
|
extern void stifle_history __P((int));
|
||||||
|
|
||||||
/* Stop stifling the history. This returns the previous amount the
|
/* Stop stifling the history. This returns the previous amount the
|
||||||
history was stifled by. The value is positive if the history was
|
history was stifled by. The value is positive if the history was
|
||||||
stifled, negative if it wasn't. */
|
stifled, negative if it wasn't. */
|
||||||
extern int unstifle_history ();
|
extern int unstifle_history __P((void));
|
||||||
|
|
||||||
/* Return 1 if the history is stifled, 0 if it is not. */
|
/* Return 1 if the history is stifled, 0 if it is not. */
|
||||||
extern int history_is_stifled ();
|
extern int history_is_stifled __P((void));
|
||||||
|
|
||||||
/* Information about the history list. */
|
/* Information about the history list. */
|
||||||
|
|
||||||
/* Return a NULL terminated array of HIST_ENTRY which is the current input
|
/* 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
|
history. Element 0 of this list is the beginning of time. If there
|
||||||
is no history, return NULL. */
|
is no history, return NULL. */
|
||||||
extern HIST_ENTRY **history_list ();
|
extern HIST_ENTRY **history_list __P((void));
|
||||||
|
|
||||||
/* Returns the number which says what history element we are now
|
/* Returns the number which says what history element we are now
|
||||||
looking at. */
|
looking at. */
|
||||||
extern int where_history ();
|
extern int where_history __P((void));
|
||||||
|
|
||||||
/* Return the history entry at the current position, as determined by
|
/* Return the history entry at the current position, as determined by
|
||||||
history_offset. If there is no entry there, return a NULL pointer. */
|
history_offset. If there is no entry there, return a NULL pointer. */
|
||||||
HIST_ENTRY *current_history ();
|
HIST_ENTRY *current_history __P((void));
|
||||||
|
|
||||||
/* Return the history entry which is logically at OFFSET in the history
|
/* Return the history entry which is logically at OFFSET in the history
|
||||||
array. OFFSET is relative to history_base. */
|
array. OFFSET is relative to history_base. */
|
||||||
extern HIST_ENTRY *history_get ();
|
extern HIST_ENTRY *history_get __P((int));
|
||||||
|
|
||||||
/* Return the number of bytes that the primary history entries are using.
|
/* Return the number of bytes that the primary history entries are using.
|
||||||
This just adds up the lengths of the_history->lines. */
|
This just adds up the lengths of the_history->lines. */
|
||||||
extern int history_total_bytes ();
|
extern int history_total_bytes __P((void));
|
||||||
|
|
||||||
/* Moving around the history list. */
|
/* Moving around the history list. */
|
||||||
|
|
||||||
/* Set the position in the history list to POS. */
|
/* Set the position in the history list to POS. */
|
||||||
int history_set_pos ();
|
int history_set_pos __P((int));
|
||||||
|
|
||||||
/* Back up history_offset to the previous history entry, and return
|
/* Back up history_offset to the previous history entry, and return
|
||||||
a pointer to that entry. If there is no previous entry, return
|
a pointer to that entry. If there is no previous entry, return
|
||||||
a NULL pointer. */
|
a NULL pointer. */
|
||||||
extern HIST_ENTRY *previous_history ();
|
extern HIST_ENTRY *previous_history __P((void));
|
||||||
|
|
||||||
/* Move history_offset forward to the next item in the input_history,
|
/* Move history_offset forward to the next item in the input_history,
|
||||||
and return the a pointer to that entry. If there is no next entry,
|
and return the a pointer to that entry. If there is no next entry,
|
||||||
return a NULL pointer. */
|
return a NULL pointer. */
|
||||||
extern HIST_ENTRY *next_history ();
|
extern HIST_ENTRY *next_history __P((void));
|
||||||
|
|
||||||
/* Searching the history list. */
|
/* Searching the history list. */
|
||||||
|
|
||||||
|
@ -136,44 +152,45 @@ extern HIST_ENTRY *next_history ();
|
||||||
current_history () is the history entry, and the value of this function
|
current_history () is the history entry, and the value of this function
|
||||||
is the offset in the line of that history entry that the string was
|
is the offset in the line of that history entry that the string was
|
||||||
found in. Otherwise, nothing is changed, and a -1 is returned. */
|
found in. Otherwise, nothing is changed, and a -1 is returned. */
|
||||||
extern int history_search ();
|
extern int history_search __P((char *, int));
|
||||||
|
|
||||||
/* Search the history for STRING, starting at history_offset.
|
/* Search the history for STRING, starting at history_offset.
|
||||||
The search is anchored: matching lines must begin with string. */
|
The search is anchored: matching lines must begin with string.
|
||||||
extern int history_search_prefix ();
|
DIRECTION is as in history_search(). */
|
||||||
|
extern int history_search_prefix __P((char *, int));
|
||||||
|
|
||||||
/* Search for STRING in the history list, starting at POS, an
|
/* Search for STRING in the history list, starting at POS, an
|
||||||
absolute index into the list. DIR, if negative, says to search
|
absolute index into the list. DIR, if negative, says to search
|
||||||
backwards from POS, else forwards.
|
backwards from POS, else forwards.
|
||||||
Returns the absolute index of the history element where STRING
|
Returns the absolute index of the history element where STRING
|
||||||
was found, or -1 otherwise. */
|
was found, or -1 otherwise. */
|
||||||
extern int history_search_pos ();
|
extern int history_search_pos __P((char *, int, int));
|
||||||
|
|
||||||
/* Managing the history file. */
|
/* Managing the history file. */
|
||||||
|
|
||||||
/* Add the contents of FILENAME to the history list, a line at a time.
|
/* 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
|
If FILENAME is NULL, then read from ~/.history. Returns 0 if
|
||||||
successful, or errno if not. */
|
successful, or errno if not. */
|
||||||
extern int read_history ();
|
extern int read_history __P((char *));
|
||||||
|
|
||||||
/* Read a range of lines from FILENAME, adding them to the history list.
|
/* Read a range of lines from FILENAME, adding them to the history list.
|
||||||
Start reading at the FROM'th line and end at the TO'th. If FROM
|
Start reading at the FROM'th line and end at the TO'th. If FROM
|
||||||
is zero, start at the beginning. If TO is less than FROM, read
|
is zero, start at the beginning. If TO is less than FROM, read
|
||||||
until the end of the file. If FILENAME is NULL, then read from
|
until the end of the file. If FILENAME is NULL, then read from
|
||||||
~/.history. Returns 0 if successful, or errno if not. */
|
~/.history. Returns 0 if successful, or errno if not. */
|
||||||
extern int read_history_range ();
|
extern int read_history_range __P((char *, int, int));
|
||||||
|
|
||||||
/* Write the current history to FILENAME. If FILENAME is NULL,
|
/* Write the current history to FILENAME. If FILENAME is NULL,
|
||||||
then write the history list to ~/.history. Values returned
|
then write the history list to ~/.history. Values returned
|
||||||
are as in read_history (). */
|
are as in read_history (). */
|
||||||
extern int write_history ();
|
extern int write_history __P((char *));
|
||||||
|
|
||||||
/* Append NELEMENT entries to FILENAME. The entries appended are from
|
/* Append NELEMENT entries to FILENAME. The entries appended are from
|
||||||
the end of the list minus NELEMENTs up to the end of the list. */
|
the end of the list minus NELEMENTs up to the end of the list. */
|
||||||
int append_history ();
|
int append_history __P((int, char *));
|
||||||
|
|
||||||
/* Truncate the history file, leaving only the last NLINES lines. */
|
/* Truncate the history file, leaving only the last NLINES lines. */
|
||||||
extern int history_truncate_file ();
|
extern int history_truncate_file __P((char *, int));
|
||||||
|
|
||||||
/* History expansion. */
|
/* History expansion. */
|
||||||
|
|
||||||
|
@ -189,20 +206,24 @@ extern int history_truncate_file ();
|
||||||
|
|
||||||
If an error ocurred in expansion, then OUTPUT contains a descriptive
|
If an error ocurred in expansion, then OUTPUT contains a descriptive
|
||||||
error message. */
|
error message. */
|
||||||
extern int history_expand ();
|
extern int history_expand __P((char *, char **));
|
||||||
|
|
||||||
/* Extract a string segment consisting of the FIRST through LAST
|
/* Extract a string segment consisting of the FIRST through LAST
|
||||||
arguments present in STRING. Arguments are broken up as in
|
arguments present in STRING. Arguments are broken up as in
|
||||||
the shell. */
|
the shell. */
|
||||||
extern char *history_arg_extract ();
|
extern char *history_arg_extract __P((int, int, char *));
|
||||||
|
|
||||||
/* Return the text of the history event beginning at the current
|
/* Return the text of the history event beginning at the current
|
||||||
offset into STRING. */
|
offset into STRING. Pass STRING with *INDEX equal to the
|
||||||
extern char *get_history_event ();
|
history_expansion_char that begins this specification.
|
||||||
|
DELIMITING_QUOTE is a character that is allowed to end the string
|
||||||
|
specification for what to search for in addition to the normal
|
||||||
|
characters `:', ` ', `\t', `\n', and sometimes `?'. */
|
||||||
|
extern char *get_history_event __P((char *, int *, int));
|
||||||
|
|
||||||
/* Return an array of tokens, much as the shell might. The tokens are
|
/* Return an array of tokens, much as the shell might. The tokens are
|
||||||
parsed out of STRING. */
|
parsed out of STRING. */
|
||||||
extern char **history_tokenize ();
|
extern char **history_tokenize __P((char *));
|
||||||
|
|
||||||
/* Exported history variables. */
|
/* Exported history variables. */
|
||||||
extern int history_base;
|
extern int history_base;
|
||||||
|
@ -220,4 +241,8 @@ extern int history_quotes_inhibit_expansion;
|
||||||
application and not expanded. */
|
application and not expanded. */
|
||||||
extern Function *history_inhibit_expansion_function;
|
extern Function *history_inhibit_expansion_function;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* !_HISTORY_H_ */
|
#endif /* !_HISTORY_H_ */
|
||||||
|
|
|
@ -124,38 +124,13 @@ _rl_any_typein ()
|
||||||
return any_typein;
|
return any_typein;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add KEY to the buffer of characters to be read. */
|
/* Return the amount of space available in the buffer for stuffing
|
||||||
int
|
characters. */
|
||||||
rl_stuff_char (key)
|
|
||||||
int key;
|
|
||||||
{
|
|
||||||
if (key == EOF)
|
|
||||||
{
|
|
||||||
key = NEWLINE;
|
|
||||||
rl_pending_input = EOF;
|
|
||||||
}
|
|
||||||
ibuffer[push_index++] = key;
|
|
||||||
if (push_index >= ibuffer_len)
|
|
||||||
push_index = 0;
|
|
||||||
return push_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make C be the next command to be executed. */
|
|
||||||
int
|
|
||||||
rl_execute_next (c)
|
|
||||||
int c;
|
|
||||||
{
|
|
||||||
rl_pending_input = c;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the amount of space available in the
|
|
||||||
buffer for stuffing characters. */
|
|
||||||
static int
|
static int
|
||||||
ibuffer_space ()
|
ibuffer_space ()
|
||||||
{
|
{
|
||||||
if (pop_index > push_index)
|
if (pop_index > push_index)
|
||||||
return (pop_index - push_index);
|
return (pop_index - push_index - 1);
|
||||||
else
|
else
|
||||||
return (ibuffer_len - (push_index - pop_index));
|
return (ibuffer_len - (push_index - pop_index));
|
||||||
}
|
}
|
||||||
|
@ -341,6 +316,36 @@ _rl_insert_typein (c)
|
||||||
free (string);
|
free (string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add KEY to the buffer of characters to be read. Returns 1 if the
|
||||||
|
character was stuffed correctly; 0 otherwise. */
|
||||||
|
int
|
||||||
|
rl_stuff_char (key)
|
||||||
|
int key;
|
||||||
|
{
|
||||||
|
if (ibuffer_space () == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (key == EOF)
|
||||||
|
{
|
||||||
|
key = NEWLINE;
|
||||||
|
rl_pending_input = EOF;
|
||||||
|
}
|
||||||
|
ibuffer[push_index++] = key;
|
||||||
|
if (push_index >= ibuffer_len)
|
||||||
|
push_index = 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make C be the next command to be executed. */
|
||||||
|
int
|
||||||
|
rl_execute_next (c)
|
||||||
|
int c;
|
||||||
|
{
|
||||||
|
rl_pending_input = c;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Character Input */
|
/* Character Input */
|
||||||
|
@ -409,6 +414,11 @@ rl_getc (stream)
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
return (EOF);
|
return (EOF);
|
||||||
|
|
||||||
|
#if defined (__BEOS__)
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (EWOULDBLOCK)
|
#if defined (EWOULDBLOCK)
|
||||||
if (errno == EWOULDBLOCK)
|
if (errno == EWOULDBLOCK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
||||||
|
/* Variables exported to other files in the readline library. */
|
||||||
|
unsigned char *_rl_isearch_terminators = (unsigned char *)NULL;
|
||||||
|
|
||||||
/* Variables imported from other files in the readline library. */
|
/* Variables imported from other files in the readline library. */
|
||||||
extern Keymap _rl_keymap;
|
extern Keymap _rl_keymap;
|
||||||
extern HIST_ENTRY *saved_line_for_history;
|
extern HIST_ENTRY *saved_line_for_history;
|
||||||
|
@ -55,9 +58,6 @@ extern int rl_line_buffer_len;
|
||||||
extern int rl_point, rl_end;
|
extern int rl_point, rl_end;
|
||||||
extern char *rl_line_buffer;
|
extern char *rl_line_buffer;
|
||||||
|
|
||||||
extern void _rl_save_prompt ();
|
|
||||||
extern void _rl_restore_prompt ();
|
|
||||||
|
|
||||||
extern int rl_execute_next ();
|
extern int rl_execute_next ();
|
||||||
extern void rl_extend_line_buffer ();
|
extern void rl_extend_line_buffer ();
|
||||||
|
|
||||||
|
@ -178,12 +178,20 @@ rl_search_history (direction, invoking_key)
|
||||||
/* Non-zero if we are doing a reverse search. */
|
/* Non-zero if we are doing a reverse search. */
|
||||||
int reverse;
|
int reverse;
|
||||||
|
|
||||||
|
/* The list of characters which terminate the search, but are not
|
||||||
|
subsequently executed. If the variable isearch-terminators has
|
||||||
|
been set, we use that value, otherwise we use ESC and C-J. */
|
||||||
|
unsigned char *isearch_terminators;
|
||||||
|
|
||||||
orig_point = rl_point;
|
orig_point = rl_point;
|
||||||
last_found_line = orig_line = where_history ();
|
last_found_line = orig_line = where_history ();
|
||||||
reverse = direction < 0;
|
reverse = direction < 0;
|
||||||
hlist = history_list ();
|
hlist = history_list ();
|
||||||
allocated_line = (char *)NULL;
|
allocated_line = (char *)NULL;
|
||||||
|
|
||||||
|
isearch_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
|
||||||
|
: (unsigned char *)"\033\012";
|
||||||
|
|
||||||
/* Create an arrary of pointers to the lines that we want to search. */
|
/* Create an arrary of pointers to the lines that we want to search. */
|
||||||
maybe_replace_line ();
|
maybe_replace_line ();
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -211,7 +219,7 @@ rl_search_history (direction, invoking_key)
|
||||||
/* The line where we start the search. */
|
/* The line where we start the search. */
|
||||||
i = orig_line;
|
i = orig_line;
|
||||||
|
|
||||||
_rl_save_prompt ();
|
rl_save_prompt ();
|
||||||
|
|
||||||
/* Initialize search parameters. */
|
/* Initialize search parameters. */
|
||||||
search_string = xmalloc (search_string_size = 128);
|
search_string = xmalloc (search_string_size = 128);
|
||||||
|
@ -246,10 +254,18 @@ rl_search_history (direction, invoking_key)
|
||||||
c = !reverse ? -1 : -2;
|
c = !reverse ? -1 : -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Let NEWLINE (^J) terminate the search for people who don't like
|
/* Let NEWLINE (^J) terminate the search for people who don't like
|
||||||
using ESC. ^M can still be used to terminate the search and
|
using ESC. ^M can still be used to terminate the search and
|
||||||
immediately execute the command. */
|
immediately execute the command. */
|
||||||
if (c == ESC || c == NEWLINE)
|
if (c == ESC || c == NEWLINE)
|
||||||
|
#else
|
||||||
|
/* The characters in isearch_terminators (set from the user-settable
|
||||||
|
variable isearch-terminators) are used to terminate the search but
|
||||||
|
not subsequently execute the character as a command. The default
|
||||||
|
value is "\033\012" (ESC and C-J). */
|
||||||
|
if (strchr (isearch_terminators, c))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* ESC still terminates the search, but if there is pending
|
/* ESC still terminates the search, but if there is pending
|
||||||
input or if input arrives within 0.1 seconds (on systems
|
input or if input arrives within 0.1 seconds (on systems
|
||||||
|
@ -291,7 +307,7 @@ rl_search_history (direction, invoking_key)
|
||||||
strcpy (rl_line_buffer, lines[orig_line]);
|
strcpy (rl_line_buffer, lines[orig_line]);
|
||||||
rl_point = orig_point;
|
rl_point = orig_point;
|
||||||
rl_end = strlen (rl_line_buffer);
|
rl_end = strlen (rl_line_buffer);
|
||||||
_rl_restore_prompt();
|
rl_restore_prompt();
|
||||||
rl_clear_message ();
|
rl_clear_message ();
|
||||||
if (allocated_line)
|
if (allocated_line)
|
||||||
free (allocated_line);
|
free (allocated_line);
|
||||||
|
@ -409,15 +425,15 @@ rl_search_history (direction, invoking_key)
|
||||||
/* First put back the original state. */
|
/* First put back the original state. */
|
||||||
strcpy (rl_line_buffer, lines[orig_line]);
|
strcpy (rl_line_buffer, lines[orig_line]);
|
||||||
|
|
||||||
_rl_restore_prompt ();
|
rl_restore_prompt ();
|
||||||
|
|
||||||
/* Free the search string. */
|
/* Free the search string. */
|
||||||
free (search_string);
|
free (search_string);
|
||||||
|
|
||||||
if (last_found_line < orig_line)
|
if (last_found_line < orig_line)
|
||||||
rl_get_previous_history (orig_line - last_found_line);
|
rl_get_previous_history (orig_line - last_found_line, 0);
|
||||||
else
|
else
|
||||||
rl_get_next_history (last_found_line - orig_line);
|
rl_get_next_history (last_found_line - orig_line, 0);
|
||||||
|
|
||||||
/* If the string was not found, put point at the end of the line. */
|
/* If the string was not found, put point at the end of the line. */
|
||||||
if (line_index < 0)
|
if (line_index < 0)
|
||||||
|
|
|
@ -124,7 +124,7 @@ rl_make_keymap ()
|
||||||
/* Free the storage associated with MAP. */
|
/* Free the storage associated with MAP. */
|
||||||
void
|
void
|
||||||
rl_discard_keymap (map)
|
rl_discard_keymap (map)
|
||||||
Keymap (map);
|
Keymap map;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,10 @@
|
||||||
#define _KEYMAPS_H_
|
#define _KEYMAPS_H_
|
||||||
|
|
||||||
#if defined (READLINE_LIBRARY)
|
#if defined (READLINE_LIBRARY)
|
||||||
|
# include "rlstdc.h"
|
||||||
# include "chardefs.h"
|
# include "chardefs.h"
|
||||||
#else
|
#else
|
||||||
|
# include <readline/rlstdc.h>
|
||||||
# include <readline/chardefs.h>
|
# include <readline/chardefs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -70,26 +72,29 @@ extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
|
||||||
|
|
||||||
/* Return a new, empty keymap.
|
/* Return a new, empty keymap.
|
||||||
Free it with free() when you are done. */
|
Free it with free() when you are done. */
|
||||||
extern Keymap rl_make_bare_keymap ();
|
extern Keymap rl_make_bare_keymap __P((void));
|
||||||
|
|
||||||
/* Return a new keymap which is a copy of MAP. */
|
/* Return a new keymap which is a copy of MAP. */
|
||||||
extern Keymap rl_copy_keymap ();
|
extern Keymap rl_copy_keymap __P((Keymap));
|
||||||
|
|
||||||
/* Return a new keymap with the printing characters bound to rl_insert,
|
/* Return a new keymap with the printing characters bound to rl_insert,
|
||||||
the lowercase Meta characters bound to run their equivalents, and
|
the lowercase Meta characters bound to run their equivalents, and
|
||||||
the Meta digits bound to produce numeric arguments. */
|
the Meta digits bound to produce numeric arguments. */
|
||||||
extern Keymap rl_make_keymap ();
|
extern Keymap rl_make_keymap __P((void));
|
||||||
|
|
||||||
extern void rl_discard_keymap ();
|
/* Free the storage associated with a keymap. */
|
||||||
|
extern void rl_discard_keymap __P((Keymap));
|
||||||
|
|
||||||
|
/* These functions actually appear in bind.c */
|
||||||
|
|
||||||
/* Return the keymap corresponding to a given name. Names look like
|
/* Return the keymap corresponding to a given name. Names look like
|
||||||
`emacs' or `emacs-meta' or `vi-insert'. */
|
`emacs' or `emacs-meta' or `vi-insert'. */
|
||||||
extern Keymap rl_get_keymap_by_name ();
|
extern Keymap rl_get_keymap_by_name __P((char *));
|
||||||
|
|
||||||
/* Return the current keymap. */
|
/* Return the current keymap. */
|
||||||
extern Keymap rl_get_keymap ();
|
extern Keymap rl_get_keymap __P((void));
|
||||||
|
|
||||||
/* Set the current keymap to MAP. */
|
/* Set the current keymap to MAP. */
|
||||||
extern void rl_set_keymap ();
|
extern void rl_set_keymap __P((Keymap));
|
||||||
|
|
||||||
#endif /* _KEYMAPS_H_ */
|
#endif /* _KEYMAPS_H_ */
|
||||||
|
|
|
@ -572,6 +572,8 @@ rl_yank_last_arg (count, key)
|
||||||
static int explicit_arg_p = 0;
|
static int explicit_arg_p = 0;
|
||||||
static int count_passed = 1;
|
static int count_passed = 1;
|
||||||
static int direction = 1;
|
static int direction = 1;
|
||||||
|
static int undo_needed = 0;
|
||||||
|
int retval;
|
||||||
|
|
||||||
if (rl_last_func != rl_yank_last_arg)
|
if (rl_last_func != rl_yank_last_arg)
|
||||||
{
|
{
|
||||||
|
@ -582,19 +584,22 @@ rl_yank_last_arg (count, key)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rl_do_undo ();
|
if (undo_needed)
|
||||||
|
rl_do_undo ();
|
||||||
if (count < 1)
|
if (count < 1)
|
||||||
direction = -direction;
|
direction = -direction;
|
||||||
history_skip += direction;
|
history_skip += direction;
|
||||||
if (history_skip < 0)
|
if (history_skip < 0)
|
||||||
history_skip = 0;
|
history_skip = 0;
|
||||||
count_passed = count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (explicit_arg_p)
|
if (explicit_arg_p)
|
||||||
return (rl_yank_nth_arg_internal (count, key, history_skip));
|
retval = rl_yank_nth_arg_internal (count_passed, key, history_skip);
|
||||||
else
|
else
|
||||||
return (rl_yank_nth_arg_internal ('$', key, history_skip));
|
retval = rl_yank_nth_arg_internal ('$', key, history_skip);
|
||||||
|
|
||||||
|
undo_needed = retval == 0;
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A special paste command for users of Cygnus's cygwin32. */
|
/* A special paste command for users of Cygnus's cygwin32. */
|
||||||
|
|
|
@ -9,10 +9,12 @@
|
||||||
|
|
||||||
#if defined (HAVE_POSIX_SIGSETJMP)
|
#if defined (HAVE_POSIX_SIGSETJMP)
|
||||||
# define procenv_t sigjmp_buf
|
# define procenv_t sigjmp_buf
|
||||||
# undef setjmp
|
# if !defined (__OPENNT)
|
||||||
# define setjmp(x) sigsetjmp((x), 1)
|
# undef setjmp
|
||||||
# undef longjmp
|
# define setjmp(x) sigsetjmp((x), 1)
|
||||||
# define longjmp(x, n) siglongjmp((x), (n))
|
# undef longjmp
|
||||||
|
# define longjmp(x, n) siglongjmp((x), (n))
|
||||||
|
# endif /* !__OPENNT */
|
||||||
#else
|
#else
|
||||||
# define procenv_t jmp_buf
|
# define procenv_t jmp_buf
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
||||||
#ifndef RL_LIBRARY_VERSION
|
#ifndef RL_LIBRARY_VERSION
|
||||||
# define RL_LIBRARY_VERSION "2.2-bash"
|
# define RL_LIBRARY_VERSION "4.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Evaluates its arguments multiple times. */
|
/* Evaluates its arguments multiple times. */
|
||||||
|
@ -83,7 +83,6 @@ extern void _rl_output_character_function ();
|
||||||
#else
|
#else
|
||||||
extern int _rl_output_character_function ();
|
extern int _rl_output_character_function ();
|
||||||
#endif
|
#endif
|
||||||
extern void _rl_get_screen_size ();
|
|
||||||
|
|
||||||
extern int _rl_enable_meta;
|
extern int _rl_enable_meta;
|
||||||
extern int _rl_term_autowrap;
|
extern int _rl_term_autowrap;
|
||||||
|
@ -100,7 +99,6 @@ extern int alphabetic ();
|
||||||
|
|
||||||
/* Functions imported from bind.c. */
|
/* Functions imported from bind.c. */
|
||||||
extern void _rl_bind_if_unbound ();
|
extern void _rl_bind_if_unbound ();
|
||||||
extern int rl_set_keymap_from_edit_mode ();
|
|
||||||
|
|
||||||
/* Functions imported from input.c. */
|
/* Functions imported from input.c. */
|
||||||
extern int _rl_any_typein ();
|
extern int _rl_any_typein ();
|
||||||
|
@ -118,9 +116,7 @@ extern void _rl_move_vert ();
|
||||||
extern void _rl_update_final ();
|
extern void _rl_update_final ();
|
||||||
extern void _rl_clear_to_eol ();
|
extern void _rl_clear_to_eol ();
|
||||||
extern void _rl_clear_screen ();
|
extern void _rl_clear_screen ();
|
||||||
|
extern void _rl_erase_entire_line ();
|
||||||
extern void _rl_save_prompt ();
|
|
||||||
extern void _rl_restore_prompt ();
|
|
||||||
|
|
||||||
extern void _rl_erase_at_end_of_line ();
|
extern void _rl_erase_at_end_of_line ();
|
||||||
extern void _rl_move_cursor_relative ();
|
extern void _rl_move_cursor_relative ();
|
||||||
|
@ -253,9 +249,14 @@ int rl_visible_prompt_length = 0;
|
||||||
int rl_key_sequence_length = 0;
|
int rl_key_sequence_length = 0;
|
||||||
|
|
||||||
/* If non-zero, then this is the address of a function to call just
|
/* If non-zero, then this is the address of a function to call just
|
||||||
before readline_internal () prints the first prompt. */
|
before readline_internal_setup () prints the first prompt. */
|
||||||
Function *rl_startup_hook = (Function *)NULL;
|
Function *rl_startup_hook = (Function *)NULL;
|
||||||
|
|
||||||
|
/* If non-zero, this is the address of a function to call just before
|
||||||
|
readline_internal_setup () returns and readline_internal starts
|
||||||
|
reading input characters. */
|
||||||
|
Function *rl_pre_input_hook = (Function *)NULL;
|
||||||
|
|
||||||
/* What we use internally. You should always refer to RL_LINE_BUFFER. */
|
/* What we use internally. You should always refer to RL_LINE_BUFFER. */
|
||||||
static char *the_line;
|
static char *the_line;
|
||||||
|
|
||||||
|
@ -286,6 +287,9 @@ char *_rl_comment_begin;
|
||||||
/* Keymap holding the function currently being executed. */
|
/* Keymap holding the function currently being executed. */
|
||||||
Keymap rl_executing_keymap;
|
Keymap rl_executing_keymap;
|
||||||
|
|
||||||
|
/* Non-zero means to erase entire line, including prompt, on empty input lines. */
|
||||||
|
int rl_erase_empty_line = 0;
|
||||||
|
|
||||||
/* Line buffer and maintenence. */
|
/* Line buffer and maintenence. */
|
||||||
char *rl_line_buffer = (char *)NULL;
|
char *rl_line_buffer = (char *)NULL;
|
||||||
int rl_line_buffer_len = 0;
|
int rl_line_buffer_len = 0;
|
||||||
|
@ -388,6 +392,9 @@ readline_internal_setup ()
|
||||||
rl_vi_insertion_mode (1, 0);
|
rl_vi_insertion_mode (1, 0);
|
||||||
#endif /* VI_MODE */
|
#endif /* VI_MODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rl_pre_input_hook)
|
||||||
|
(*rl_pre_input_hook) ();
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_CALLBACK char *
|
STATIC_CALLBACK char *
|
||||||
|
@ -405,7 +412,7 @@ readline_internal_teardown (eof)
|
||||||
{
|
{
|
||||||
temp = savestring (the_line);
|
temp = savestring (the_line);
|
||||||
rl_revert_line (1, 0);
|
rl_revert_line (1, 0);
|
||||||
entry = replace_history_entry (where_history (), the_line, (HIST_ENTRY *)NULL);
|
entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL);
|
||||||
_rl_free_history_entry (entry);
|
_rl_free_history_entry (entry);
|
||||||
|
|
||||||
strcpy (the_line, temp);
|
strcpy (the_line, temp);
|
||||||
|
@ -488,6 +495,12 @@ readline_internal_charloop ()
|
||||||
if (rl_done == 0)
|
if (rl_done == 0)
|
||||||
(*rl_redisplay_function) ();
|
(*rl_redisplay_function) ();
|
||||||
|
|
||||||
|
/* If the application writer has told us to erase the entire line if
|
||||||
|
the only character typed was something bound to rl_newline, do so. */
|
||||||
|
if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline &&
|
||||||
|
rl_point == 0 && rl_end == 0)
|
||||||
|
_rl_erase_entire_line ();
|
||||||
|
|
||||||
#if defined (READLINE_CALLBACKS)
|
#if defined (READLINE_CALLBACKS)
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -501,7 +514,7 @@ readline_internal_charloop ()
|
||||||
static int
|
static int
|
||||||
readline_internal_charloop ()
|
readline_internal_charloop ()
|
||||||
{
|
{
|
||||||
int eof;
|
int eof = 1;
|
||||||
|
|
||||||
while (rl_done == 0)
|
while (rl_done == 0)
|
||||||
eof = readline_internal_char ();
|
eof = readline_internal_char ();
|
||||||
|
@ -837,11 +850,19 @@ rl_digit_loop ()
|
||||||
{
|
{
|
||||||
int key, c, sawminus, sawdigits;
|
int key, c, sawminus, sawdigits;
|
||||||
|
|
||||||
_rl_save_prompt ();
|
rl_save_prompt ();
|
||||||
|
|
||||||
sawminus = sawdigits = 0;
|
sawminus = sawdigits = 0;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
if (rl_numeric_arg > 1000000)
|
||||||
|
{
|
||||||
|
sawdigits = rl_explicit_arg = rl_numeric_arg = 0;
|
||||||
|
ding ();
|
||||||
|
rl_restore_prompt ();
|
||||||
|
rl_clear_message ();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
|
rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
|
||||||
key = c = rl_read_key ();
|
key = c = rl_read_key ();
|
||||||
|
|
||||||
|
@ -858,7 +879,7 @@ rl_digit_loop ()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
key = rl_read_key ();
|
key = rl_read_key ();
|
||||||
_rl_restore_prompt ();
|
rl_restore_prompt ();
|
||||||
rl_clear_message ();
|
rl_clear_message ();
|
||||||
return (_rl_dispatch (key, _rl_keymap));
|
return (_rl_dispatch (key, _rl_keymap));
|
||||||
}
|
}
|
||||||
|
@ -881,7 +902,7 @@ rl_digit_loop ()
|
||||||
/* Make M-- command equivalent to M--1 command. */
|
/* Make M-- command equivalent to M--1 command. */
|
||||||
if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0)
|
if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0)
|
||||||
rl_explicit_arg = 1;
|
rl_explicit_arg = 1;
|
||||||
_rl_restore_prompt ();
|
rl_restore_prompt ();
|
||||||
rl_clear_message ();
|
rl_clear_message ();
|
||||||
return (_rl_dispatch (key, _rl_keymap));
|
return (_rl_dispatch (key, _rl_keymap));
|
||||||
}
|
}
|
||||||
|
@ -1231,7 +1252,8 @@ rl_backward_word (count, key)
|
||||||
|
|
||||||
/* Clear the current line. Numeric argument to C-l does this. */
|
/* Clear the current line. Numeric argument to C-l does this. */
|
||||||
int
|
int
|
||||||
rl_refresh_line ()
|
rl_refresh_line (ignore1, ignore2)
|
||||||
|
int ignore1, ignore2;
|
||||||
{
|
{
|
||||||
int curr_line, nleft;
|
int curr_line, nleft;
|
||||||
|
|
||||||
|
@ -1278,7 +1300,7 @@ rl_clear_screen (count, key)
|
||||||
{
|
{
|
||||||
if (rl_explicit_arg)
|
if (rl_explicit_arg)
|
||||||
{
|
{
|
||||||
rl_refresh_line ();
|
rl_refresh_line (count, key);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1428,6 +1450,11 @@ rl_newline (count, key)
|
||||||
}
|
}
|
||||||
#endif /* VI_MODE */
|
#endif /* VI_MODE */
|
||||||
|
|
||||||
|
/* If we've been asked to erase empty lines, suppress the final update,
|
||||||
|
since _rl_update_final calls crlf(). */
|
||||||
|
if (rl_erase_empty_line && rl_point == 0 && rl_end == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (readline_echoing_p)
|
if (readline_echoing_p)
|
||||||
_rl_update_final ();
|
_rl_update_final ();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1507,9 +1534,22 @@ rl_delete (count, key)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (rl_delete_text (rl_point, rl_point + 1));
|
return (rl_delete_text (rl_point, rl_point + 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Delete the character under the cursor, unless the insertion
|
||||||
|
point is at the end of the line, in which case the character
|
||||||
|
behind the cursor is deleted. COUNT is obeyed and may be used
|
||||||
|
to delete forward or backward that many characters. */
|
||||||
|
int
|
||||||
|
rl_rubout_or_delete (count, key)
|
||||||
|
int count, key;
|
||||||
|
{
|
||||||
|
if (rl_end != 0 && rl_point == rl_end)
|
||||||
|
return (rl_rubout (count, key));
|
||||||
|
else
|
||||||
|
return (rl_delete (count, key));
|
||||||
|
}
|
||||||
|
|
||||||
/* Delete all spaces and tabs around point. */
|
/* Delete all spaces and tabs around point. */
|
||||||
int
|
int
|
||||||
rl_delete_horizontal_space (count, ignore)
|
rl_delete_horizontal_space (count, ignore)
|
||||||
|
@ -1533,6 +1573,19 @@ rl_delete_horizontal_space (count, ignore)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Like the tcsh editing function delete-char-or-list. The eof character
|
||||||
|
is caught before this is invoked, so this really does the same thing as
|
||||||
|
delete-char-or-list-or-eof, as long as it's bound to the eof character. */
|
||||||
|
int
|
||||||
|
rl_delete_or_show_completions (count, key)
|
||||||
|
int count, key;
|
||||||
|
{
|
||||||
|
if (rl_end != 0 && rl_point == rl_end)
|
||||||
|
return (rl_possible_completions (count, key));
|
||||||
|
else
|
||||||
|
return (rl_delete (count, key));
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef RL_COMMENT_BEGIN_DEFAULT
|
#ifndef RL_COMMENT_BEGIN_DEFAULT
|
||||||
#define RL_COMMENT_BEGIN_DEFAULT "#"
|
#define RL_COMMENT_BEGIN_DEFAULT "#"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1859,7 +1912,7 @@ maybe_replace_line ()
|
||||||
/* If the current line has changed, save the changes. */
|
/* If the current line has changed, save the changes. */
|
||||||
if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list))
|
if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list))
|
||||||
{
|
{
|
||||||
temp = replace_history_entry (where_history (), the_line, rl_undo_list);
|
temp = replace_history_entry (where_history (), the_line, (histdata_t)rl_undo_list);
|
||||||
free (temp->line);
|
free (temp->line);
|
||||||
free (temp);
|
free (temp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,16 @@
|
||||||
#if !defined (_READLINE_H_)
|
#if !defined (_READLINE_H_)
|
||||||
#define _READLINE_H_
|
#define _READLINE_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (READLINE_LIBRARY)
|
#if defined (READLINE_LIBRARY)
|
||||||
|
# include "rlstdc.h"
|
||||||
# include "keymaps.h"
|
# include "keymaps.h"
|
||||||
# include "tilde.h"
|
# include "tilde.h"
|
||||||
#else
|
#else
|
||||||
|
# include <readline/rlstdc.h>
|
||||||
# include <readline/keymaps.h>
|
# include <readline/keymaps.h>
|
||||||
# include <readline/tilde.h>
|
# include <readline/tilde.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,78 +66,191 @@ typedef struct _funmap {
|
||||||
|
|
||||||
extern FUNMAP **funmap;
|
extern FUNMAP **funmap;
|
||||||
|
|
||||||
/* Functions available to bind to key sequences. */
|
/* **************************************************************** */
|
||||||
extern int
|
/* */
|
||||||
rl_tilde_expand (), rl_set_mark (), rl_exchange_point_and_mark (),
|
/* Functions available to bind to key sequences */
|
||||||
rl_beg_of_line (), rl_backward (), rl_delete (), rl_end_of_line (),
|
/* */
|
||||||
rl_forward (), ding (), rl_newline (), rl_kill_line (),
|
/* **************************************************************** */
|
||||||
rl_copy_region_to_kill (), rl_kill_region (), rl_char_search (),
|
|
||||||
rl_clear_screen (), rl_get_next_history (), rl_get_previous_history (),
|
|
||||||
rl_quoted_insert (), rl_reverse_search_history (), rl_transpose_chars (),
|
|
||||||
rl_unix_line_discard (), rl_unix_word_rubout (),
|
|
||||||
rl_yank (), rl_rubout (), rl_backward_word (), rl_kill_word (),
|
|
||||||
rl_forward_word (), rl_tab_insert (), rl_yank_pop (), rl_yank_nth_arg (),
|
|
||||||
rl_backward_kill_word (), rl_backward_kill_line (), rl_transpose_words (),
|
|
||||||
rl_complete (), rl_possible_completions (), rl_insert_completions (),
|
|
||||||
rl_menu_complete (),
|
|
||||||
rl_do_lowercase_version (), rl_kill_full_line (),
|
|
||||||
rl_digit_argument (), rl_universal_argument (), rl_abort (),
|
|
||||||
rl_undo_command (), rl_revert_line (), rl_beginning_of_history (),
|
|
||||||
rl_end_of_history (), rl_forward_search_history (), rl_insert (),
|
|
||||||
rl_upcase_word (), rl_downcase_word (), rl_capitalize_word (),
|
|
||||||
rl_restart_output (), rl_re_read_init_file (),
|
|
||||||
rl_dump_functions (), rl_dump_variables (), rl_dump_macros (),
|
|
||||||
rl_delete_horizontal_space (), rl_history_search_forward (),
|
|
||||||
rl_history_search_backward (), rl_tty_status (), rl_yank_last_arg (),
|
|
||||||
rl_insert_comment (), rl_backward_char_search (),
|
|
||||||
rl_copy_forward_word (), rl_copy_backward_word ();
|
|
||||||
|
|
||||||
/* Not available unless readline is compiled -DPAREN_MATCHING. */
|
/* Bindable commands for numeric arguments. */
|
||||||
extern int rl_insert_close ();
|
extern int rl_digit_argument __P((int, int));
|
||||||
|
extern int rl_universal_argument __P((int, int));
|
||||||
|
|
||||||
/* Not available unless READLINE_CALLBACKS is defined. */
|
/* Bindable commands for moving the cursor. */
|
||||||
extern void rl_callback_handler_install ();
|
extern int rl_forward __P((int, int));
|
||||||
extern void rl_callback_read_char ();
|
extern int rl_backward __P((int, int));
|
||||||
extern void rl_callback_handler_remove ();
|
extern int rl_beg_of_line __P((int, int));
|
||||||
|
extern int rl_end_of_line __P((int, int));
|
||||||
|
extern int rl_forward_word __P((int, int));
|
||||||
|
extern int rl_backward_word __P((int, int));
|
||||||
|
extern int rl_refresh_line __P((int, int));
|
||||||
|
extern int rl_clear_screen __P((int, int));
|
||||||
|
extern int rl_arrow_keys __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for inserting and deleting text. */
|
||||||
|
extern int rl_insert __P((int, int));
|
||||||
|
extern int rl_quoted_insert __P((int, int));
|
||||||
|
extern int rl_tab_insert __P((int, int));
|
||||||
|
extern int rl_newline __P((int, int));
|
||||||
|
extern int rl_do_lowercase_version __P((int, int));
|
||||||
|
extern int rl_rubout __P((int, int));
|
||||||
|
extern int rl_delete __P((int, int));
|
||||||
|
extern int rl_rubout_or_delete __P((int, int));
|
||||||
|
extern int rl_delete_horizontal_space __P((int, int));
|
||||||
|
extern int rl_delete_or_show_completions __P((int, int));
|
||||||
|
extern int rl_insert_comment __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for changing case. */
|
||||||
|
extern int rl_upcase_word __P((int, int));
|
||||||
|
extern int rl_downcase_word __P((int, int));
|
||||||
|
extern int rl_capitalize_word __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for transposing characters and words. */
|
||||||
|
extern int rl_transpose_words __P((int, int));
|
||||||
|
extern int rl_transpose_chars __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for searching within a line. */
|
||||||
|
extern int rl_char_search __P((int, int));
|
||||||
|
extern int rl_backward_char_search __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for readline's interface to the command history. */
|
||||||
|
extern int rl_beginning_of_history __P((int, int));
|
||||||
|
extern int rl_end_of_history __P((int, int));
|
||||||
|
extern int rl_get_next_history __P((int, int));
|
||||||
|
extern int rl_get_previous_history __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for managing the mark and region. */
|
||||||
|
extern int rl_set_mark __P((int, int));
|
||||||
|
extern int rl_exchange_point_and_mark __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands to set the editing mode (emacs or vi). */
|
||||||
|
extern int rl_vi_editing_mode __P((int, int));
|
||||||
|
extern int rl_emacs_editing_mode __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for managing key bindings. */
|
||||||
|
extern int rl_re_read_init_file __P((int, int));
|
||||||
|
extern int rl_dump_functions __P((int, int));
|
||||||
|
extern int rl_dump_macros __P((int, int));
|
||||||
|
extern int rl_dump_variables __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for word completion. */
|
||||||
|
extern int rl_complete __P((int, int));
|
||||||
|
extern int rl_possible_completions __P((int, int));
|
||||||
|
extern int rl_insert_completions __P((int, int));
|
||||||
|
extern int rl_menu_complete __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for killing and yanking text, and managing the kill ring. */
|
||||||
|
extern int rl_kill_word __P((int, int));
|
||||||
|
extern int rl_backward_kill_word __P((int, int));
|
||||||
|
extern int rl_kill_line __P((int, int));
|
||||||
|
extern int rl_backward_kill_line __P((int, int));
|
||||||
|
extern int rl_kill_full_line __P((int, int));
|
||||||
|
extern int rl_unix_word_rubout __P((int, int));
|
||||||
|
extern int rl_unix_line_discard __P((int, int));
|
||||||
|
extern int rl_copy_region_to_kill __P((int, int));
|
||||||
|
extern int rl_kill_region __P((int, int));
|
||||||
|
extern int rl_copy_forward_word __P((int, int));
|
||||||
|
extern int rl_copy_backward_word __P((int, int));
|
||||||
|
extern int rl_yank __P((int, int));
|
||||||
|
extern int rl_yank_pop __P((int, int));
|
||||||
|
extern int rl_yank_nth_arg __P((int, int));
|
||||||
|
extern int rl_yank_last_arg __P((int, int));
|
||||||
/* Not available unless __CYGWIN32__ is defined. */
|
/* Not available unless __CYGWIN32__ is defined. */
|
||||||
#ifdef __CYGWIN32__
|
#ifdef __CYGWIN32__
|
||||||
extern int rl_paste_from_clipboard ();
|
extern int rl_paste_from_clipboard __P((int, int));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These are *both* defined even when VI_MODE is not. */
|
/* Bindable commands for incremental searching. */
|
||||||
extern int rl_vi_editing_mode (), rl_emacs_editing_mode ();
|
extern int rl_reverse_search_history __P((int, int));
|
||||||
|
extern int rl_forward_search_history __P((int, int));
|
||||||
|
|
||||||
/* Non incremental history searching. */
|
/* Bindable keyboard macro commands. */
|
||||||
extern int rl_noninc_forward_search ();
|
extern int rl_start_kbd_macro __P((int, int));
|
||||||
extern int rl_noninc_reverse_search ();
|
extern int rl_end_kbd_macro __P((int, int));
|
||||||
extern int rl_noninc_forward_search_again ();
|
extern int rl_call_last_kbd_macro __P((int, int));
|
||||||
extern int rl_noninc_reverse_search_again ();
|
|
||||||
|
/* Bindable undo commands. */
|
||||||
|
extern int rl_revert_line __P((int, int));
|
||||||
|
extern int rl_undo_command __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable tilde expansion commands. */
|
||||||
|
extern int rl_tilde_expand __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable terminal control commands. */
|
||||||
|
extern int rl_restart_output __P((int, int));
|
||||||
|
extern int rl_stop_output __P((int, int));
|
||||||
|
|
||||||
|
/* Miscellaneous bindable commands. */
|
||||||
|
extern int rl_abort __P((int, int));
|
||||||
|
extern int rl_tty_status __P((int, int));
|
||||||
|
|
||||||
|
/* Bindable commands for incremental and non-incremental history searching. */
|
||||||
|
extern int rl_history_search_forward __P((int, int));
|
||||||
|
extern int rl_history_search_backward __P((int, int));
|
||||||
|
extern int rl_noninc_forward_search __P((int, int));
|
||||||
|
extern int rl_noninc_reverse_search __P((int, int));
|
||||||
|
extern int rl_noninc_forward_search_again __P((int, int));
|
||||||
|
extern int rl_noninc_reverse_search_again __P((int, int));
|
||||||
|
|
||||||
|
/* Not available unless readline is compiled -DPAREN_MATCHING. */
|
||||||
|
extern int rl_insert_close __P((int, int));
|
||||||
|
|
||||||
|
/* Not available unless READLINE_CALLBACKS is defined. */
|
||||||
|
extern void rl_callback_handler_install __P((char *, VFunction *));
|
||||||
|
extern void rl_callback_read_char __P((void));
|
||||||
|
extern void rl_callback_handler_remove __P((void));
|
||||||
|
|
||||||
/* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */
|
/* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */
|
||||||
extern int rl_vi_check ();
|
/* VI-mode bindable commands. */
|
||||||
extern int
|
extern int rl_vi_redo __P((int, int));
|
||||||
rl_vi_undo (), rl_vi_redo (), rl_vi_tilde_expand (),
|
extern int rl_vi_undo __P((int, int));
|
||||||
rl_vi_movement_mode (), rl_vi_insertion_mode (), rl_vi_arg_digit (),
|
extern int rl_vi_yank_arg __P((int, int));
|
||||||
rl_vi_prev_word (), rl_vi_next_word (), rl_vi_char_search (),
|
extern int rl_vi_fetch_history __P((int, int));
|
||||||
rl_vi_eof_maybe (), rl_vi_append_mode (), rl_vi_put (),
|
extern int rl_vi_search_again __P((int, int));
|
||||||
rl_vi_append_eol (), rl_vi_insert_beg (), rl_vi_delete (),
|
extern int rl_vi_search __P((int, int));
|
||||||
rl_vi_first_print (), rl_vi_fword (), rl_vi_fWord (), rl_vi_bword (),
|
extern int rl_vi_complete __P((int, int));
|
||||||
rl_vi_bWord (), rl_vi_eword (), rl_vi_eWord (), rl_vi_end_word (),
|
extern int rl_vi_tilde_expand __P((int, int));
|
||||||
rl_vi_change_case (), rl_vi_match (), rl_vi_bracktype (),
|
extern int rl_vi_prev_word __P((int, int));
|
||||||
rl_vi_change_char (), rl_vi_yank_arg (), rl_vi_search (),
|
extern int rl_vi_next_word __P((int, int));
|
||||||
rl_vi_search_again (), rl_vi_subst (), rl_vi_overstrike (),
|
extern int rl_vi_end_word __P((int, int));
|
||||||
rl_vi_overstrike_delete (), rl_vi_replace(), rl_vi_column (),
|
extern int rl_vi_insert_beg __P((int, int));
|
||||||
rl_vi_delete_to (), rl_vi_change_to (), rl_vi_yank_to (),
|
extern int rl_vi_append_mode __P((int, int));
|
||||||
rl_vi_complete (), rl_vi_fetch_history (), rl_vi_set_mark (),
|
extern int rl_vi_append_eol __P((int, int));
|
||||||
rl_vi_goto_mark (), rl_vi_back_to_indent ();
|
extern int rl_vi_eof_maybe __P((int, int));
|
||||||
|
extern int rl_vi_insertion_mode __P((int, int));
|
||||||
|
extern int rl_vi_movement_mode __P((int, int));
|
||||||
|
extern int rl_vi_arg_digit __P((int, int));
|
||||||
|
extern int rl_vi_change_case __P((int, int));
|
||||||
|
extern int rl_vi_put __P((int, int));
|
||||||
|
extern int rl_vi_column __P((int, int));
|
||||||
|
extern int rl_vi_delete_to __P((int, int));
|
||||||
|
extern int rl_vi_change_to __P((int, int));
|
||||||
|
extern int rl_vi_yank_to __P((int, int));
|
||||||
|
extern int rl_vi_delete __P((int, int));
|
||||||
|
extern int rl_vi_back_to_indent __P((int, int));
|
||||||
|
extern int rl_vi_first_print __P((int, int));
|
||||||
|
extern int rl_vi_char_search __P((int, int));
|
||||||
|
extern int rl_vi_match __P((int, int));
|
||||||
|
extern int rl_vi_change_char __P((int, int));
|
||||||
|
extern int rl_vi_subst __P((int, int));
|
||||||
|
extern int rl_vi_overstrike __P((int, int));
|
||||||
|
extern int rl_vi_overstrike_delete __P((int, int));
|
||||||
|
extern int rl_vi_replace __P((int, int));
|
||||||
|
extern int rl_vi_set_mark __P((int, int));
|
||||||
|
extern int rl_vi_goto_mark __P((int, int));
|
||||||
|
|
||||||
/* Keyboard macro commands. */
|
/* VI-mode utility functions. */
|
||||||
extern int rl_start_kbd_macro (), rl_end_kbd_macro ();
|
extern int rl_vi_check __P((void));
|
||||||
extern int rl_call_last_kbd_macro ();
|
extern int rl_vi_domove __P((int, int *));
|
||||||
extern void rl_push_macro_input ();
|
extern int rl_vi_bracktype __P((int));
|
||||||
|
|
||||||
extern int rl_arrow_keys(), rl_refresh_line ();
|
/* VI-mode pseudo-bindable commands, used as utility functions. */
|
||||||
|
extern int rl_vi_fWord __P((int, int));
|
||||||
|
extern int rl_vi_bWord __P((int, int));
|
||||||
|
extern int rl_vi_eWord __P((int, int));
|
||||||
|
extern int rl_vi_fword __P((int, int));
|
||||||
|
extern int rl_vi_bword __P((int, int));
|
||||||
|
extern int rl_vi_eword __P((int, int));
|
||||||
|
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
|
@ -141,57 +260,80 @@ extern int rl_arrow_keys(), rl_refresh_line ();
|
||||||
|
|
||||||
/* Readline functions. */
|
/* Readline functions. */
|
||||||
/* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */
|
/* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */
|
||||||
extern char *readline ();
|
extern char *readline __P((char *));
|
||||||
|
|
||||||
/* These functions are from bind.c. */
|
extern int rl_initialize __P((void));
|
||||||
/* 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. */
|
|
||||||
extern int rl_add_defun ();
|
|
||||||
|
|
||||||
extern Keymap rl_make_bare_keymap ();
|
extern int rl_discard_argument __P((void));
|
||||||
extern Keymap rl_copy_keymap ();
|
|
||||||
extern Keymap rl_make_keymap ();
|
/* Utility functions to bind keys to readline commands. */
|
||||||
extern void rl_discard_keymap ();
|
extern int rl_add_defun __P((char *, Function *, int));
|
||||||
extern Keymap rl_get_keymap (), rl_get_keymap_by_name ();
|
extern int rl_bind_key __P((int, Function *));
|
||||||
extern void rl_set_keymap ();
|
extern int rl_bind_key_in_map __P((int, Function *, Keymap));
|
||||||
extern char *rl_get_keymap_name ();
|
extern int rl_unbind_key __P((int));
|
||||||
|
extern int rl_unbind_key_in_map __P((int, Keymap));
|
||||||
|
extern int rl_unbind_function_in_map __P((Function *, Keymap));
|
||||||
|
extern int rl_unbind_command_in_map __P((char *, Keymap));
|
||||||
|
extern int rl_set_key __P((char *, Function *, Keymap));
|
||||||
|
extern int rl_generic_bind __P((int, char *, char *, Keymap));
|
||||||
|
extern int rl_variable_bind __P((char *, char *));
|
||||||
|
|
||||||
extern int rl_bind_key (), rl_bind_key_in_map ();
|
|
||||||
extern int rl_unbind_key (), rl_unbind_key_in_map ();
|
|
||||||
extern int rl_unbind_function_in_map (), rl_unbind_command_in_map ();
|
|
||||||
extern int rl_set_key ();
|
|
||||||
extern int rl_generic_bind ();
|
|
||||||
extern int rl_parse_and_bind ();
|
|
||||||
/* Backwards compatibility, use rl_generic_bind instead. */
|
/* Backwards compatibility, use rl_generic_bind instead. */
|
||||||
extern int rl_macro_bind (), rl_variable_bind ();
|
extern int rl_macro_bind __P((char *, char *, Keymap));
|
||||||
|
|
||||||
extern int rl_read_init_file ();
|
|
||||||
|
|
||||||
extern Function *rl_named_function (), *rl_function_of_keyseq ();
|
|
||||||
extern char **rl_invoking_keyseqs (), **rl_invoking_keyseqs_in_map ();
|
|
||||||
extern void rl_function_dumper ();
|
|
||||||
extern void rl_variable_dumper ();
|
|
||||||
extern void rl_macro_dumper ();
|
|
||||||
extern void rl_list_funmap_names ();
|
|
||||||
|
|
||||||
/* Undocumented in the texinfo manual; not really useful to programs. */
|
/* Undocumented in the texinfo manual; not really useful to programs. */
|
||||||
extern int rl_translate_keyseq ();
|
extern int rl_translate_keyseq __P((char *, char *, int *));
|
||||||
extern void rl_initialize_funmap ();
|
extern char *rl_untranslate_keyseq __P((int));
|
||||||
|
|
||||||
/* Functions for undoing. */
|
extern Function *rl_named_function __P((char *));
|
||||||
extern int rl_begin_undo_group (), rl_end_undo_group ();
|
extern Function *rl_function_of_keyseq __P((char *, Keymap, int *));
|
||||||
extern void rl_add_undo (), free_undo_list ();
|
|
||||||
extern int rl_do_undo ();
|
extern void rl_list_funmap_names __P((void));
|
||||||
extern int rl_modifying ();
|
extern char **rl_invoking_keyseqs_in_map __P((Function *, Keymap));
|
||||||
|
extern char **rl_invoking_keyseqs __P((Function *));
|
||||||
|
|
||||||
|
extern void rl_function_dumper __P((int));
|
||||||
|
extern void rl_macro_dumper __P((int));
|
||||||
|
extern void rl_variable_dumper __P((int));
|
||||||
|
|
||||||
|
extern int rl_read_init_file __P((char *));
|
||||||
|
extern int rl_parse_and_bind __P((char *));
|
||||||
|
|
||||||
|
/* Functions for manipulating keymaps. */
|
||||||
|
extern Keymap rl_make_bare_keymap __P((void));
|
||||||
|
extern Keymap rl_copy_keymap __P((Keymap));
|
||||||
|
extern Keymap rl_make_keymap __P((void));
|
||||||
|
extern void rl_discard_keymap __P((Keymap));
|
||||||
|
|
||||||
|
extern Keymap rl_get_keymap_by_name __P((char *));
|
||||||
|
extern char *rl_get_keymap_name __P((Keymap));
|
||||||
|
extern void rl_set_keymap __P((Keymap));
|
||||||
|
extern Keymap rl_get_keymap __P((void));
|
||||||
|
extern void rl_set_keymap_from_edit_mode __P((void));
|
||||||
|
extern char *rl_get_keymap_name_from_edit_mode __P((void));
|
||||||
|
|
||||||
|
/* Functions for manipulating the funmap, which maps command names to functions. */
|
||||||
|
extern int rl_add_funmap_entry __P((char *, Function *));
|
||||||
|
extern void rl_initialize_funmap __P((void));
|
||||||
|
extern char **rl_funmap_names __P((void));
|
||||||
|
|
||||||
|
/* Utility functions for managing keyboard macros. */
|
||||||
|
extern void rl_push_macro_input __P((char *));
|
||||||
|
|
||||||
|
/* Functions for undoing, from undo.c */
|
||||||
|
extern void rl_add_undo __P((enum undo_code, int, int, char *));
|
||||||
|
extern void free_undo_list __P((void));
|
||||||
|
extern int rl_do_undo __P((void));
|
||||||
|
extern int rl_begin_undo_group __P((void));
|
||||||
|
extern int rl_end_undo_group __P((void));
|
||||||
|
extern int rl_modifying __P((int, int));
|
||||||
|
|
||||||
/* Functions for redisplay. */
|
/* Functions for redisplay. */
|
||||||
extern void rl_redisplay ();
|
extern void rl_redisplay __P((void));
|
||||||
extern int rl_forced_update_display ();
|
extern int rl_on_new_line __P((void));
|
||||||
extern int rl_clear_message ();
|
extern int rl_forced_update_display __P((void));
|
||||||
extern int rl_reset_line_state ();
|
extern int rl_clear_message __P((void));
|
||||||
extern int rl_on_new_line ();
|
extern int rl_reset_line_state __P((void));
|
||||||
|
|
||||||
#if defined (__STDC__) && defined (USE_VARARGS) && defined (PREFER_STDARG)
|
#if defined (__STDC__) && defined (USE_VARARGS) && defined (PREFER_STDARG)
|
||||||
extern int rl_message (const char *, ...);
|
extern int rl_message (const char *, ...);
|
||||||
|
@ -200,36 +342,59 @@ extern int rl_message ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Undocumented in texinfo manual. */
|
/* Undocumented in texinfo manual. */
|
||||||
extern int rl_character_len ();
|
extern int rl_show_char __P((int));
|
||||||
extern int rl_show_char ();
|
extern int rl_character_len __P((int, int));
|
||||||
extern int crlf ();
|
extern int crlf __P((void));
|
||||||
|
|
||||||
|
/* Save and restore internal prompt redisplay information. */
|
||||||
|
extern void rl_save_prompt __P((void));
|
||||||
|
extern void rl_restore_prompt __P((void));
|
||||||
|
|
||||||
/* Modifying text. */
|
/* Modifying text. */
|
||||||
extern int rl_insert_text (), rl_delete_text ();
|
extern int rl_insert_text __P((char *));
|
||||||
extern int rl_kill_text ();
|
extern int rl_delete_text __P((int, int));
|
||||||
extern char *rl_copy_text ();
|
extern int rl_kill_text __P((int, int));
|
||||||
|
extern char *rl_copy_text __P((int, int));
|
||||||
|
|
||||||
/* `Public' utility functions. */
|
/* Terminal and tty mode management. */
|
||||||
extern int rl_reset_terminal ();
|
extern void rl_prep_terminal __P((int));
|
||||||
extern int rl_stuff_char ();
|
extern void rl_deprep_terminal __P((void));
|
||||||
extern int rl_read_key (), rl_getc ();
|
extern void rltty_set_default_bindings __P((Keymap));
|
||||||
|
|
||||||
extern int rl_initialize ();
|
extern int rl_reset_terminal __P((char *));
|
||||||
|
extern void rl_resize_terminal __P((void));
|
||||||
|
|
||||||
|
/* `Public' utility functions . */
|
||||||
|
extern void rl_extend_line_buffer __P((int));
|
||||||
|
extern int ding __P((void));
|
||||||
|
|
||||||
|
/* Functions for character input. */
|
||||||
|
extern int rl_stuff_char __P((int));
|
||||||
|
extern int rl_execute_next __P((int));
|
||||||
|
extern int rl_read_key __P((void));
|
||||||
|
extern int rl_getc __P((FILE *));
|
||||||
|
|
||||||
|
/* Readline signal handling, from signals.c */
|
||||||
|
extern int rl_set_signals __P((void));
|
||||||
|
extern int rl_clear_signals __P((void));
|
||||||
|
extern void rl_cleanup_after_signal __P((void));
|
||||||
|
extern void rl_reset_after_signal __P((void));
|
||||||
|
extern void rl_free_line_state __P((void));
|
||||||
|
|
||||||
/* Undocumented. */
|
/* Undocumented. */
|
||||||
extern int rl_expand_prompt ();
|
extern int rl_expand_prompt __P((char *));
|
||||||
extern int rl_set_signals (), rl_clear_signals ();
|
|
||||||
extern int maybe_save_line (), maybe_unsave_line (), maybe_replace_line ();
|
extern int maybe_save_line __P((void));
|
||||||
|
extern int maybe_unsave_line __P((void));
|
||||||
|
extern int maybe_replace_line __P((void));
|
||||||
|
|
||||||
/* Completion functions. */
|
/* Completion functions. */
|
||||||
/* These functions are from complete.c. */
|
extern int rl_complete_internal __P((int));
|
||||||
extern int rl_complete_internal ();
|
extern void rl_display_match_list __P((char **, int, int));
|
||||||
|
|
||||||
/* Return an array of strings which are the result of repeatadly calling
|
extern char **completion_matches __P((char *, CPFunction *));
|
||||||
FUNC with TEXT. */
|
extern char *username_completion_function __P((char *, int));
|
||||||
extern char **completion_matches ();
|
extern char *filename_completion_function __P((char *, int));
|
||||||
extern char *username_completion_function ();
|
|
||||||
extern char *filename_completion_function ();
|
|
||||||
|
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
|
@ -254,10 +419,14 @@ extern char *rl_line_buffer;
|
||||||
/* The location of point, and end. */
|
/* The location of point, and end. */
|
||||||
extern int rl_point, rl_end;
|
extern int rl_point, rl_end;
|
||||||
|
|
||||||
|
/* The mark, or saved cursor position. */
|
||||||
extern int rl_mark;
|
extern int rl_mark;
|
||||||
|
|
||||||
|
/* Flag to indicate that readline has finished with the current input
|
||||||
|
line and should return it. */
|
||||||
extern int rl_done;
|
extern int rl_done;
|
||||||
|
|
||||||
|
/* If set to a character value, that will be the next keystroke read. */
|
||||||
extern int rl_pending_input;
|
extern int rl_pending_input;
|
||||||
|
|
||||||
/* Non-zero if we called this function from _rl_dispatch(). It's present
|
/* Non-zero if we called this function from _rl_dispatch(). It's present
|
||||||
|
@ -275,6 +444,11 @@ extern FILE *rl_instream, *rl_outstream;
|
||||||
before readline_internal () prints the first prompt. */
|
before readline_internal () prints the first prompt. */
|
||||||
extern Function *rl_startup_hook;
|
extern Function *rl_startup_hook;
|
||||||
|
|
||||||
|
/* If non-zero, this is the address of a function to call just before
|
||||||
|
readline_internal_setup () returns and readline_internal starts
|
||||||
|
reading input characters. */
|
||||||
|
extern Function *rl_pre_input_hook;
|
||||||
|
|
||||||
/* The address of a function to call periodically while Readline is
|
/* The address of a function to call periodically while Readline is
|
||||||
awaiting character input, or NULL, for no event handling. */
|
awaiting character input, or NULL, for no event handling. */
|
||||||
extern Function *rl_event_hook;
|
extern Function *rl_event_hook;
|
||||||
|
@ -288,6 +462,24 @@ extern VFunction *rl_deprep_term_function;
|
||||||
extern Keymap rl_executing_keymap;
|
extern Keymap rl_executing_keymap;
|
||||||
extern Keymap rl_binding_keymap;
|
extern Keymap rl_binding_keymap;
|
||||||
|
|
||||||
|
/* Display variables. */
|
||||||
|
/* If non-zero, readline will erase the entire line, including any prompt,
|
||||||
|
if the only thing typed on an otherwise-blank line is something bound to
|
||||||
|
rl_newline. */
|
||||||
|
extern int rl_erase_empty_line;
|
||||||
|
|
||||||
|
/* Variables to control readline signal handling. */
|
||||||
|
/* If non-zero, readline will install its own signal handlers for
|
||||||
|
SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
|
||||||
|
extern int rl_catch_signals;
|
||||||
|
|
||||||
|
/* If non-zero, readline will install a signal handler for SIGWINCH
|
||||||
|
that also attempts to call any calling application's SIGWINCH signal
|
||||||
|
handler. Note that the terminal is not cleaned up before the
|
||||||
|
application's signal handler is called; use rl_cleanup_after_signal()
|
||||||
|
to do that. */
|
||||||
|
extern int rl_catch_sigwinch;
|
||||||
|
|
||||||
/* Completion variables. */
|
/* Completion variables. */
|
||||||
/* Pointer to the generator function for completion_matches ().
|
/* Pointer to the generator function for completion_matches ().
|
||||||
NULL means to use filename_entry_function (), the default filename
|
NULL means to use filename_entry_function (), the default filename
|
||||||
|
@ -346,6 +538,15 @@ extern Function *rl_directory_completion_hook;
|
||||||
/* Backwards compatibility with previous versions of readline. */
|
/* Backwards compatibility with previous versions of readline. */
|
||||||
#define rl_symbolic_link_hook rl_directory_completion_hook
|
#define rl_symbolic_link_hook rl_directory_completion_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 instead of actually doing the display.
|
||||||
|
It takes three arguments: (char **matches, int num_matches, int max_length)
|
||||||
|
where MATCHES is the array of strings that matched, NUM_MATCHES is the
|
||||||
|
number of strings in that array, and MAX_LENGTH is the length of the
|
||||||
|
longest string in that array. */
|
||||||
|
extern VFunction *rl_completion_display_matches_hook;
|
||||||
|
|
||||||
/* Non-zero means that the results of the matches are to be treated
|
/* 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
|
as filenames. This is ALWAYS zero on entry, and can only be changed
|
||||||
within a completion entry finder function. */
|
within a completion entry finder function. */
|
||||||
|
@ -413,4 +614,8 @@ extern int rl_inhibit_completion;
|
||||||
extern char *savestring (); /* XXX backwards compatibility */
|
extern char *savestring (); /* XXX backwards compatibility */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _READLINE_H_ */
|
#endif /* _READLINE_H_ */
|
||||||
|
|
|
@ -56,8 +56,6 @@
|
||||||
|
|
||||||
/* Define this if you want code that allows readline to be used in an
|
/* Define this if you want code that allows readline to be used in an
|
||||||
X `callback' style. */
|
X `callback' style. */
|
||||||
#if !defined (SHELL)
|
#define READLINE_CALLBACKS
|
||||||
# define READLINE_CALLBACKS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _RLCONF_H_ */
|
#endif /* _RLCONF_H_ */
|
||||||
|
|
79
readline/rlstdc.h
Normal file
79
readline/rlstdc.h
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
/* stdc.h -- macros to make source compile on both ANSI C and K&R C
|
||||||
|
compilers. */
|
||||||
|
|
||||||
|
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of GNU Bash, the Bourne Again SHell.
|
||||||
|
|
||||||
|
Bash 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 (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
Bash 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 Bash; see the file COPYING. If not, write to the Free
|
||||||
|
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#if !defined (_RL_STDC_H_)
|
||||||
|
#define _RL_STDC_H_
|
||||||
|
|
||||||
|
/* Adapted from BSD /usr/include/sys/cdefs.h. */
|
||||||
|
|
||||||
|
/* A function can be defined using prototypes and compile on both ANSI C
|
||||||
|
and traditional C compilers with something like this:
|
||||||
|
extern char *func __P((char *, char *, int)); */
|
||||||
|
|
||||||
|
#if defined (__STDC__)
|
||||||
|
|
||||||
|
# if !defined (__P)
|
||||||
|
# define __P(protos) protos
|
||||||
|
# endif
|
||||||
|
# define __STRING(x) #x
|
||||||
|
|
||||||
|
# if !defined (__GNUC__)
|
||||||
|
# define inline
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else /* !__STDC__ */
|
||||||
|
|
||||||
|
# if !defined (__P)
|
||||||
|
# define __P(protos) ()
|
||||||
|
# endif
|
||||||
|
# define __STRING(x) "x"
|
||||||
|
|
||||||
|
#if defined (__GNUC__) /* gcc with -traditional */
|
||||||
|
# if !defined (const)
|
||||||
|
# define const __const
|
||||||
|
# endif
|
||||||
|
# if !defined (inline)
|
||||||
|
# define inline __inline
|
||||||
|
# endif
|
||||||
|
# if !defined (signed)
|
||||||
|
# define signed __signed
|
||||||
|
# endif
|
||||||
|
# if !defined (volatile)
|
||||||
|
# define volatile __volatile
|
||||||
|
# endif
|
||||||
|
#else /* !__GNUC__ */
|
||||||
|
# if !defined (const)
|
||||||
|
# define const
|
||||||
|
# endif
|
||||||
|
# if !defined (inline)
|
||||||
|
# define inline
|
||||||
|
# endif
|
||||||
|
# if !defined (signed)
|
||||||
|
# define signed
|
||||||
|
# endif
|
||||||
|
# if !defined (volatile)
|
||||||
|
# define volatile
|
||||||
|
# endif
|
||||||
|
#endif /* !__GNUC__ */
|
||||||
|
|
||||||
|
#endif /* !__STDC__ */
|
||||||
|
|
||||||
|
#endif /* !_RL_STDC_H_ */
|
|
@ -37,9 +37,9 @@
|
||||||
|
|
||||||
#include "rldefs.h"
|
#include "rldefs.h"
|
||||||
|
|
||||||
#if !defined (SHELL) && defined (GWINSZ_IN_SYS_IOCTL)
|
#if defined (GWINSZ_IN_SYS_IOCTL)
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
#endif /* !SHELL && GWINSZ_IN_SYS_IOCTL */
|
#endif /* GWINSZ_IN_SYS_IOCTL */
|
||||||
|
|
||||||
#include "rltty.h"
|
#include "rltty.h"
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
|
@ -144,7 +144,7 @@ static int terminal_prepped;
|
||||||
static int ksrflow;
|
static int ksrflow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined (SHELL) && defined (TIOCGWINSZ)
|
#if defined (TIOCGWINSZ)
|
||||||
/* Dummy call to force a backgrounded readline to stop before it tries
|
/* Dummy call to force a backgrounded readline to stop before it tries
|
||||||
to get the tty settings. */
|
to get the tty settings. */
|
||||||
static void
|
static void
|
||||||
|
@ -156,9 +156,7 @@ set_winsize (tty)
|
||||||
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
|
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
|
||||||
(void) ioctl (tty, TIOCSWINSZ, &w);
|
(void) ioctl (tty, TIOCSWINSZ, &w);
|
||||||
}
|
}
|
||||||
#else /* SHELL || !TIOCGWINSZ */
|
#endif /* TIOCGWINSZ */
|
||||||
# define set_winsize(tty)
|
|
||||||
#endif /* SHELL || !TIOCGWINSZ */
|
|
||||||
|
|
||||||
#if defined (NEW_TTY_DRIVER)
|
#if defined (NEW_TTY_DRIVER)
|
||||||
|
|
||||||
|
@ -389,6 +387,7 @@ get_tty_settings (tty, tiop)
|
||||||
TIOTYPE *tiop;
|
TIOTYPE *tiop;
|
||||||
{
|
{
|
||||||
int ioctl_ret;
|
int ioctl_ret;
|
||||||
|
|
||||||
set_winsize (tty);
|
set_winsize (tty);
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
|
33
readline/savestring.c
Normal file
33
readline/savestring.c
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/* savestring.c */
|
||||||
|
|
||||||
|
/* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of the GNU Readline Library, a library for
|
||||||
|
reading lines of text with interactive input and history editing.
|
||||||
|
|
||||||
|
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
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
The GNU Readline Library 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.
|
||||||
|
|
||||||
|
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. */
|
||||||
|
|
||||||
|
extern char *strcpy ();
|
||||||
|
extern char *xmalloc ();
|
||||||
|
|
||||||
|
/* Backwards compatibility, now that savestring has been removed from
|
||||||
|
all `public' readline header files. */
|
||||||
|
char *
|
||||||
|
savestring (s)
|
||||||
|
char *s;
|
||||||
|
{
|
||||||
|
return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s)));
|
||||||
|
}
|
|
@ -61,7 +61,6 @@ extern Function *rl_last_func;
|
||||||
/* Functions imported from the rest of the library. */
|
/* Functions imported from the rest of the library. */
|
||||||
extern int _rl_free_history_entry ();
|
extern int _rl_free_history_entry ();
|
||||||
extern char *_rl_make_prompt_for_search ();
|
extern char *_rl_make_prompt_for_search ();
|
||||||
extern void _rl_restore_prompt ();
|
|
||||||
extern void rl_extend_line_buffer ();
|
extern void rl_extend_line_buffer ();
|
||||||
|
|
||||||
static char *noninc_search_string = (char *) NULL;
|
static char *noninc_search_string = (char *) NULL;
|
||||||
|
@ -172,7 +171,7 @@ noninc_search (dir, pchar)
|
||||||
rl_message (p, 0, 0);
|
rl_message (p, 0, 0);
|
||||||
free (p);
|
free (p);
|
||||||
|
|
||||||
#define SEARCH_RETURN _rl_restore_prompt (); return
|
#define SEARCH_RETURN rl_restore_prompt (); return
|
||||||
|
|
||||||
/* Read the search string. */
|
/* Read the search string. */
|
||||||
while (c = rl_read_key ())
|
while (c = rl_read_key ())
|
||||||
|
@ -241,7 +240,7 @@ noninc_search (dir, pchar)
|
||||||
noninc_search_string = savestring (rl_line_buffer);
|
noninc_search_string = savestring (rl_line_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
_rl_restore_prompt ();
|
rl_restore_prompt ();
|
||||||
noninc_dosearch (noninc_search_string, dir);
|
noninc_dosearch (noninc_search_string, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,9 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if defined (HAVE_UNISTD_H)
|
#if defined (HAVE_UNISTD_H)
|
||||||
# ifdef _MINIX
|
|
||||||
# include <sys/types.h>
|
|
||||||
# endif
|
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif /* HAVE_UNISTD_H */
|
#endif /* HAVE_UNISTD_H */
|
||||||
|
|
||||||
|
@ -45,24 +44,16 @@
|
||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif /* !HAVE_STRING_H */
|
#endif /* !HAVE_STRING_H */
|
||||||
|
|
||||||
extern char *xmalloc (), *xrealloc ();
|
#include <pwd.h>
|
||||||
|
|
||||||
#if !defined (SHELL)
|
#if !defined (HAVE_GETPW_DECLS)
|
||||||
|
extern struct passwd *getpwuid ();
|
||||||
|
#endif /* !HAVE_GETPW_DECLS */
|
||||||
|
|
||||||
#ifdef savestring
|
extern char *xmalloc ();
|
||||||
#undef savestring
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Backwards compatibility, now that savestring has been removed from
|
/* All of these functions are resolved from bash if we are linking readline
|
||||||
all `public' readline header files. */
|
as part of bash. */
|
||||||
#if 0
|
|
||||||
char *
|
|
||||||
savestring (s)
|
|
||||||
char *s;
|
|
||||||
{
|
|
||||||
return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Does shell-like quoting using single quotes. */
|
/* Does shell-like quoting using single quotes. */
|
||||||
char *
|
char *
|
||||||
|
@ -128,13 +119,15 @@ get_env_value (varname)
|
||||||
return ((char *)getenv (varname));
|
return ((char *)getenv (varname));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* SHELL */
|
|
||||||
extern char *get_string_value ();
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
get_env_value (varname)
|
get_home_dir ()
|
||||||
char *varname;
|
|
||||||
{
|
{
|
||||||
return get_string_value (varname);
|
char *home_dir;
|
||||||
}
|
struct passwd *entry;
|
||||||
#endif /* SHELL */
|
|
||||||
|
home_dir = (char *)NULL;
|
||||||
|
entry = getpwuid (getuid ());
|
||||||
|
if (entry)
|
||||||
|
home_dir = entry->pw_dir;
|
||||||
|
return (home_dir);
|
||||||
|
}
|
||||||
|
|
316
readline/shlib/Makefile.in
Normal file
316
readline/shlib/Makefile.in
Normal file
|
@ -0,0 +1,316 @@
|
||||||
|
## -*- text -*- ##
|
||||||
|
# Makefile for the GNU readline library shared library support.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1998 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
RL_LIBRARY_VERSION = @LIBVERSION@
|
||||||
|
RL_LIBRARY_NAME = readline
|
||||||
|
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = .:@top_srcdir@
|
||||||
|
topdir = @top_srcdir@
|
||||||
|
BUILD_DIR = @BUILD_DIR@
|
||||||
|
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
|
||||||
|
CC = @CC@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
AR = @AR@
|
||||||
|
ARFLAGS = @ARFLAGS@
|
||||||
|
RM = rm -f
|
||||||
|
CP = cp
|
||||||
|
MV = mv
|
||||||
|
|
||||||
|
SHELL = @MAKE_SHELL@
|
||||||
|
|
||||||
|
host_os = @host_os@
|
||||||
|
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
libdir = @libdir@
|
||||||
|
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ @CFLAGS@
|
||||||
|
|
||||||
|
DEFS = @DEFS@
|
||||||
|
LOCAL_DEFS = @LOCAL_DEFS@
|
||||||
|
|
||||||
|
#
|
||||||
|
# These values are generated for configure by ${topdir}/support/shobj-conf.
|
||||||
|
# If your system is not supported by that script, but includes facilities for
|
||||||
|
# dynamic loading of shared objects, please update the script and send the
|
||||||
|
# changes to bash-maintainers@gnu.org.
|
||||||
|
#
|
||||||
|
SHOBJ_CC = @SHOBJ_CC@
|
||||||
|
SHOBJ_CFLAGS = @SHOBJ_CFLAGS@
|
||||||
|
SHOBJ_LD = @SHOBJ_LD@
|
||||||
|
|
||||||
|
SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@
|
||||||
|
SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@
|
||||||
|
SHOBJ_LIBS = @SHOBJ_LIBS@
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS = @SHLIB_XLDFLAGS@
|
||||||
|
SHLIB_LIBS = @SHLIB_LIBS@
|
||||||
|
SHLIB_LIBSUFF = @SHLIB_LIBSUFF@
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION = @SHLIB_LIBVERSION@
|
||||||
|
|
||||||
|
SHLIB_STATUS = @SHLIB_STATUS@
|
||||||
|
|
||||||
|
# shared library versioning
|
||||||
|
SHLIB_MAJOR= 4
|
||||||
|
# shared library systems like SVR4's do not use minor versions
|
||||||
|
SHLIB_MINOR= .0
|
||||||
|
|
||||||
|
# For libraries which include headers from other libraries.
|
||||||
|
INCLUDES = -I. -I.. -I$(topdir) -I$(includedir)
|
||||||
|
|
||||||
|
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
|
||||||
|
|
||||||
|
.SUFFIXES: .so
|
||||||
|
|
||||||
|
.c.so:
|
||||||
|
${RM} $@
|
||||||
|
$(SHOBJ_CC) -c $(CCFLAGS) $(SHOBJ_CFLAGS) -o $*.o $<
|
||||||
|
$(MV) $*.o $@
|
||||||
|
|
||||||
|
# The name of the main library target.
|
||||||
|
|
||||||
|
SHARED_READLINE = libreadline.$(SHLIB_LIBVERSION)
|
||||||
|
SHARED_HISTORY = libhistory.$(SHLIB_LIBVERSION)
|
||||||
|
SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)
|
||||||
|
|
||||||
|
# The C code source files for this library.
|
||||||
|
CSOURCES = $(topdir)/readline.c $(topdir)/funmap.c $(topdir)/keymaps.c \
|
||||||
|
$(topdir)/vi_mode.c $(topdir)/parens.c $(topdir)/rltty.c \
|
||||||
|
$(topdir)/complete.c $(topdir)/bind.c $(topdir)/isearch.c \
|
||||||
|
$(topdir)/display.c $(topdir)/signals.c $(topdir)/emacs_keymap.c \
|
||||||
|
$(topdir)/vi_keymap.c $(topdir)/util.c $(topdir)/kill.c \
|
||||||
|
$(topdir)/undo.c $(topdir)/macro.c $(topdir)/input.c \
|
||||||
|
$(topdir)/callback.c $(topdir)/terminal.c $(topdir)/xmalloc.c \
|
||||||
|
$(topdir)/history.c $(topdir)/histsearch.c $(topdir)/histexpand.c \
|
||||||
|
$(topdir)/histfile.c $(topdir)/nls.c $(topdir)/search.c \
|
||||||
|
$(topdir)/shell.c $(topdir)/savestring.c $(topdir)/tilde.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
|
||||||
|
|
||||||
|
SHARED_HISTOBJ = history.so histexpand.so histfile.so histsearch.so shell.so
|
||||||
|
SHARED_TILDEOBJ = tilde.so
|
||||||
|
SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \
|
||||||
|
rltty.so complete.so bind.so isearch.so display.so signals.so \
|
||||||
|
util.so kill.so undo.so macro.so input.so callback.so terminal.so \
|
||||||
|
nls.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ)
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
all: $(SHLIB_STATUS)
|
||||||
|
|
||||||
|
supported: $(SHARED_LIBS)
|
||||||
|
|
||||||
|
unsupported:
|
||||||
|
@echo "Your system and compiler (${host_os}-${CC}) are not supported by the"
|
||||||
|
@echo "${topdir}/support/shobj-conf script."
|
||||||
|
@echo "If your operating system provides facilities for creating"
|
||||||
|
@echo "shared libraries, please update the script and re-run configure.
|
||||||
|
@echo "Please send the changes you made to bash-maintainers@gnu.org"
|
||||||
|
@echo "for inclusion in future bash and readline releases."
|
||||||
|
|
||||||
|
$(SHARED_READLINE): $(SHARED_OBJ)
|
||||||
|
$(RM) $@
|
||||||
|
$(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_OBJ) $(SHLIB_LIBS)
|
||||||
|
|
||||||
|
$(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so
|
||||||
|
$(RM) $@
|
||||||
|
$(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) xmalloc.so $(SHLIB_LIBS)
|
||||||
|
|
||||||
|
installdirs: $(topdir)/support/mkdirs
|
||||||
|
-$(SHELL) $(topdir)/support/mkdirs $(libdir)
|
||||||
|
|
||||||
|
install: installdirs $(SHLIB_STATUS)
|
||||||
|
$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(libdir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
|
||||||
|
$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(libdir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
|
||||||
|
@echo install: you may need to run ldconfig
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(libdir) -U $(SHARED_HISTORY)
|
||||||
|
$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(libdir) -U $(SHARED_READLINE)
|
||||||
|
@echo uninstall: you may need to run ldconfig
|
||||||
|
|
||||||
|
clean mostlyclean: force
|
||||||
|
$(RM) $(SHARED_OBJ) $(SHARED_LIBS)
|
||||||
|
|
||||||
|
distclean maintainer-clean: clean
|
||||||
|
$(RM) Makefile
|
||||||
|
|
||||||
|
force:
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
bind.so: $(topdir)/ansi_stdlib.h $(topdir)/posixstat.h
|
||||||
|
bind.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
bind.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
bind.so: $(topdir)/tilde.h $(topdir)/history.h
|
||||||
|
callback.so: $(topdir)/rlconf.h
|
||||||
|
callback.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h
|
||||||
|
callback.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
callback.so: $(topdir)/tilde.h
|
||||||
|
complete.so: $(topdir)/ansi_stdlib.h posixdir.h $(topdir)/posixstat.h
|
||||||
|
complete.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
complete.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
complete.so: $(topdir)/tilde.h
|
||||||
|
display.so: $(topdir)/ansi_stdlib.h $(topdir)/posixstat.h
|
||||||
|
display.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
display.so: $(topdir)/tcap.h
|
||||||
|
display.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
display.so: $(topdir)/tilde.h $(topdir)/history.h
|
||||||
|
funmap.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
funmap.so: $(topdir)/rlconf.h $(topdir)/ansi_stdlib.h
|
||||||
|
funmap.so: ${BUILD_DIR}/config.h $(topdir)/tilde.h
|
||||||
|
histexpand.so: $(topdir)/ansi_stdlib.h
|
||||||
|
histexpand.so: $(topdir)/history.h histlib.h
|
||||||
|
histexpand.so: ${BUILD_DIR}/config.h
|
||||||
|
histfile.so: $(topdir)/ansi_stdlib.h
|
||||||
|
histfile.so: $(topdir)/history.h histlib.h
|
||||||
|
histfile.so: ${BUILD_DIR}/config.h
|
||||||
|
history.so: $(topdir)/ansi_stdlib.h
|
||||||
|
history.so: $(topdir)/history.h histlib.h
|
||||||
|
history.so: ${BUILD_DIR}/config.h
|
||||||
|
histsearch.so: $(topdir)/ansi_stdlib.h
|
||||||
|
histsearch.so: $(topdir)/history.h histlib.h
|
||||||
|
histsearch.so: ${BUILD_DIR}/config.h
|
||||||
|
input.so: $(topdir)/ansi_stdlib.h
|
||||||
|
input.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
input.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
input.so: $(topdir)/tilde.h
|
||||||
|
isearch.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
isearch.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
isearch.so: $(topdir)/ansi_stdlib.h $(topdir)/history.h $(topdir)/tilde.h
|
||||||
|
keymaps.so: emacs_keymap.c vi_keymap.c
|
||||||
|
keymaps.so: $(topdir)/keymaps.h $(topdir)/chardefs.h $(topdir)/rlconf.h
|
||||||
|
keymaps.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
keymaps.so: ${BUILD_DIR}/config.h $(topdir)/ansi_stdlib.h $(topdir)/tilde.h
|
||||||
|
kill.so: $(topdir)/ansi_stdlib.h
|
||||||
|
kill.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
kill.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
kill.so: $(topdir)/tilde.h $(topdir)/history.h
|
||||||
|
macro.so: $(topdir)/ansi_stdlib.h
|
||||||
|
macro.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
macro.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
macro.so: $(topdir)/tilde.h $(topdir)/history.h
|
||||||
|
nls.so: $(topdir)/ansi_stdlib.h
|
||||||
|
nls.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
parens.so: $(topdir)/rlconf.h ${BUILD_DIR}/config.h
|
||||||
|
parens.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
parens.so: $(topdir)/tilde.h
|
||||||
|
readline.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
readline.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
readline.so: $(topdir)/history.h $(topdir)/tilde.h
|
||||||
|
readline.so: $(topdir)/posixstat.h $(topdir)/ansi_stdlib.h $(topdir)/posixjmp.h
|
||||||
|
rltty.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
rltty.so: $(topdir)/rltty.h $(topdir)/tilde.h
|
||||||
|
rltty.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
search.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
search.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
search.so: $(topdir)/ansi_stdlib.h $(topdir)/history.h $(topdir)/tilde.h
|
||||||
|
signals.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
signals.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
signals.so: $(topdir)/history.h $(topdir)/tilde.h
|
||||||
|
terminal.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
terminal.so: $(topdir)/tcap.h
|
||||||
|
terminal.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
terminal.so: $(topdir)/tilde.h $(topdir)/history.h
|
||||||
|
tilde.so: $(topdir)/ansi_stdlib.h ${BUILD_DIR}/config.h $(topdir)/tilde.h
|
||||||
|
undo.so: $(topdir)/ansi_stdlib.h
|
||||||
|
undo.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
undo.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
undo.so: $(topdir)/tilde.h $(topdir)/history.h
|
||||||
|
util.so: $(topdir)/posixjmp.h $(topdir)/ansi_stdlib.h
|
||||||
|
util.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
util.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
util.so: $(topdir)/tilde.h
|
||||||
|
vi_mode.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
|
||||||
|
vi_mode.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
|
||||||
|
vi_mode.so: $(topdir)/history.h $(topdir)/ansi_stdlib.h $(topdir)/tilde.h
|
||||||
|
xmalloc.so: ${BUILD_DIR}/config.h
|
||||||
|
xmalloc.so: $(topdir)/ansi_stdlib.h
|
||||||
|
|
||||||
|
readline.so: $(topdir)/readline.c
|
||||||
|
vi_mode.so: $(topdir)/vi_mode.c
|
||||||
|
funmap.so: $(topdir)/funmap.c
|
||||||
|
keymaps.so: $(topdir)/keymaps.c
|
||||||
|
parens.so: $(topdir)/parens.c
|
||||||
|
search.so: $(topdir)/search.c
|
||||||
|
rltty.so: $(topdir)/rltty.c
|
||||||
|
complete.so: $(topdir)/complete.c
|
||||||
|
bind.so: $(topdir)/bind.c
|
||||||
|
isearch.so: $(topdir)/isearch.c
|
||||||
|
display.so: $(topdir)/display.c
|
||||||
|
signals.so: $(topdir)/signals.c
|
||||||
|
util.so: $(topdir)/util.c
|
||||||
|
kill.so: $(topdir)/kill.c
|
||||||
|
undo.so: $(topdir)/undo.c
|
||||||
|
macro.so: $(topdir)/macro.c
|
||||||
|
input.so: $(topdir)/input.c
|
||||||
|
callback.so: $(topdir)/callback.c
|
||||||
|
terminal.so: $(topdir)/terminal.c
|
||||||
|
nls.so: $(topdir)/nls.c
|
||||||
|
xmalloc.so: $(topdir)/xmalloc.c
|
||||||
|
history.so: $(topdir)/history.c
|
||||||
|
histexpand.so: $(topdir)/histexpand.c
|
||||||
|
histfile.so: $(topdir)/histfile.c
|
||||||
|
histsearch.so: $(topdir)/histsearch.c
|
||||||
|
savestring.so: $(topdir)/savestring.c
|
||||||
|
shell.so: $(topdir)/shell.c
|
||||||
|
tilde.so: $(topdir)/tilde.c
|
||||||
|
|
||||||
|
readline.so: readline.c
|
||||||
|
vi_mode.so: vi_mode.c
|
||||||
|
funmap.so: funmap.c
|
||||||
|
keymaps.so: keymaps.c
|
||||||
|
parens.so: parens.c
|
||||||
|
search.so: search.c
|
||||||
|
rltty.so: rltty.c
|
||||||
|
complete.so: complete.c
|
||||||
|
bind.so: bind.c
|
||||||
|
isearch.so: isearch.c
|
||||||
|
display.so: display.c
|
||||||
|
signals.so: signals.c
|
||||||
|
util.so: util.c
|
||||||
|
kill.so: kill.c
|
||||||
|
undo.so: undo.c
|
||||||
|
macro.so: macro.c
|
||||||
|
input.so: input.c
|
||||||
|
callback.so: callback.c
|
||||||
|
terminal.so: terminal.c
|
||||||
|
nls.so: nls.c
|
||||||
|
xmalloc.so: xmalloc.c
|
||||||
|
history.so: history.c
|
||||||
|
histexpand.so: histexpand.c
|
||||||
|
histfile.so: histfile.c
|
||||||
|
histsearch.so: histsearch.c
|
||||||
|
savestring.so: savestring.c
|
||||||
|
shell.so: shell.c
|
||||||
|
tilde.so: tilde.c
|
|
@ -49,18 +49,6 @@
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
||||||
extern int readline_echoing_p;
|
|
||||||
extern int rl_pending_input;
|
|
||||||
extern int _rl_meta_flag;
|
|
||||||
|
|
||||||
extern void free_undo_list ();
|
|
||||||
extern void _rl_get_screen_size ();
|
|
||||||
extern void _rl_redisplay_after_sigwinch ();
|
|
||||||
extern void _rl_clean_up_for_exit ();
|
|
||||||
extern void _rl_kill_kbd_macro ();
|
|
||||||
extern void _rl_init_argument ();
|
|
||||||
extern void rl_deprep_terminal (), rl_prep_terminal ();
|
|
||||||
|
|
||||||
#if !defined (RETSIGTYPE)
|
#if !defined (RETSIGTYPE)
|
||||||
# if defined (VOID_SIGHANDLER)
|
# if defined (VOID_SIGHANDLER)
|
||||||
# define RETSIGTYPE void
|
# define RETSIGTYPE void
|
||||||
|
@ -79,40 +67,52 @@ extern void rl_deprep_terminal (), rl_prep_terminal ();
|
||||||
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
|
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
|
||||||
typedef RETSIGTYPE SigHandler ();
|
typedef RETSIGTYPE SigHandler ();
|
||||||
|
|
||||||
|
extern int readline_echoing_p;
|
||||||
|
extern int rl_pending_input;
|
||||||
|
extern int _rl_meta_flag;
|
||||||
|
|
||||||
|
extern void free_undo_list ();
|
||||||
|
extern void _rl_get_screen_size ();
|
||||||
|
extern void _rl_redisplay_after_sigwinch ();
|
||||||
|
extern void _rl_clean_up_for_exit ();
|
||||||
|
extern void _rl_kill_kbd_macro ();
|
||||||
|
extern void _rl_init_argument ();
|
||||||
|
extern void rl_deprep_terminal (), rl_prep_terminal ();
|
||||||
|
|
||||||
static SigHandler *rl_set_sighandler ();
|
static SigHandler *rl_set_sighandler ();
|
||||||
|
|
||||||
|
/* Exported variables for use by applications. */
|
||||||
|
|
||||||
|
/* If non-zero, readline will install its own signal handlers for
|
||||||
|
SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
|
||||||
|
int rl_catch_signals = 1;
|
||||||
|
|
||||||
|
/* If non-zero, readline will install a signal handler for SIGWINCH. */
|
||||||
|
#ifdef SIGWINCH
|
||||||
|
int rl_catch_sigwinch = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int signals_set_flag;
|
||||||
|
static int sigwinch_set_flag;
|
||||||
|
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Signal Handling */
|
/* Signal Handling */
|
||||||
/* */
|
/* */
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
|
|
||||||
/* If we're not being compiled as part of bash, initialize handlers for
|
|
||||||
and catch the job control signals (SIGTTIN, SIGTTOU, SIGTSTP) and
|
|
||||||
SIGTERM. */
|
|
||||||
#if !defined (SHELL)
|
|
||||||
# define HANDLE_JOB_SIGNALS
|
|
||||||
# define HANDLE_SIGTERM
|
|
||||||
#endif /* !SHELL */
|
|
||||||
|
|
||||||
#if defined (HAVE_POSIX_SIGNALS)
|
#if defined (HAVE_POSIX_SIGNALS)
|
||||||
typedef struct sigaction sighandler_cxt;
|
typedef struct sigaction sighandler_cxt;
|
||||||
# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh)
|
# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh)
|
||||||
#else
|
#else
|
||||||
typedef struct { SigHandler *sa_handler; } sighandler_cxt;
|
typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt;
|
||||||
# define sigemptyset(m)
|
# define sigemptyset(m)
|
||||||
#endif /* !HAVE_POSIX_SIGNALS */
|
#endif /* !HAVE_POSIX_SIGNALS */
|
||||||
|
|
||||||
static sighandler_cxt old_int, old_alrm;
|
static sighandler_cxt old_int, old_term, old_alrm, old_quit;
|
||||||
|
#if defined (SIGTSTP)
|
||||||
#if defined (HANDLE_JOB_SIGNALS)
|
|
||||||
static sighandler_cxt old_tstp, old_ttou, old_ttin;
|
static sighandler_cxt old_tstp, old_ttou, old_ttin;
|
||||||
#endif /* HANDLE_JOB_SIGNALS */
|
|
||||||
|
|
||||||
#if defined (HANDLE_SIGTERM)
|
|
||||||
static sighandler_cxt old_term;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (SIGWINCH)
|
#if defined (SIGWINCH)
|
||||||
static sighandler_cxt old_winch;
|
static sighandler_cxt old_winch;
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,18 +143,8 @@ rl_signal_handler (sig)
|
||||||
switch (sig)
|
switch (sig)
|
||||||
{
|
{
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
{
|
rl_free_line_state ();
|
||||||
register HIST_ENTRY *entry;
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
free_undo_list ();
|
|
||||||
|
|
||||||
entry = current_history ();
|
|
||||||
if (entry)
|
|
||||||
entry->data = (char *)NULL;
|
|
||||||
}
|
|
||||||
_rl_kill_kbd_macro ();
|
|
||||||
rl_clear_message ();
|
|
||||||
_rl_init_argument ();
|
|
||||||
|
|
||||||
#if defined (SIGTSTP)
|
#if defined (SIGTSTP)
|
||||||
case SIGTSTP:
|
case SIGTSTP:
|
||||||
|
@ -163,10 +153,8 @@ rl_signal_handler (sig)
|
||||||
#endif /* SIGTSTP */
|
#endif /* SIGTSTP */
|
||||||
case SIGALRM:
|
case SIGALRM:
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
_rl_clean_up_for_exit ();
|
case SIGQUIT:
|
||||||
(*rl_deprep_term_function) ();
|
rl_cleanup_after_signal ();
|
||||||
rl_clear_signals ();
|
|
||||||
rl_pending_input = 0;
|
|
||||||
|
|
||||||
#if defined (HAVE_POSIX_SIGNALS)
|
#if defined (HAVE_POSIX_SIGNALS)
|
||||||
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
|
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
|
||||||
|
@ -188,8 +176,7 @@ rl_signal_handler (sig)
|
||||||
# endif /* HAVE_BSD_SIGNALS */
|
# endif /* HAVE_BSD_SIGNALS */
|
||||||
#endif /* !HAVE_POSIX_SIGNALS */
|
#endif /* !HAVE_POSIX_SIGNALS */
|
||||||
|
|
||||||
(*rl_prep_term_function) (_rl_meta_flag);
|
rl_reset_after_signal ();
|
||||||
rl_set_signals ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGHANDLER_RETURN;
|
SIGHANDLER_RETURN;
|
||||||
|
@ -197,7 +184,7 @@ rl_signal_handler (sig)
|
||||||
|
|
||||||
#if defined (SIGWINCH)
|
#if defined (SIGWINCH)
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
rl_handle_sigwinch (sig)
|
rl_sigwinch_handler (sig)
|
||||||
int sig;
|
int sig;
|
||||||
{
|
{
|
||||||
SigHandler *oh;
|
SigHandler *oh;
|
||||||
|
@ -209,14 +196,10 @@ rl_handle_sigwinch (sig)
|
||||||
disposition set by the calling application. We need this state
|
disposition set by the calling application. We need this state
|
||||||
because we call the application's SIGWINCH handler after updating
|
because we call the application's SIGWINCH handler after updating
|
||||||
our own idea of the screen size. */
|
our own idea of the screen size. */
|
||||||
rl_set_sighandler (SIGWINCH, rl_handle_sigwinch, &dummy_winch);
|
rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (readline_echoing_p)
|
rl_resize_terminal ();
|
||||||
{
|
|
||||||
_rl_get_screen_size (fileno (rl_instream), 1);
|
|
||||||
_rl_redisplay_after_sigwinch ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If another sigwinch handler has been installed, call it. */
|
/* If another sigwinch handler has been installed, call it. */
|
||||||
oh = (SigHandler *)old_winch.sa_handler;
|
oh = (SigHandler *)old_winch.sa_handler;
|
||||||
|
@ -263,62 +246,66 @@ rl_set_sighandler (sig, handler, ohandler)
|
||||||
return (ohandler->sa_handler);
|
return (ohandler->sa_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
rl_maybe_set_sighandler (sig, handler, ohandler)
|
||||||
|
int sig;
|
||||||
|
SigHandler *handler;
|
||||||
|
sighandler_cxt *ohandler;
|
||||||
|
{
|
||||||
|
sighandler_cxt dummy;
|
||||||
|
SigHandler *oh;
|
||||||
|
|
||||||
|
sigemptyset (&dummy.sa_mask);
|
||||||
|
oh = rl_set_sighandler (sig, handler, ohandler);
|
||||||
|
if (oh == (SigHandler *)SIG_IGN)
|
||||||
|
rl_sigaction (sig, ohandler, &dummy);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rl_set_signals ()
|
rl_set_signals ()
|
||||||
{
|
{
|
||||||
sighandler_cxt dummy;
|
sighandler_cxt dummy;
|
||||||
SigHandler *oh;
|
SigHandler *oh;
|
||||||
|
|
||||||
#if defined (HAVE_POSIX_SIGNALS)
|
if (rl_catch_signals && signals_set_flag == 0)
|
||||||
sigemptyset (&dummy.sa_mask);
|
{
|
||||||
#endif
|
rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int);
|
||||||
|
rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
|
||||||
|
rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit);
|
||||||
|
|
||||||
oh = rl_set_sighandler (SIGINT, rl_signal_handler, &old_int);
|
oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm);
|
||||||
if (oh == (SigHandler *)SIG_IGN)
|
if (oh == (SigHandler *)SIG_IGN)
|
||||||
rl_sigaction (SIGINT, &old_int, &dummy);
|
rl_sigaction (SIGALRM, &old_alrm, &dummy);
|
||||||
|
|
||||||
oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm);
|
|
||||||
if (oh == (SigHandler *)SIG_IGN)
|
|
||||||
rl_sigaction (SIGALRM, &old_alrm, &dummy);
|
|
||||||
#if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART)
|
#if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART)
|
||||||
/* If the application using readline has already installed a signal
|
/* If the application using readline has already installed a signal
|
||||||
handler with SA_RESTART, SIGALRM will cause reads to be restarted
|
handler with SA_RESTART, SIGALRM will cause reads to be restarted
|
||||||
automatically, so readline should just get out of the way. Since
|
automatically, so readline should just get out of the way. Since
|
||||||
we tested for SIG_IGN above, we can just test for SIG_DFL here. */
|
we tested for SIG_IGN above, we can just test for SIG_DFL here. */
|
||||||
if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART))
|
if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART))
|
||||||
rl_sigaction (SIGALRM, &old_alrm, &dummy);
|
rl_sigaction (SIGALRM, &old_alrm, &dummy);
|
||||||
#endif /* HAVE_POSIX_SIGNALS */
|
#endif /* HAVE_POSIX_SIGNALS */
|
||||||
|
|
||||||
#if defined (HANDLE_JOB_SIGNALS)
|
|
||||||
|
|
||||||
#if defined (SIGTSTP)
|
#if defined (SIGTSTP)
|
||||||
oh = rl_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp);
|
rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp);
|
||||||
if (oh == (SigHandler *)SIG_IGN)
|
|
||||||
rl_sigaction (SIGTSTP, &old_tstp, &dummy);
|
|
||||||
#else
|
|
||||||
oh = (SigHandler *)NULL;
|
|
||||||
#endif /* SIGTSTP */
|
#endif /* SIGTSTP */
|
||||||
|
|
||||||
#if defined (SIGTTOU)
|
#if defined (SIGTTOU)
|
||||||
rl_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou);
|
rl_maybe_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou);
|
||||||
rl_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin);
|
|
||||||
|
|
||||||
if (oh == (SigHandler *)SIG_IGN)
|
|
||||||
{
|
|
||||||
rl_set_sighandler (SIGTTOU, SIG_IGN, &dummy);
|
|
||||||
rl_set_sighandler (SIGTTIN, SIG_IGN, &dummy);
|
|
||||||
}
|
|
||||||
#endif /* SIGTTOU */
|
#endif /* SIGTTOU */
|
||||||
|
|
||||||
#endif /* HANDLE_JOB_SIGNALS */
|
#if defined (SIGTTIN)
|
||||||
|
rl_maybe_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin);
|
||||||
|
#endif /* SIGTTIN */
|
||||||
|
|
||||||
#if defined (HANDLE_SIGTERM)
|
signals_set_flag = 1;
|
||||||
/* Handle SIGTERM if we're not being compiled as part of bash. */
|
}
|
||||||
rl_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
|
|
||||||
#endif /* HANDLE_SIGTERM */
|
|
||||||
|
|
||||||
#if defined (SIGWINCH)
|
#if defined (SIGWINCH)
|
||||||
rl_set_sighandler (SIGWINCH, rl_handle_sigwinch, &old_winch);
|
if (rl_catch_sigwinch && sigwinch_set_flag == 0)
|
||||||
|
{
|
||||||
|
rl_maybe_set_sighandler (SIGWINCH, rl_sigwinch_handler, &old_winch);
|
||||||
|
sigwinch_set_flag = 1;
|
||||||
|
}
|
||||||
#endif /* SIGWINCH */
|
#endif /* SIGWINCH */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -329,35 +316,79 @@ rl_clear_signals ()
|
||||||
{
|
{
|
||||||
sighandler_cxt dummy;
|
sighandler_cxt dummy;
|
||||||
|
|
||||||
#if defined (HAVE_POSIX_SIGNALS)
|
if (rl_catch_signals && signals_set_flag == 1)
|
||||||
sigemptyset (&dummy.sa_mask);
|
{
|
||||||
#endif
|
sigemptyset (&dummy.sa_mask);
|
||||||
|
|
||||||
rl_sigaction (SIGINT, &old_int, &dummy);
|
rl_sigaction (SIGINT, &old_int, &dummy);
|
||||||
rl_sigaction (SIGALRM, &old_alrm, &dummy);
|
rl_sigaction (SIGTERM, &old_term, &dummy);
|
||||||
|
rl_sigaction (SIGQUIT, &old_quit, &dummy);
|
||||||
#if defined (HANDLE_JOB_SIGNALS)
|
rl_sigaction (SIGALRM, &old_alrm, &dummy);
|
||||||
|
|
||||||
#if defined (SIGTSTP)
|
#if defined (SIGTSTP)
|
||||||
rl_sigaction (SIGTSTP, &old_tstp, &dummy);
|
rl_sigaction (SIGTSTP, &old_tstp, &dummy);
|
||||||
#endif
|
#endif /* SIGTSTP */
|
||||||
|
|
||||||
#if defined (SIGTTOU)
|
#if defined (SIGTTOU)
|
||||||
rl_sigaction (SIGTTOU, &old_ttou, &dummy);
|
rl_sigaction (SIGTTOU, &old_ttou, &dummy);
|
||||||
rl_sigaction (SIGTTIN, &old_ttin, &dummy);
|
|
||||||
#endif /* SIGTTOU */
|
#endif /* SIGTTOU */
|
||||||
|
|
||||||
#endif /* HANDLE_JOB_SIGNALS */
|
#if defined (SIGTTIN)
|
||||||
|
rl_sigaction (SIGTTIN, &old_ttin, &dummy);
|
||||||
|
#endif /* SIGTTIN */
|
||||||
|
|
||||||
#if defined (HANDLE_SIGTERM)
|
signals_set_flag = 0;
|
||||||
rl_sigaction (SIGTERM, &old_term, &dummy);
|
}
|
||||||
#endif /* HANDLE_SIGTERM */
|
|
||||||
|
|
||||||
#if defined (SIGWINCH)
|
#if defined (SIGWINCH)
|
||||||
sigemptyset (&dummy.sa_mask);
|
if (rl_catch_sigwinch && sigwinch_set_flag == 1)
|
||||||
rl_sigaction (SIGWINCH, &old_winch, &dummy);
|
{
|
||||||
|
sigemptyset (&dummy.sa_mask);
|
||||||
|
rl_sigaction (SIGWINCH, &old_winch, &dummy);
|
||||||
|
sigwinch_set_flag = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clean up the terminal and readline state after catching a signal, before
|
||||||
|
resending it to the calling application. */
|
||||||
|
void
|
||||||
|
rl_cleanup_after_signal ()
|
||||||
|
{
|
||||||
|
_rl_clean_up_for_exit ();
|
||||||
|
(*rl_deprep_term_function) ();
|
||||||
|
rl_clear_signals ();
|
||||||
|
rl_pending_input = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reset the terminal and readline state after a signal handler returns. */
|
||||||
|
void
|
||||||
|
rl_reset_after_signal ()
|
||||||
|
{
|
||||||
|
(*rl_prep_term_function) (_rl_meta_flag);
|
||||||
|
rl_set_signals ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free up the readline variable line state for the current line (undo list,
|
||||||
|
any partial history entry, any keyboard macros in progress, and any
|
||||||
|
numeric arguments in process) after catching a signal, before calling
|
||||||
|
rl_cleanup_after_signal(). */
|
||||||
|
void
|
||||||
|
rl_free_line_state ()
|
||||||
|
{
|
||||||
|
register HIST_ENTRY *entry;
|
||||||
|
|
||||||
|
free_undo_list ();
|
||||||
|
|
||||||
|
entry = current_history ();
|
||||||
|
if (entry)
|
||||||
|
entry->data = (char *)NULL;
|
||||||
|
|
||||||
|
_rl_kill_kbd_macro ();
|
||||||
|
rl_clear_message ();
|
||||||
|
_rl_init_argument ();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* HANDLE_SIGNALS */
|
#endif /* HANDLE_SIGNALS */
|
||||||
|
|
26
readline/support/config.guess
vendored
26
readline/support/config.guess
vendored
|
@ -151,6 +151,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||||
*:QNX:*:42*)
|
*:QNX:*:42*)
|
||||||
echo i386-qssl-qnx`echo ${UNAME_VERSION}`
|
echo i386-qssl-qnx`echo ${UNAME_VERSION}`
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
BeBox:BeOS:*:*)
|
||||||
|
echo powerpc-be-beos
|
||||||
|
exit 0 ;;
|
||||||
|
BeMac:BeOS:*:*)
|
||||||
|
echo powerpc-apple-beos
|
||||||
|
exit 0 ;;
|
||||||
|
BePC:BeOS:*:*)
|
||||||
|
echo i586-pc-beos
|
||||||
|
exit 0 ;;
|
||||||
|
SX-4:SUPER-UX:*:*)
|
||||||
|
echo sx4-nec-superux${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
# end cases added for Bash
|
# end cases added for Bash
|
||||||
alpha:OSF1:*:*)
|
alpha:OSF1:*:*)
|
||||||
if test $UNAME_RELEASE = "V4.0"; then
|
if test $UNAME_RELEASE = "V4.0"; then
|
||||||
|
@ -213,6 +225,9 @@ EOF
|
||||||
amiga:OpenBSD:*:*)
|
amiga:OpenBSD:*:*)
|
||||||
echo m68k-cbm-openbsd${UNAME_RELEASE}
|
echo m68k-cbm-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
*:[Aa]miga[Oo][Ss]:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-amigaos
|
||||||
|
exit 0 ;;
|
||||||
arc64:OpenBSD:*:*)
|
arc64:OpenBSD:*:*)
|
||||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
@ -315,10 +330,10 @@ EOF
|
||||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
Power?Macintosh:Rhapsody:*:*)
|
Power?Macintosh:Rhapsody:*:*)
|
||||||
echo powerpc-apple-nextstep${UNAME_RELEASE}
|
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
*:Rhapsody:*:*)
|
*:Rhapsody:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-nextstep${UNAME_RELEASE}
|
echo ${UNAME_MACHINE}-unknown-rhapsody${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
powerpc:machten:*:*)
|
powerpc:machten:*:*)
|
||||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||||
|
@ -737,6 +752,11 @@ EOF
|
||||||
i?86:DYNIX/ptx:4*:*)
|
i?86:DYNIX/ptx:4*:*)
|
||||||
echo i386-sequent-sysv4
|
echo i386-sequent-sysv4
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
# added by chet for bash based on usenet posting from <hops@sco.com> and
|
||||||
|
# documentation on SCO's web site -- UnixWare 7 (SVR5)
|
||||||
|
i?86:UnixWare:5*:*)
|
||||||
|
echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
|
||||||
|
exit 0 ;;
|
||||||
i?86:UNIX_SV:4.2MP:2.*)
|
i?86:UNIX_SV:4.2MP:2.*)
|
||||||
# Unixware is an offshoot of SVR4, but it has its own version
|
# Unixware is an offshoot of SVR4, but it has its own version
|
||||||
# number series starting with 2...
|
# number series starting with 2...
|
||||||
|
@ -862,7 +882,7 @@ EOF
|
||||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||||
echo i586-unisys-sysv4
|
echo i586-unisys-sysv4
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||||
|
|
71
readline/support/config.sub
vendored
71
readline/support/config.sub
vendored
|
@ -94,7 +94,7 @@ case $os in
|
||||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||||
-apple)
|
-apple )
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
|
@ -102,7 +102,7 @@ case $os in
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
;;
|
;;
|
||||||
-sco5)
|
-sco5)
|
||||||
os=sco3.2v5
|
os=-sco3.2v5
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco4)
|
-sco4)
|
||||||
|
@ -175,7 +175,8 @@ case $basic_machine in
|
||||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
|
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
|
||||||
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
|
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
|
||||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
|
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
|
||||||
| alpha-* | we32k-* | cydra-* | ns16k-* \
|
| alpha-* | alphaev5-* | alphaev56-* | alphapca56-* | alphaev6-* \
|
||||||
|
| we32k-* | cydra-* | ns16k-* \
|
||||||
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
|
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
|
||||||
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
|
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
|
||||||
| mips64el-* | mips64orion-* | mips64orionel-* | f301-* \
|
| mips64el-* | mips64orion-* | mips64orionel-* | f301-* \
|
||||||
|
@ -183,7 +184,7 @@ case $basic_machine in
|
||||||
| cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
|
| cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
|
||||||
| tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \
|
| tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \
|
||||||
| concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \
|
| concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \
|
||||||
| *-convex)
|
| *-convex | sx4*-nec)
|
||||||
;;
|
;;
|
||||||
# Recognize the various machine names and aliases which stand
|
# Recognize the various machine names and aliases which stand
|
||||||
# for a CPU type and a company and sometimes even an OS.
|
# for a CPU type and a company and sometimes even an OS.
|
||||||
|
@ -208,7 +209,12 @@ case $basic_machine in
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
amiga | amiga-*)
|
amiga | amiga-*)
|
||||||
basic_machine=m68k-cbm
|
# basic_machine=m68k-cbm
|
||||||
|
basic_machine=m68k-unknown
|
||||||
|
;;
|
||||||
|
amigaos)
|
||||||
|
basic_machine=m68k-unknown
|
||||||
|
os=-amigaos
|
||||||
;;
|
;;
|
||||||
amigados)
|
amigados)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-cbm
|
||||||
|
@ -404,6 +410,14 @@ case $basic_machine in
|
||||||
miniframe)
|
miniframe)
|
||||||
basic_machine=m68000-convergent
|
basic_machine=m68000-convergent
|
||||||
;;
|
;;
|
||||||
|
mipsel*-linux*)
|
||||||
|
basic_machine=mipsel-unknown
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
|
mips*-linux*)
|
||||||
|
basic_machine=mips-unknown
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
mips3*-*)
|
mips3*-*)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||||
;;
|
;;
|
||||||
|
@ -454,6 +468,14 @@ case $basic_machine in
|
||||||
np1)
|
np1)
|
||||||
basic_machine=np1-gould
|
basic_machine=np1-gould
|
||||||
;;
|
;;
|
||||||
|
osr5 | sco5) # SCO Open Server
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-sco3.2v5
|
||||||
|
;;
|
||||||
|
odt | odt3 | odt4) # SCO Open Desktop
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-sco3.2v4
|
||||||
|
;;
|
||||||
pa-hitachi)
|
pa-hitachi)
|
||||||
basic_machine=hppa1.1-hitachi
|
basic_machine=hppa1.1-hitachi
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
|
@ -584,6 +606,14 @@ case $basic_machine in
|
||||||
basic_machine=a29k-nyu
|
basic_machine=a29k-nyu
|
||||||
os=-sym1
|
os=-sym1
|
||||||
;;
|
;;
|
||||||
|
uw2 | unixware | unixware2)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-sysv4.2uw2.1
|
||||||
|
;;
|
||||||
|
uw7 | unixware7)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-sysv5uw7
|
||||||
|
;;
|
||||||
vaxv)
|
vaxv)
|
||||||
basic_machine=vax-dec
|
basic_machine=vax-dec
|
||||||
os=-sysv
|
os=-sysv
|
||||||
|
@ -622,7 +652,11 @@ case $basic_machine in
|
||||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||||
# some cases the only manufacturer, in others, it is the most popular.
|
# some cases the only manufacturer, in others, it is the most popular.
|
||||||
mips)
|
mips)
|
||||||
basic_machine=mips-mips
|
if test "x$os" = "x-linux" ; then
|
||||||
|
basic_machine=mips-unknown
|
||||||
|
else
|
||||||
|
basic_machine=mips-mips
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
romp)
|
romp)
|
||||||
basic_machine=romp-ibm
|
basic_machine=romp-ibm
|
||||||
|
@ -683,9 +717,15 @@ case $os in
|
||||||
-solaris)
|
-solaris)
|
||||||
os=-solaris2
|
os=-solaris2
|
||||||
;;
|
;;
|
||||||
-unixware* | svr4*)
|
svr4*)
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
|
-unixware | -uw | -unixware2* | -uw2*)
|
||||||
|
os=-sysv4.2uw2.1
|
||||||
|
;;
|
||||||
|
-unixware7* | -uw7*)
|
||||||
|
os=-sysv5uw7
|
||||||
|
;;
|
||||||
-gnu/linux*)
|
-gnu/linux*)
|
||||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||||
;;
|
;;
|
||||||
|
@ -696,15 +736,16 @@ case $os in
|
||||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||||
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
|
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||||
| -linux-gnu* | -uxpv* | -qnx* | -powerux)
|
| -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \
|
||||||
|
| -superux* )
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
-linux*)
|
-linux*)
|
||||||
|
@ -759,7 +800,10 @@ case $os in
|
||||||
-sysvr4)
|
-sysvr4)
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
# This must come after -sysvr4.
|
-sysvr5)
|
||||||
|
os=-sysv5
|
||||||
|
;;
|
||||||
|
# This must come after -sysvr[45].
|
||||||
-sysv*)
|
-sysv*)
|
||||||
;;
|
;;
|
||||||
-xenix)
|
-xenix)
|
||||||
|
@ -817,6 +861,9 @@ case $basic_machine in
|
||||||
sparc-* | *-sun)
|
sparc-* | *-sun)
|
||||||
os=-sunos4.1.1
|
os=-sunos4.1.1
|
||||||
;;
|
;;
|
||||||
|
*-be)
|
||||||
|
os=-beos
|
||||||
|
;;
|
||||||
*-ibm)
|
*-ibm)
|
||||||
os=-aix
|
os=-aix
|
||||||
;;
|
;;
|
||||||
|
@ -830,7 +877,7 @@ case $basic_machine in
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
*-cbm)
|
*-cbm)
|
||||||
os=-amigados
|
os=-amigaos
|
||||||
;;
|
;;
|
||||||
*-dg)
|
*-dg)
|
||||||
os=-dgux
|
os=-dgux
|
||||||
|
|
|
@ -48,7 +48,7 @@ fi
|
||||||
version=$1
|
version=$1
|
||||||
newdir=${ROOTNAME}-$version
|
newdir=${ROOTNAME}-$version
|
||||||
|
|
||||||
vmsg creating distribution for version $version in $newdir
|
vmsg creating distribution for $ROOTNAME version $version in $newdir
|
||||||
|
|
||||||
if [ ! -d $newdir ]; then
|
if [ ! -d $newdir ]; then
|
||||||
mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
|
mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
|
||||||
|
|
105
readline/support/shlib-install
Executable file
105
readline/support/shlib-install
Executable file
|
@ -0,0 +1,105 @@
|
||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# shlib-install - install a shared library and do any necessary host-specific
|
||||||
|
# post-installation configuration (like ldconfig)
|
||||||
|
#
|
||||||
|
# usage: shlib-install [-D] -O host_os -d installation-dir -i install-prog [-U] library
|
||||||
|
#
|
||||||
|
# Chet Ramey
|
||||||
|
# chet@po.cwru.edu
|
||||||
|
|
||||||
|
#
|
||||||
|
# defaults
|
||||||
|
#
|
||||||
|
INSTALLDIR=/usr/local/lib
|
||||||
|
LDCONFIG=ldconfig
|
||||||
|
|
||||||
|
PROGNAME=`basename $0`
|
||||||
|
USAGE="$PROGNAME [-D] -O host_os -d installation-dir -i install-prog [-U] library"
|
||||||
|
|
||||||
|
# process options
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-O) shift; host_os="$1"; shift ;;
|
||||||
|
-d) shift; INSTALLDIR="$1"; shift ;;
|
||||||
|
-i) shift; INSTALLPROG="$1" ; shift ;;
|
||||||
|
-D) echo=echo ; shift ;;
|
||||||
|
-U) uninstall=true ; shift ;;
|
||||||
|
-*) echo "$USAGE" >&2 ; exit 2;;
|
||||||
|
*) break ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# set install target name
|
||||||
|
LIBNAME="$1"
|
||||||
|
|
||||||
|
if [ -z "$LIBNAME" ]; then
|
||||||
|
echo "$USAGE" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
OLDSUFF=old
|
||||||
|
MV=mv
|
||||||
|
RM="rm -f"
|
||||||
|
LN="ln -s"
|
||||||
|
|
||||||
|
# pre-install
|
||||||
|
|
||||||
|
if [ -z "$uninstall" ]; then
|
||||||
|
${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
|
||||||
|
if [ -f "$INSTALLDIR/$LIBNAME" ]; then
|
||||||
|
${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}${OLDSUFF}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install/uninstall
|
||||||
|
|
||||||
|
if [ -z "$uninstall" ] ; then
|
||||||
|
${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
|
||||||
|
else
|
||||||
|
${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# post-install/uninstall
|
||||||
|
|
||||||
|
case "$LIBNAME" in
|
||||||
|
*.*.[0-9].[0-9]) # libname.so.M.N
|
||||||
|
LINK2=`echo $LIBNAME | sed 's:\(.*\..*\.[0-9]\)\.[0-9]:\1:'` # libname.so.M
|
||||||
|
LINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]\.[0-9]:\1:'` # libname.so
|
||||||
|
;;
|
||||||
|
*.*.[0-9]) # libname.so.M
|
||||||
|
LINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]:\1:'` # libname.so
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create symlinks to the installed library. This section is incomplete.
|
||||||
|
#
|
||||||
|
case "$host_os" in
|
||||||
|
*linux*|bsdi4*)
|
||||||
|
# libname.so.M -> libname.so.M.N
|
||||||
|
${echo} ${RM} ${INSTALLDIR}/$LINK2
|
||||||
|
if [ -z "$uninstall" ]; then
|
||||||
|
${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# libname.so -> libname.so.M.N
|
||||||
|
${echo} ${RM} ${INSTALLDIR}/$LINK1
|
||||||
|
if [ -z "$uninstall" ]; then
|
||||||
|
${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
solaris2*|aix4.[2-9]*|hpux1*)
|
||||||
|
# libname.so -> libname.so.M
|
||||||
|
${echo} ${RM} ${INSTALLDIR}/$LINK1
|
||||||
|
if [ -z "$uninstall" ]; then
|
||||||
|
${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
341
readline/support/shobj-conf
Executable file
341
readline/support/shobj-conf
Executable file
|
@ -0,0 +1,341 @@
|
||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# shobj-conf -- output a series of variable assignments to be substituted
|
||||||
|
# into a Makefile by configure which specify system-dependent
|
||||||
|
# information for creating shared objects that may be loaded
|
||||||
|
# into bash with `enable -f'
|
||||||
|
#
|
||||||
|
# usage: shobj-conf [-C compiler] -c host_cpu -o host_os -v host_vendor
|
||||||
|
#
|
||||||
|
# Chet Ramey
|
||||||
|
# chet@po.cwru.edu
|
||||||
|
|
||||||
|
#
|
||||||
|
# defaults
|
||||||
|
#
|
||||||
|
SHOBJ_STATUS=supported
|
||||||
|
SHLIB_STATUS=supported
|
||||||
|
|
||||||
|
SHOBJ_CC=cc
|
||||||
|
SHOBJ_CFLAGS=
|
||||||
|
SHOBJ_LD=
|
||||||
|
SHOBJ_LDFLAGS=
|
||||||
|
SHOBJ_XLDFLAGS=
|
||||||
|
SHOBJ_LIBS=
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS=
|
||||||
|
SHLIB_LIBS=
|
||||||
|
SHLIB_LIBSUFF='so'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF)'
|
||||||
|
|
||||||
|
PROGNAME=`basename $0`
|
||||||
|
USAGE="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-C) shift; SHOBJ_CC="$1"; shift ;;
|
||||||
|
-c) shift; host_cpu="$1"; shift ;;
|
||||||
|
-o) shift; host_os="$1"; shift ;;
|
||||||
|
-v) shift; host_vendor="$1"; shift ;;
|
||||||
|
*) echo "$USAGE" >&2 ; exit 2;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
case "${host_os}-${SHOBJ_CC}" in
|
||||||
|
sunos4*-gcc*)
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD=/usr/bin/ld
|
||||||
|
SHOBJ_LDFLAGS='-assert pure-text'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sunos4*)
|
||||||
|
SHOBJ_CFLAGS=-pic
|
||||||
|
SHOBJ_LD=/usr/bin/ld
|
||||||
|
SHOBJ_LDFLAGS='-assert pure-text'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sunos5*-gcc*|solaris2*-gcc*)
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-i'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-R $(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sunos5*|solaris2*)
|
||||||
|
SHOBJ_CFLAGS='-K pic'
|
||||||
|
SHOBJ_LD=/usr/ccs/bin/ld
|
||||||
|
SHOBJ_LDFLAGS='-G -dy -z text -i -h $@'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-R $(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
freebsd2* | netbsd* | openbsd*)
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-x -Bshareable'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-R$(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
freebsd3*)
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-R$(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
linux*)
|
||||||
|
SHOBJ_CFLAGS=-fPIC
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
bsdi2*)
|
||||||
|
SHOBJ_CC=shlicc2
|
||||||
|
SHOBJ_CFLAGS=
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS=-r
|
||||||
|
SHOBJ_LIBS=-lc_s.2.1.0
|
||||||
|
|
||||||
|
# BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
|
||||||
|
# the ass -- they require changing {/usr/lib,etc}/shlib.map on
|
||||||
|
# each system, and the library creation process is byzantine
|
||||||
|
SHLIB_STATUS=unsupported
|
||||||
|
;;
|
||||||
|
|
||||||
|
bsdi3*)
|
||||||
|
SHOBJ_CC=shlicc2
|
||||||
|
SHOBJ_CFLAGS=
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS=-r
|
||||||
|
SHOBJ_LIBS=-lc_s.3.0.0
|
||||||
|
|
||||||
|
# BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
|
||||||
|
# the ass -- they require changing {/usr/lib,etc}/shlib.map on
|
||||||
|
# each system, and the library creation process is byzantine
|
||||||
|
SHLIB_STATUS=unsupported
|
||||||
|
;;
|
||||||
|
|
||||||
|
bsdi4*)
|
||||||
|
# BSD/OS 4.x now supports ELF and SunOS-style dynamically-linked
|
||||||
|
# shared libraries. gcc 2.x is the standard compiler, and the
|
||||||
|
# `normal' gcc options should work as they do in Linux.
|
||||||
|
|
||||||
|
SHOBJ_CFLAGS=-fPIC
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
osf*)
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-shared -soname $@ -expect_unresolved "*"'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-rpath $(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix4.[2-9]*-gcc*) # lightly tested by jik@cisco.com
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD='ld'
|
||||||
|
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
|
||||||
|
SHOBJ_XLDFLAGS='-G'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-bM:SRE'
|
||||||
|
SHLIB_LIBS='-lcurses -lc'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix4.[2-9]*)
|
||||||
|
SHOBJ_CFLAGS=-K
|
||||||
|
SHOBJ_LD='ld'
|
||||||
|
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
|
||||||
|
SHOBJ_XLDFLAGS='-G'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-bM:SRE'
|
||||||
|
SHLIB_LIBS='-lcurses -lc'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
#
|
||||||
|
# THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface
|
||||||
|
#
|
||||||
|
irix[56]*-gcc*)
|
||||||
|
SHOBJ_CFLAGS='-fpic'
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
irix[56]*)
|
||||||
|
SHOBJ_CFLAGS='-K PIC'
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-rpath $(libdir)'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux9*-gcc*)
|
||||||
|
# must use gcc; the bundled cc cannot compile PIC code
|
||||||
|
SHOBJ_CFLAGS='-fpic'
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
|
||||||
|
SHLIB_LIBSUFF='sl'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux9*)
|
||||||
|
SHOBJ_STATUS=unsupported
|
||||||
|
SHLIB_STATUS=unsupported
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux10*-gcc*)
|
||||||
|
# must use gcc; the bundled cc cannot compile PIC code
|
||||||
|
SHOBJ_CFLAGS='-fpic'
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
|
||||||
|
SHLIB_LIBSUFF='sl'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux10*)
|
||||||
|
SHOBJ_STATUS=unsupported
|
||||||
|
SHLIB_STATUS=unsupported
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux11*-gcc*)
|
||||||
|
# must use gcc; the bundled cc cannot compile PIC code
|
||||||
|
SHOBJ_CFLAGS='-fpic'
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
# SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@'
|
||||||
|
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s -Wl,+h,$@'
|
||||||
|
|
||||||
|
SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
|
||||||
|
SHLIB_LIBSUFF='sl'
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux11*)
|
||||||
|
SHOBJ_STATUS=unsupported
|
||||||
|
SHLIB_STATUS=unsupported
|
||||||
|
;;
|
||||||
|
|
||||||
|
sysv4*-gcc*)
|
||||||
|
SHOBJ_CFLAGS=-shared
|
||||||
|
SHOBJ_LDFLAGS='-shared -h $@'
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sysv4*)
|
||||||
|
SHOBJ_CFLAGS='-K PIC'
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-dy -z text -G -h $@'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sco3.2v5*-gcc*)
|
||||||
|
SHOBJ_CFLAGS='-fpic' # DEFAULTS TO ELF
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sco3.2v5*)
|
||||||
|
SHOBJ_CFLAGS='-K pic -b elf'
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-G -b elf -dy -z text -h $@'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sysv5uw7*-gcc*)
|
||||||
|
SHOBJ_CFLAGS='-fpic'
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
sysv5uw7*)
|
||||||
|
SHOBJ_CFLAGS='-K PIC'
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-G -dy -z text -h $@'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
dgux*-gcc*)
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
dgux*)
|
||||||
|
SHOBJ_CFLAGS='-K pic'
|
||||||
|
SHOBJ_LD=ld
|
||||||
|
SHOBJ_LDFLAGS='-G -dy -h $@'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
#
|
||||||
|
# Rely on correct gcc configuration for everything else
|
||||||
|
#
|
||||||
|
*-gcc*)
|
||||||
|
SHOBJ_CFLAGS=-fpic
|
||||||
|
SHOBJ_LD='${CC}'
|
||||||
|
SHOBJ_LDFLAGS='-shared'
|
||||||
|
|
||||||
|
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
SHOBJ_STATUS=unsupported
|
||||||
|
SHLIB_STATUS=unsupported
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo SHOBJ_CC=\'"$SHOBJ_CC"\'
|
||||||
|
echo SHOBJ_CFLAGS=\'"$SHOBJ_CFLAGS"\'
|
||||||
|
echo SHOBJ_LD=\'"$SHOBJ_LD"\'
|
||||||
|
echo SHOBJ_LDFLAGS=\'"$SHOBJ_LDFLAGS"\'
|
||||||
|
echo SHOBJ_XLDFLAGS=\'"$SHOBJ_XLDFLAGS"\'
|
||||||
|
echo SHOBJ_LIBS=\'"$SHOBJ_LIBS"\'
|
||||||
|
|
||||||
|
echo SHLIB_XLDFLAGS=\'"$SHLIB_XLDFLAGS"\'
|
||||||
|
echo SHLIB_LIBS=\'"$SHLIB_LIBS"\'
|
||||||
|
echo SHLIB_LIBSUFF=\'"$SHLIB_LIBSUFF"\'
|
||||||
|
echo SHLIB_LIBVERSION=\'"$SHLIB_LIBVERSION"\'
|
||||||
|
|
||||||
|
echo SHOBJ_STATUS=\'"$SHOBJ_STATUS"\'
|
||||||
|
echo SHLIB_STATUS=\'"$SHLIB_STATUS"\'
|
||||||
|
|
||||||
|
exit 0
|
|
@ -236,6 +236,16 @@ _rl_set_screen_size (rows, cols)
|
||||||
screenchars = screenwidth * screenheight;
|
screenchars = screenwidth * screenheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rl_resize_terminal ()
|
||||||
|
{
|
||||||
|
if (readline_echoing_p)
|
||||||
|
{
|
||||||
|
_rl_get_screen_size (fileno (rl_instream), 1);
|
||||||
|
_rl_redisplay_after_sigwinch ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct _tc_string {
|
struct _tc_string {
|
||||||
char *tc_var;
|
char *tc_var;
|
||||||
char **tc_value;
|
char **tc_value;
|
||||||
|
|
|
@ -47,10 +47,6 @@
|
||||||
|
|
||||||
#include "tilde.h"
|
#include "tilde.h"
|
||||||
|
|
||||||
#ifdef SHELL
|
|
||||||
#include "shell.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined (HAVE_GETPW_DECLS)
|
#if !defined (HAVE_GETPW_DECLS)
|
||||||
extern struct passwd *getpwuid (), *getpwnam ();
|
extern struct passwd *getpwuid (), *getpwnam ();
|
||||||
#endif /* !HAVE_GETPW_DECLS */
|
#endif /* !HAVE_GETPW_DECLS */
|
||||||
|
@ -77,6 +73,12 @@ static char *xmalloc (), *xrealloc ();
|
||||||
extern char *xmalloc (), *xrealloc ();
|
extern char *xmalloc (), *xrealloc ();
|
||||||
#endif /* TEST || STATIC_MALLOC */
|
#endif /* TEST || STATIC_MALLOC */
|
||||||
|
|
||||||
|
/* If being compiled as part of bash, these will be satisfied from
|
||||||
|
variables.o. If being compiled as part of readline, they will
|
||||||
|
be satisfied from shell.o. */
|
||||||
|
extern char *get_home_dir ();
|
||||||
|
extern char *get_env_value ();
|
||||||
|
|
||||||
/* The default value of tilde_additional_prefixes. This is set to
|
/* The default value of tilde_additional_prefixes. This is set to
|
||||||
whitespace preceding a tilde so that simple programs which do not
|
whitespace preceding a tilde so that simple programs which do not
|
||||||
perform any word separation get desired behaviour. */
|
perform any word separation get desired behaviour. */
|
||||||
|
@ -171,15 +173,6 @@ tilde_find_suffix (string)
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined (SHELL)
|
|
||||||
static char *
|
|
||||||
get_string_value (varname)
|
|
||||||
char *varname;
|
|
||||||
{
|
|
||||||
return ((char *)getenv (varname));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Return a new string which is the result of tilde expanding STRING. */
|
/* Return a new string which is the result of tilde expanding STRING. */
|
||||||
char *
|
char *
|
||||||
tilde_expand (string)
|
tilde_expand (string)
|
||||||
|
@ -284,27 +277,6 @@ glue_prefix_and_suffix (prefix, suffix, suffind)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
|
||||||
get_home_dir ()
|
|
||||||
{
|
|
||||||
char *home_dir;
|
|
||||||
|
|
||||||
#ifdef SHELL
|
|
||||||
home_dir = (char *)NULL;
|
|
||||||
if (current_user.home_dir == 0)
|
|
||||||
get_current_user_info ();
|
|
||||||
home_dir = current_user.home_dir;
|
|
||||||
#else
|
|
||||||
struct passwd *entry;
|
|
||||||
|
|
||||||
home_dir = (char *)NULL;
|
|
||||||
entry = getpwuid (getuid ());
|
|
||||||
if (entry)
|
|
||||||
home_dir = entry->pw_dir;
|
|
||||||
#endif
|
|
||||||
return (home_dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
|
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
|
||||||
tilde. If there is no expansion, call tilde_expansion_failure_hook.
|
tilde. If there is no expansion, call tilde_expansion_failure_hook.
|
||||||
This always returns a newly-allocated string, never static storage. */
|
This always returns a newly-allocated string, never static storage. */
|
||||||
|
@ -328,7 +300,7 @@ tilde_expand_word (filename)
|
||||||
if (filename[1] == '\0' || filename[1] == '/')
|
if (filename[1] == '\0' || filename[1] == '/')
|
||||||
{
|
{
|
||||||
/* Prefix $HOME to the rest of the string. */
|
/* Prefix $HOME to the rest of the string. */
|
||||||
expansion = get_string_value ("HOME");
|
expansion = get_env_value ("HOME");
|
||||||
|
|
||||||
/* If there is no HOME variable, look up the directory in
|
/* If there is no HOME variable, look up the directory in
|
||||||
the password database. */
|
the password database. */
|
||||||
|
|
|
@ -64,6 +64,7 @@ extern int _rl_defining_kbd_macro;
|
||||||
extern char *_rl_executing_macro;
|
extern char *_rl_executing_macro;
|
||||||
|
|
||||||
/* Pseudo-global functions imported from other library files. */
|
/* Pseudo-global functions imported from other library files. */
|
||||||
|
extern void _rl_replace_text ();
|
||||||
extern void _rl_pop_executing_macro ();
|
extern void _rl_pop_executing_macro ();
|
||||||
extern void _rl_set_the_line ();
|
extern void _rl_set_the_line ();
|
||||||
extern void _rl_init_argument ();
|
extern void _rl_init_argument ();
|
||||||
|
@ -124,7 +125,7 @@ rl_tty_status (count, key)
|
||||||
{
|
{
|
||||||
#if defined (TIOCSTAT)
|
#if defined (TIOCSTAT)
|
||||||
ioctl (1, TIOCSTAT, (char *)0);
|
ioctl (1, TIOCSTAT, (char *)0);
|
||||||
rl_refresh_line ();
|
rl_refresh_line (count, key);
|
||||||
#else
|
#else
|
||||||
ding ();
|
ding ();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
extern char *xmalloc (), *xrealloc ();
|
extern char *xmalloc (), *xrealloc ();
|
||||||
|
|
||||||
/* Variables imported from readline.c */
|
/* Variables imported from readline.c */
|
||||||
extern int rl_point, rl_end, rl_mark, rl_done;
|
extern int rl_point, rl_end, rl_mark;
|
||||||
extern FILE *rl_instream;
|
extern FILE *rl_instream;
|
||||||
extern int rl_line_buffer_len, rl_explicit_arg, rl_numeric_arg;
|
extern int rl_line_buffer_len, rl_explicit_arg, rl_numeric_arg;
|
||||||
extern Keymap _rl_keymap;
|
extern Keymap _rl_keymap;
|
||||||
|
@ -352,9 +352,9 @@ rl_vi_prev_word (count, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_rl_uppercase_p (key))
|
if (_rl_uppercase_p (key))
|
||||||
rl_vi_bWord (count);
|
rl_vi_bWord (count, key);
|
||||||
else
|
else
|
||||||
rl_vi_bword (count);
|
rl_vi_bword (count, key);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -374,9 +374,9 @@ rl_vi_next_word (count, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_rl_uppercase_p (key))
|
if (_rl_uppercase_p (key))
|
||||||
rl_vi_fWord (count);
|
rl_vi_fWord (count, key);
|
||||||
else
|
else
|
||||||
rl_vi_fword (count);
|
rl_vi_fword (count, key);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,16 +392,16 @@ rl_vi_end_word (count, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_rl_uppercase_p (key))
|
if (_rl_uppercase_p (key))
|
||||||
rl_vi_eWord (count);
|
rl_vi_eWord (count, key);
|
||||||
else
|
else
|
||||||
rl_vi_eword (count);
|
rl_vi_eword (count, key);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move forward a word the way that 'W' does. */
|
/* Move forward a word the way that 'W' does. */
|
||||||
int
|
int
|
||||||
rl_vi_fWord (count)
|
rl_vi_fWord (count, ignore)
|
||||||
int count;
|
int count, ignore;
|
||||||
{
|
{
|
||||||
while (count-- && rl_point < (rl_end - 1))
|
while (count-- && rl_point < (rl_end - 1))
|
||||||
{
|
{
|
||||||
|
@ -417,8 +417,8 @@ rl_vi_fWord (count)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rl_vi_bWord (count)
|
rl_vi_bWord (count, ignore)
|
||||||
int count;
|
int count, ignore;
|
||||||
{
|
{
|
||||||
while (count-- && rl_point > 0)
|
while (count-- && rl_point > 0)
|
||||||
{
|
{
|
||||||
|
@ -441,8 +441,8 @@ rl_vi_bWord (count)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rl_vi_eWord (count)
|
rl_vi_eWord (count, ignore)
|
||||||
int count;
|
int count, ignore;
|
||||||
{
|
{
|
||||||
while (count-- && rl_point < (rl_end - 1))
|
while (count-- && rl_point < (rl_end - 1))
|
||||||
{
|
{
|
||||||
|
@ -471,8 +471,8 @@ rl_vi_eWord (count)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rl_vi_fword (count)
|
rl_vi_fword (count, ignore)
|
||||||
int count;
|
int count, ignore;
|
||||||
{
|
{
|
||||||
while (count-- && rl_point < (rl_end - 1))
|
while (count-- && rl_point < (rl_end - 1))
|
||||||
{
|
{
|
||||||
|
@ -497,8 +497,8 @@ rl_vi_fword (count)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rl_vi_bword (count)
|
rl_vi_bword (count, ignore)
|
||||||
int count;
|
int count, ignore;
|
||||||
{
|
{
|
||||||
while (count-- && rl_point > 0)
|
while (count-- && rl_point > 0)
|
||||||
{
|
{
|
||||||
|
@ -536,8 +536,8 @@ rl_vi_bword (count)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rl_vi_eword (count)
|
rl_vi_eword (count, ignore)
|
||||||
int count;
|
int count, ignore;
|
||||||
{
|
{
|
||||||
while (count-- && rl_point < rl_end - 1)
|
while (count-- && rl_point < rl_end - 1)
|
||||||
{
|
{
|
||||||
|
@ -729,7 +729,7 @@ rl_vi_put (count, key)
|
||||||
if (!_rl_uppercase_p (key) && (rl_point + 1 <= rl_end))
|
if (!_rl_uppercase_p (key) && (rl_point + 1 <= rl_end))
|
||||||
rl_point++;
|
rl_point++;
|
||||||
|
|
||||||
rl_yank ();
|
rl_yank (1, key);
|
||||||
rl_backward (1, key);
|
rl_backward (1, key);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue