aboutsummaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
Diffstat (limited to 'readline')
-rw-r--r--readline/CHANGELOG123
-rw-r--r--readline/CHANGES108
-rw-r--r--readline/COPYING4
-rw-r--r--readline/ChangeLog.Cygnus1050
-rw-r--r--readline/MANIFEST12
-rw-r--r--readline/Makefile.in129
-rw-r--r--readline/README2
-rw-r--r--readline/acconfig.h28
-rw-r--r--readline/aclocal.m4172
-rw-r--r--readline/ansi_stdlib.h2
-rw-r--r--readline/bind.c472
-rw-r--r--readline/callback.c14
-rw-r--r--readline/chardefs.h4
-rw-r--r--readline/complete.c139
-rw-r--r--readline/config.h.bot22
-rw-r--r--readline/config.h.in100
-rwxr-xr-xreadline/configure319
-rw-r--r--readline/configure.in63
-rw-r--r--readline/cross-build/cygwin.cache45
-rw-r--r--readline/display.c351
-rw-r--r--readline/doc/ChangeLog53
-rw-r--r--readline/doc/Makefile.in87
-rw-r--r--readline/doc/hist.texinfo4
-rw-r--r--readline/doc/hstech.texinfo9
-rw-r--r--readline/doc/hsuser.texinfo113
-rw-r--r--readline/doc/inc-hist.texinfo399
-rw-r--r--readline/doc/manvers.texinfo10
-rw-r--r--readline/doc/readline.01188
-rw-r--r--readline/doc/readline.311
-rw-r--r--readline/doc/rlman.texinfo4
-rw-r--r--readline/doc/rltech.texinfo51
-rw-r--r--readline/doc/rluser.texinfo448
-rw-r--r--readline/emacs_keymap.c16
-rw-r--r--readline/examples/Makefile.in38
-rw-r--r--readline/examples/fileman.c26
-rw-r--r--readline/examples/rl.c39
-rw-r--r--readline/examples/rltest.c16
-rw-r--r--readline/examples/rlversion.c8
-rw-r--r--readline/funmap.c16
-rw-r--r--readline/histexpand.c18
-rw-r--r--readline/histfile.c89
-rw-r--r--readline/histlib.h12
-rw-r--r--readline/history.c6
-rw-r--r--readline/history.h10
-rw-r--r--readline/histsearch.c7
-rw-r--r--readline/input.c92
-rw-r--r--readline/isearch.c21
-rw-r--r--readline/keymaps.c14
-rw-r--r--readline/keymaps.h12
-rw-r--r--readline/kill.c39
-rw-r--r--readline/macro.c19
-rw-r--r--readline/nls.c21
-rw-r--r--readline/parens.c41
-rw-r--r--readline/posixdir.h4
-rw-r--r--readline/posixjmp.h18
-rw-r--r--readline/posixstat.h4
-rw-r--r--readline/readline.c207
-rw-r--r--readline/readline.h23
-rw-r--r--readline/rlconf.h8
-rw-r--r--readline/rldefs.h7
-rw-r--r--readline/rlstdc.h52
-rw-r--r--readline/rltty.c208
-rw-r--r--readline/rltty.h25
-rw-r--r--readline/rlwinsize.h5
-rw-r--r--readline/savestring.c4
-rw-r--r--readline/search.c182
-rw-r--r--readline/shell.c51
-rw-r--r--readline/shlib/Makefile.in61
-rw-r--r--readline/signals.c56
-rwxr-xr-xreadline/support/config.guess382
-rwxr-xr-xreadline/support/config.sub397
-rwxr-xr-xreadline/support/shlib-install47
-rwxr-xr-xreadline/support/shobj-conf46
-rw-r--r--readline/tcap.h4
-rw-r--r--readline/terminal.c235
-rw-r--r--readline/tilde.c55
-rw-r--r--readline/tilde.h28
-rw-r--r--readline/undo.c6
-rw-r--r--readline/util.c24
-rw-r--r--readline/vi_keymap.c4
-rw-r--r--readline/vi_mode.c33
-rw-r--r--readline/xmalloc.c27
82 files changed, 3512 insertions, 4787 deletions
diff --git a/readline/CHANGELOG b/readline/CHANGELOG
index 9024bdf..479e6c0 100644
--- a/readline/CHANGELOG
+++ b/readline/CHANGELOG
@@ -214,126 +214,3 @@ Makefile.in,{doc,examples,shlib}/Makefile.in
- set SHELL from @MAKE_SHELL@
[readline-4.0 released]
-
- 3/11
- ----
-doc/Makefile.in
- - removed references to HTMLTOC, since separate HTML table-of-contents
- files are no longer created
-
-examples/Makefile.in
- - remove `*.exe' in clean target for MS-DOS
-
-Makefile.in
- - make `readline' target depend on ./libreadline.a
- - configure now substitutes TERMCAP_LIB into Makefile.in
- - use ${TERMCAP_LIB} instead of -ltermcap in recipe for `readline'
- - clean target now removes readline and readline.exe in case they
- get built
-
-configure.in
- - use `pwd.exe' to set BUILD_DIR on MS-DOS DJGPP
-
- 3/15
- ----
-support/shlib-install
- - Irix 5.x and Irix 6.x should install shared libraries like Solaris 2
- - changes for installing on hp-ux 1[01].x
-
- 3/23
- ----
-configure.in
- - make sure that the $CC argument to shobj-conf is quoted
-
- 4/8
- ---
-
-xmalloc.h, rlprivate.h, rlshell.h
- - new files
-
-Makefile.in,shlib/Makefile.in
- - add dependencies on xmalloc.h, rlshell.h
- - add xmalloc.h, rlprivate.h, rlshell.h to list of header files
-
-MANIFEST
- - add xmalloc.h, rlprivate.h, rlshell.h
-
- 4/9
- ---
-Makefile.in,shlib/Makefile.in
- - add dependencies on rlprivate.h
-
- 4/13
- ----
-doc/Makefile.in
- - add variable, PSDVI, which is the desired resolution of the
- generated postscript files. Set to 300 because I don't have
- any 600-dpi printers
- - set LANGUAGE= before calling makeinfo, so messages are in English
- - add rluserman.{info,dvi,ps,html} to appropriate variables
- - add rules to create rluserman.{info,dvi,ps,html}
- - install and uninstall rluserman.info, but don't update the directory
- file in $(infodir) yet
-
-MANIFEST
- - add doc/rluserman.{texinfo,info,dvi,ps,html}
-
- 4/30
- ----
-configure.in
- - updated library version to 4.1
-
- 5/3
- ---
-configure.in
- - SHLIB_MAJOR and SHLIB_MINOR shared library version numbers are
- constructed from $LIBRARY_VERSION and substituted into Makefiles
-
- 5/5
- ---
-support/shlib-install
- - OSF/1 installs shared libraries like Solaris
-
-Makefile.in
- - broke the header file install and uninstall into two new targets:
- install-headers and uninstall-headers
- - install and uninstall depend on install-headers and uninstall-headers
- respectively
- - changed install-shared and uninstall-shared targets to depend on
- install-headers and uninstall-headers, respectively, so users may
- choose to install only the shared libraries. I'm not sure about
- the uninstall one yet -- maybe it should check whether or not
- the static libraries are installed and not remove the header files
- if they are
-
- 9/3
- ---
-configure.in, config.h.in
- - added test for memmove (for later use)
- - changed version to 4.1-beta1
-
- 9/13
- ----
-examples/rlfe.c
- - Per Bothner's `rlfe' readline front-end program
-
-examples/Makefile.in
- - added rules to build rlfe
-
- 9/21
- ----
-support/shlib-install
- - changes to handle FreeBSD-3.x elf or a.out shared libraries, which
- have different semantics and need different naming conventions
-
- 1/24/2000
- ---------
-doc/Makefile.in
- - remove *.bt and *.bts on `make clean'
-
- 2/4
- ---
-
-
-configure.in
- - changed LIBVERSION to 4.1-beta5
diff --git a/readline/CHANGES b/readline/CHANGES
index d2929ab..65339c2 100644
--- a/readline/CHANGES
+++ b/readline/CHANGES
@@ -1,111 +1,3 @@
-This document details the changes between this version, readline-4.1,
-and the previous version, readline-4.0.
-
-1. Changes to Readline
-
-a. Changed the HTML documents so that the table-of-contents is no longer
- a separate file.
-
-b. Changes to the shared object configuration for: Irix 5.x, Irix 6.x,
- OSF/1.
-
-c. The shared library major and minor versions are now constructed
- automatically by configure and substituted into the makefiles.
-
-d. It's now possible to install the shared libraries separately from the
- static libraries.
-
-e. The history library tries to truncate the history file only if it is a
- regular file.
-
-f. A bug that caused _rl_dispatch to address negative array indices on
- systems with signed chars was fixed.
-
-g. rl-yank-nth-arg now leaves the history position the same as when it was
- called.
-
-h. Changes to the completion code to handle MS-DOS drive-letter:pathname
- filenames.
-
-i. Completion is now case-insensitive by default on MS-DOS.
-
-j. Fixes to the history file manipulation code for MS-DOS.
-
-k. Readline attempts to bind the arrow keys to appropriate defaults on MS-DOS.
-
-l. Some fixes were made to the redisplay code for better operation on MS-DOS.
-
-m. The quoted-insert code will now insert tty special chars like ^C.
-
-n. A bug was fixed that caused the display code to reference memory before
- the start of the prompt string.
-
-o. More support for __EMX__ (OS/2).
-
-p. A bug was fixed in readline's signal handling that could cause infinite
- recursion in signal handlers.
-
-q. A bug was fixed that caused the point to be less than zero when rl_forward
- was given a very large numeric argument.
-
-r. The vi-mode code now gets characters via the application-settable value
- of rl_getc_function rather than calling rl_getc directly.
-
-s. The history file code now uses O_BINARY mode when reading and writing
- the history file on cygwin32.
-
-t. Fixed a bug in the redisplay code for lines with more than 256 line
- breaks.
-
-u. A bug was fixed which caused invisible character markers to not be
- stripped from the prompt string if the terminal was in no-echo mode.
-
-v. Readline no longer tries to get the variables it needs for redisplay
- from the termcap entry if the calling application has specified its
- own redisplay function. Readline treats the terminal as `dumb' in
- this case.
-
-w. Fixes to the SIGWINCH code so that a multiple-line prompt with escape
- sequences is redrawn correctly.
-
-x. Changes to the install and install-shared targets so that the libraries
- and header files are installed separately.
-
-2. New Features in Readline
-
-a. A new Readline `user manual' is in doc/rluserman.texinfo.
-
-b. Parentheses matching is now always compiled into readline, and enabled
- or disabled when the value of the `blink-matching-paren' variable is
- changed.
-
-c. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
-
-d. MS-DOS systems now use ~/_history as the default history file.
-
-e. history-search-{forward,backward} now leave the point at the end of the
- line when the string to search for is empty, like
- {reverse,forward}-search-history.
-
-f. history-search-{forward,backward} now leave the last history line found
- in the readline buffer if the second or subsequent search fails.
-
-g. New function for use by applications: rl_on_new_line_with_prompt, used
- when an application displays the prompt itself before calling readline().
-
-h. New variable for use by applications: rl_already_prompted. An application
- that displays the prompt itself before calling readline() must set this to
- a non-zero value.
-
-i. A new variable, rl_gnu_readline_p, always 1. The intent is that an
- application can verify whether or not it is linked with the `real'
- readline library or some substitute.
-
-j. Per Bothner's `rlfe' (pronounced `Ralphie') readline front-end program
- is included in the examples subdirectory, though it is not built
- by default.
-
--------------------------------------------------------------------------------
This document details the changes between this version, readline-4.0,
and the previous version, readline-2.2.
diff --git a/readline/COPYING b/readline/COPYING
index 1bf1526..a43ea21 100644
--- a/readline/COPYING
+++ b/readline/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111 USA
+ 675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
diff --git a/readline/ChangeLog.Cygnus b/readline/ChangeLog.Cygnus
new file mode 100644
index 0000000..bc53a32
--- /dev/null
+++ b/readline/ChangeLog.Cygnus
@@ -0,0 +1,1050 @@
+2000-03-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * support/shobj-conf: Shared libs are unsupported on MSDOS.
+
+ * bind.c (_rl_read_file): Open files in binary mode. Strip CR
+ characters after reading the file.
+ (rl_re_read_init_file, rl_read_init_file): Allow for _inputrc on
+ DOS.
+
+ * complete.c (username_completion_function): Don't bypass getpw*
+ function calls for DJGPP.
+ (Filename_completion_function): Handle d:foo/bar file names.
+
+ * display.c (_rl_move_vert) [__GO32__]: fflush the stream, to make
+ sure cursor position is up to date.
+ (_rl_clear_screen) [__GO32__]: Clear screen and home the cursor.
+ (insert_some_characters, delete_characters) [__DJGPP__]: Don't use
+ memcpy.
+
+ * histfile.c (read_history_range, history_truncate_file)
+ (history_do_write) [__MSDOS__]: Allow for underscore instead of
+ the leading dot in file names.
+
+ * input.c: Don't use GO32-specific workarounds if HAVE_SELECT or
+ HAVE_TERMIOS_H are defined.
+
+ * readline.c: Don't disable signals if __DJGPP__ is defined.
+
+ * rltty.c: Don't disable signals and don't bypass termios code for
+ DJGPP (if HAVE_TERMIOS_H is defined).
+
+ * signals.c: Don't disable signals for DJGPP.
+
+ * terminal.c (_rl_get_screen_size) [__DJGPP__]: Initialize screen
+ dimensions.
+ (ding) [__DJGPP__]: Support visual bell.
+
+1999-08-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Philippe De Muyter <phdm@macqel.be>
+ * shell.c (stdio.h): File included, for definition of NULL.
+ * readline/rltty.c (get_tty_settings): Conditionalize
+ call to set_winsize on TIOGWINSZ.
+
+1999-07-30 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * Imported Readline 4.0. Integrated all the Cygnus
+ local changes since last import.
+
+ New files: rlstdc.h, savestring.c, shlib directory,
+ doc/manvers.texinfo, examples/rlversion.c,
+ support/install-shlib, support/shobj-conf.
+
+ Removed files: MANIFEST.doc, doc/inc-hist.texi.
+
+1999-07-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * acconfig.h: Fix typo: it's GWINSZ_IN_SYS_IOCTL, not
+ TIOCGWINSZ_IN_SYS_IOCTL.
+
+ * config.h.in: Regenerate with autoheader.
+
+1999-04-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * ChangeLog.Cygnus: new file. It is the old Changelog.
+ * ChangeLog: removed. It was conflicting with CHANGELOG
+ on Windows.
+
+1999-04-22 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in (install): Make comment about this change more explicit.
+
+1999-04-22 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in (install): Don't install the final libreadline.a
+ or .h files.
+
+Tue Mar 23 10:56:08 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ Patches from Robert Hoehne <robert.hoehne@gmx.net>:
+
+ * display.c: Change some terminal calls to work on DJGPP.
+ * terminal.c: Likewise.
+ * Makefile.in: Remove . from the VPATH directive.
+
+Tue Mar 9 14:58:13 1999 Geoffrey Noer <noer@cygnus.com>
+
+ * support/config.sub: Recognize cygwin*, not just cygwin32.
+
+Tue Feb 9 10:38:57 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * configure.in: Do not use the ./support directory.
+ * configure: Regenerate.
+
+Wed Jan 6 12:24:19 1999 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Use LOCAL_CFLAGS rather than CFLAGS for
+ searching libtermcap directory.
+ * configure: Regenerate.
+
+Thu Dec 31 12:07:01 1998 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Search devo libtermcap directory for termcap.h
+ when compiling for cygwin.
+ * configure: Regenerated.
+
+1998-12-30 Michael Meissner <meissner@cygnus.com>
+
+ * Makefile.in (install): Only try to copy libreadline.a and
+ libhistory.a if they exist.
+
+Tue Dec 29 23:49:20 1998 Christopher Faylor <cgf@cygnus.com>
+
+ * cross-build/cygwin.cache: Add a couple more known settings.
+ * configure.in: Fix typo.
+ * configure: Regenerated.
+
+Tue Dec 29 18:11:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * cross-build: new directory.
+
+ * cross-build/cygwin.cache: new file. Used for Cygwin cross builds.
+
+ * configure.in: added tests for cross-build for Cygwin.
+
+1998-12-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in: Add CYGNUS LOCAL comment.
+ * acconfig.h: Add missing defines.
+ * config.h.bot: Add missing content.
+ * configure, config.h.in: Regenerated.
+
+Wed Dec 23 16:21:41 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * Makefile.in: comment out the rule to rebuild configure by
+ running autoconf.
+
+Tue Dec 22 10:00:30 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * shell.c (savestring): ifdef'd it out.
+
+ * Imported new version of Readline 2.2.1. Removed all the Cygnus
+ local changes.
+
+ New files: acconfig.h, aclocal.m4, ansi_stdlib.h, callback.c,
+ config.h.in, configure, histexpand.c, histfile.c, histlib.h,
+ histsearch.c, input.c, kill.c, macro.c, nls.c, posixdir.h,
+ posixjmp.h, posixstat.h, rlconf.h, rltty.h, rlwinsize.h, shell.c,
+ tcap.h, terminal.c, undo.c, util.c, support directory.
+
+ Removed files: sysdep*, config directory.
+
+
+Fri Dec 4 15:25:41 1998 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by Jim Blandy
+ <jimb@zwingli.cygnus.com> and David Taylor
+ <taylor@texas.cygnus.com> as part of a project to merge in changes
+ made by HP; HP did not create ChangeLog entries.
+
+ * config/mp-enable-tui: New file.
+ (TUI_CFLAGS): Search devo's include directory, as long as we're
+ totally ruining modularity.
+ (INCLUDE_SRCDIR): New var.
+ (GDB_TUI_SRCDIR): Fix syntax error.
+
+ * configure.in: Check the --enable-tui flag; if it's set, include
+ a makefile fragment that #defines TUI and adds the needed #include
+ directories.
+ (*-*-hpux*): New host; use sysdep-hpux.h.
+
+ * Makefile.in (.c.o): Check the variable set in the makefile
+ fragment above.
+
+ * display.c (term_goto): declare it.
+ (insert_some_chars): set it.
+ (delete_chars): set it.
+
+ * readline.c: add tui include files surrounded by TUI.
+ (rl_reset): new function, move some of rl_abort functionality to
+ here.
+ (rl_abort): call rl_reset.
+ (rl_getc): tui changes.
+ (init_terminal_io): tui changes.
+
+ * readline.h (tui_version, fputc_unfiltered, fputs_unfiltered,
+ tui_tputs): declare if TUI is defined.
+
+ * rltty.c (prepare_terminal_settings): additional comment.
+
+ * signals.c: add tui include files surrounded by TUI. move #if
+ and #endif to column 1 so HP's compiler will accept them. Remove
+ declaration of tuiDoAndReturnToTop since it's declared in tui.h.
+ (rl_handle_sigwinch): call tuiDoAndReturnToTop if TUI defined.
+ (rl_handle_sigwinch_on_clear): define if TUI defined.
+ (rl_set_signals): if TUI, avoid infinite recursion.
+ (rl_clear_signals): install rl_handle_sigwinch_on_clear.
+
+ * sysdep-hpux.h: New file.
+
+Mon Nov 2 15:26:33 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: Check cygwin* instead of cygwin32*.
+
+Tue Jul 28 09:43:27 1998 Jeffrey A Law (law@cygnus.com)
+
+ * sysdep-hpux11.h: New file.
+ * configure.in (*-*-*-hpux11*): Use sysdep-hpux11.h.
+
+Thu Jul 23 17:48:21 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.bat: Remove obsolete file.
+ * examples/configure.bat: Remove obsolete file.
+
+Wed May 13 13:41:53 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * sysdep-6irix.h: New file.
+ * configure.in (*-*-irix6*): New host; use sysdep-6irix.h.
+
+ * Makefile.in (isearch.o, search.o): Depend upon sysdep.h.
+ (Makefile): Depend upon $(srcdir)/configure.in.
+
+Thu Apr 9 11:59:38 1998 Ian Dall (<Ian.Dall@dsto.defence.gov.au>
+
+ * configure.in (host==netbsd): Include config/mh-bsd44.
+ * config/mh-bsd44: New file.
+
+Wed Dec 3 16:48:20 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * rltty.c: fix typos.
+
+Tue Oct 8 08:59:24 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * tilde.c (tilde_word_expand): __MSDOS___ -> __MSDOS__
+
+Sat Oct 05 11:24:34 1996 Mark Alexander <marka@cygnus.com>
+
+ * rldefs.h: On Linux, include <termios.h> to fix compile error
+ in <termcap.h>.
+
+Wed Sep 4 18:06:51 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * rldefs.h: Enable HANDLE_SIGNALS for cygwin32.
+
+Thu Aug 29 16:59:45 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
+
+Fri Aug 16 17:49:57 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * complete.c: Include <pwd.h> if not DOS, and if cygwin32 or not
+ win32.
+ * configure.in: Add test for *-*-cygwin32* to use config/mh-posix.
+ * readline.c: Move decl of tgetstr to rldefs.h.
+ * (_rl_set_screen_size): Remove redundant ifdef MINIMALs.
+ * rldefs.h: Don't do MINIMAL for cygwin32. Cygwin32 now uses
+ full-blown readline, except for termcap.
+
+Sun Aug 11 21:06:26 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * rldefs.c: Get rid of define of SIGALRM if _WIN32 or __MSDOS__.
+ * Don't define ScreenCols/ScreenRows/... if cygwin32.
+ * sysdep-norm.h: Don't include <malloc.h> if cygwin32.
+
+Sun Aug 11 14:59:09 1996 Fred Fish <fnf@cygnus.com>
+
+ * rldefs.h: If __osf__is defined, include <termio.h> instead of
+ <sgtty.h>.
+
+Fri Aug 9 08:54:26 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * bind.c complete.c history.c readline.c: Don't include sys/file.h.
+ * complete.c display.c parens.c readline.c rldefs.h rltty.c
+ signals.c tilde.c: Change refs to _MSC_VER and __WIN32__ to _WIN32.
+ * signals.c (rl_signal_handler): Ifdef out kill if _WIN32.
+ * sysdep-norm.h: Ifdef out include of dirent.h if _WIN32.
+ Include malloc.h if _WIN32.
+
+Thu Jul 18 15:59:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * rldefs.h (sys/uio.h) Before sys/stream.h is included under AIX,
+ include sys/uio.h, which prevents an undefined structure used in a
+ prototype message from being generated.
+
+Tue Jun 25 23:05:55 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in (datadir): Set to $(prefix)/share.
+ (docdir): Removed.
+
+Sun May 26 15:14:42 1996 Fred Fish <fnf@cygnus.com>
+
+ From: David Mosberger-Tang <davidm@azstarnet.com>
+
+ * sysdep-linux.h: New file.
+ * display.c: Add include of "sysdep.h" to get HAVE_VARARGS_H.
+ * configure.in: Change pattern i[345]86-*-linux* into *-*-linux* to
+ support non-x86 based Linux platforms.
+
+Sun Apr 7 22:06:11 1996 Fred Fish <fnf@cygnus.com>
+
+ From: Miles Bader <miles@gnu.ai.mit.edu>
+ * config/mh-gnu: New file.
+ * configure.in (*-*-gnu*): New host.
+
+Sun Apr 7 13:21:51 1996 Fred Fish <fnf@cygnus.com>
+
+ From: Robert Lipe <robertl@dgii.com>
+ * configure.in: SCO OpenServer 5 (a.k.a 3.2v5*) is more like
+ SCO 3.2v4 than 3.2v2.
+
+Wed Jan 3 18:22:10 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * readline.c, display.c, complete.c: Add _MSC_VER to list of
+ things which can't do most things.
+
+Thu Nov 16 15:39:05 1995 Geoffrey Noer <noer@cygnus.com>
+
+ * complete.c: Change WIN32 to __WIN32__, added #else return NULL
+ to end of that define.
+
+Tue Oct 31 10:38:58 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * display.c, parens.c, readline.c, rldefs.h: Change use of
+ WIN32 to __WIN32__.
+
+Tue Oct 10 11:07:23 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (BISON): Remove macro.
+
+Tue Oct 10 08:49:00 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * complete.c (filename_completion_function): Enable for
+ win32 when not MSC.
+
+Sun Oct 8 04:17:19 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Handle powerpc-ibm-aix* like rs6000-ibm-aix*.
+
+Sat Oct 7 20:36:16 1995 Michael Meissner <meissner@cygnus.com>
+
+ * rltty.c (outchar): Return an int, like tputs expects.
+ * signals.c (_rl_output_character_function): Ditto.
+
+Fri Sep 29 15:19:23 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ Fixes for when the host WIN32, but not MSC.
+ * complete.c: Sometimes have pwd.h
+ * parens.c: WIN32 has similar restrictions to __GO32__.
+ * readline.c (__GO32__): Some of this moved into rldefs.h
+ * signals.c (__GO32__): Likewise.
+ * rldefs.h (MSDOS||WIN32) becomes MSDOS||MSC.
+ (WIN32&&!WIN32): New definitions.
+
+Wed Sep 20 12:57:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (maintainer-clean): New synonym for realclean.
+
+Wed Mar 1 13:33:43 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * rltty.c (outchar): Provide prototype for outchar, to silence
+ type warnings in passing outchar to tputs on systems like Linux
+ that have full prototypes.
+
+ * signals.c (_rl_output_character_function): Provide prototype to
+ silence type warnings.
+
+Sun Jan 15 14:10:37 1995 Steve Chamberlain <sac@splat>
+
+ * rldefs.h: Define MINIMAL for __GO32__ and WIN32.
+ * complete.c, display.c, readline.c, rltty.c: Test MINIMAL
+ instead of __GO32__.
+
+Wed Aug 24 13:04:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure.in: Change i[34]86 to i[345]86.
+
+Sat Jul 16 13:26:31 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * configure.in (m88*-harris-cxux7*): Recognize.
+ * sysdep-cxux7.h: New file.
+
+Fri Jul 8 13:18:33 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * rttty.c (control_meta_key_on): Remove superfluous testing of
+ __GO32__.
+
+Thu Jun 30 15:21:54 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * rltty.c (control_meta_key_on): Don't compile if __GO32__ is
+ defined.
+ (rltty_set_default_bindings): Likewise.
+ * display.c (insert_some_chars, delete_chars): row_start should be
+ a short.
+ * parens.c (rl_insert_close): No FD_SET if using __GO32__.
+ * readline.c (rl_gather_tyi): Strip off spurious high bits.
+
+Sun Jun 12 03:51:52 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * history.c: Swap inclusion of rldefs.h and chardefs.h to avoid
+ CTRL macro redefinition.
+
+Mon May 9 18:29:42 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * readline.c (readline_default_bindings): Don't compile if
+ __GO32__ is defined.
+ (_rl_set_screen_size): Likewise.
+ * rltty.c (rltty_set_default_bindings): Likewise.
+ (control_meta_key): Likewise.
+ * display.c: If __GO32__ is defined, include <sys/pc.h>.
+ * parens.c: If __GO32__ is defined, undefine FD_SET.
+ * signals.c: Include SIGWINCH handling in the set of things which
+ is not done if HANDLE_SIGNALS is not set.
+
+Fri May 6 13:38:39 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * config/mh-go32: New fragment.
+ * configure.in (host==go32): Use go32 fragment.
+
+Wed May 4 14:36:53 1994 Stu Grossman (grossman@cygnus.com)
+
+ * chardefs.h, rldefs.h: Move decls of string funcs from chardefs.h
+ to rldefs.h so that they don't pollute apps that include
+ readline.h.
+ * history.c: include rldefs.h to get decls of string funcs.
+
+Wed May 4 12:15:11 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * configure.in (rs6000-bull-bosx*): New configuration, RS/6000
+ variant.
+
+Wed Apr 20 10:43:52 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Use mh-posix for sunos4.1*.
+
+Wed Apr 13 21:28:44 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * rltty.c (set_tty_settings): Don't set readline_echoing_p.
+ (rl_deprep_terminal) [NEW_TTY_DRIVER]: Set readline_echoing_p.
+
+Sun Mar 13 09:13:12 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Add TAGS target.
+
+Wed Mar 9 18:01:31 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * isearch.c, search.c: Include sysdep.h.
+
+Thu Mar 3 17:40:03 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * configure.in: For ISC, use mh-sysv, not mh-isc.
+
+Thu Feb 24 04:13:53 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * Merge in changes from bash-1.13.5. Merge changes from glob/tilde.c
+ into tilde.c and use it. Add system function declarations where
+ necessary. Check for __GO32__, not _GO32_ consistently.
+ * Makefile.in: Update dependencies.
+ * rltty.c: Include <sys/file.h> to match include file setup
+ in readline.c for rldefs.h. Otherwise we get inconsistent
+ TTY_DRIVER definitions in readline.c and rltty.c.
+ * bind.c, complete.c: Do not include <sys/types.h>, it is already
+ included via sysdep.h, which causes problems if <sys/types.h> has
+ no multiple inclusion protection.
+ * readline.c (_rl_set_screen_size): Reestablish test for
+ TIOCGWINSZ_BROKEN.
+ * rldefs.h: Define S_ISREG if necessary.
+
+Fri Feb 18 08:56:35 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Add search.o rule for Sun make.
+
+Wed Feb 16 16:35:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * rltty.c: #if out some code if __GO32__.
+
+Tue Feb 15 14:07:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * readline.c (_rl_output_character_function), display.c:
+ Return int, not void, to conform with the expected arg of tputs.
+ * readline.c (init_terminal_io): tgetflag only takes 1 arg.
+ * readline.c (_rl_savestring): New function.
+ * chardefs.h: To avoid conflicts and/or warnings, define
+ savestring as a macro wrapper for _rl_savestring.
+ * display.c (extern term_xn): It's an int flag, not a string.
+ * charsdefs.h, rldefs.h: Remove HAVE_STRING_H-related junk.
+
+Sat Feb 5 08:32:30 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Remove obsolete rules for history.info and
+ readline.info.
+
+Thu Jan 27 17:04:01 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * chardefs.h: Only declare strrchr if it is not #define'd.
+
+Tue Jan 25 11:30:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * rldefs.h: Accept __hpux as well as hpux for HP compiler in ANSI mode.
+
+Fri Jan 21 17:31:26 1994 Jim Kingdon (kingdon@lisa.cygnus.com)
+
+ * chardefs.h, tilde.c: Just declare strrchr rather than trying to
+ include a system header.
+
+Fri Jan 21 14:40:43 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (distclean, realclean): Expand local-distclean
+ inline after doing recursion. You can't recurse after removing
+ Makefile. Make them depend on local-clean.
+ * Makefile.in (local-distclean): Remove now superfluous target.
+
+Mon Jan 17 12:42:07 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * readline.c (doing_an_undo): Delete second declaration, since it
+ confuses the alpha-osf1 native compiler.
+
+Sun Jan 16 12:33:11 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * complete.c, bind.c: Include <sys/stat.h>.
+ * complete.c: Define X_OK if not defined by a system header.
+
+ * chardefs.h: Don't declare xmalloc.
+
+ * keymaps.h: Include "chardefs.h" not <readline/chardefs.h>.
+
+ * Makefile.in (clean mostlyclean distclean realclean): Recurse
+ into subdirectories as well as doing this directory. Add clean-dvi
+ target.
+
+Sat Jan 15 19:36:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * readline.c, display.c: Patches to allow use of all 80
+ columns on most terminals (those with am and xn).
+
+ Merge in changes from bash-1.13. The most obvious one is
+ that the file readline.c has been split into multiple files.
+ * bind.c, complete.c, dispay.c, isearch.c, parens.c, rldefs.h,
+ rltty.c, search.c signals.c, tilde.c, tilde.h, xmalloc.c: New files.
+
+Sat Dec 11 16:29:17 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * readline.c (rl_getc): If GO32, trim high bit from getkey,
+ otherwise fancy PC keys cause grief.
+
+Fri Nov 5 11:49:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Add doc to configdirs.
+ * Makefile.in (info dvi install-info clean-info): Recurse into doc.
+
+Fri Oct 22 07:55:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Add * to end of all OS names.
+
+Tue Oct 5 12:33:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * readline.c: Add stuff for HIUX to place where we detect termio
+ vs. sgtty (ugh, but I don't see a simple better way).
+
+Wed Sep 29 11:02:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * readline.c (parser_if): Free tname when done with it (change
+ imported from from bash 1.12 readline).
+
+Tue Sep 7 17:15:37 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in (m88k-*-sysvr4*): Comment out previous change.
+
+Fri Jul 2 11:05:34 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (*-*-riscos*): New entry; use mh-sysv.
+
+Wed Jun 23 13:00:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Add comment.
+
+Mon Jun 14 14:28:55 1993 Jim Kingdon (kingdon@eric)
+
+ * configure.in (m88k-*-sysvr4*): Use sysdep-norm.h.
+
+Sun Jun 13 13:04:09 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in ({real,dist}clean): Remove sysdep.h.
+
+Thu Jun 10 11:22:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in: Add mostlyclean, distclean, and realclean targets.
+
+Fri May 21 17:09:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mh-isc: New file.
+ * configure.in: Use it.
+
+Sat Apr 17 00:40:12 1993 Jim Kingdon (kingdon at calvin)
+
+ * readline.c, history.c: Don't include sys/types.h; sysdep.h does.
+
+ * config/mh-sysv: Define TIOCGWINSZ_BROKEN.
+ readline.c: Check it.
+
+Wed Mar 24 02:06:15 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
+
+ * Makefile.in: add installcheck & dvi targets
+
+Fri Mar 12 18:36:53 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: recognize *-*-solaris2* instead of *-*-solaris* (a
+ number of people want to call SunOS 4.1.2 "solaris1.0"
+ and get it right)
+
+Tue Mar 2 21:25:36 1993 Fred Fish (fnf@cygnus.com)
+
+ * sysdep-sysv4.h: New file for SVR4.
+ * configure.in (*-*-sysv4*): Use sysdep-sysv4.h.
+
+ * configure.in (*-*-ultrix2): Add triplet from Michael Rendell
+ (michael@mercury.cs.mun.ca)
+
+Tue Dec 15 12:38:16 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (i[34]86-*-sco3.2v4*): use mh-sco4.
+ * config/mh-sco4: New file, like mh-sco but without defining
+ _POSIX_SOURCE.
+
+Wed Nov 11 21:20:14 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in: Reformat to one-case-per-line.
+ Handle SunOS 3.5, as per Karl Berry, <karl@claude.cs.umb.edu>.
+
+Wed Nov 4 15:32:31 1992 Stu Grossman (grossman at cygnus.com)
+
+ * sysdep-norm.h: Remove some crud, install dire warning.
+
+Thu Oct 22 01:08:13 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Make SCO work again...
+
+Mon Oct 12 15:04:07 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * readline.c (init_terminal_io): if tgetent returns 0, the
+ terminal type is unknown.
+
+Thu Oct 1 23:44:14 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: use cpu-vendor-os triple instead of nested cases
+
+Wed Sep 30 12:58:57 1992 Stu Grossman (grossman at cygnus.com)
+
+ * readline.c (rl_complete_internal): Cast alloca to (char *) to
+ avoid warning.
+
+Fri Sep 25 12:45:05 1992 Stu Grossman (grossman at cygnus.com)
+
+ * readline.c (clear_to_eol, rl_generic_bind): Make static.
+ (rl_digit_loop): Add arg to call to rl_message().
+ * vi_mode.c (rl_vi_first_print): Add arg to call to
+ rl_back_to_indent().
+
+Wed Aug 19 14:59:07 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: always create installation directories, use full
+ file name for install target.
+
+Wed Aug 12 15:50:57 1992 John Gilmore (gnu@cygnus.com)
+
+ * readline.c (last_readline_init_file): Fix typo made by Steve
+ Chamberlain/DJ Delorie. Proper control file name is ~/.inputrc,
+ not ~/inputrc.
+
+Thu Jun 25 16:15:27 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Make bsd based systems use sysdep-obsd.h.
+
+Tue Jun 23 23:22:53 1992 Per Bothner (bothner@cygnus.com)
+
+ * config/mh-posix: New file, for Posix-compliant systems.
+ * configure.in: Use mh-posix for Linux (free Unix clone).
+
+Tue Jun 23 21:59:20 1992 Fred Fish (fnf@cygnus.com)
+
+ * sysdep-norm.h (alloca): Protect against previous definition as
+ a macro with arguments.
+
+Fri Jun 19 15:48:54 1992 Stu Grossman (grossman at cygnus.com)
+
+ * sysdep-obsd.h: #include <sys/types.h> to make this more Kosher.
+
+Fri Jun 19 12:53:28 1992 John Gilmore (gnu at cygnus.com)
+
+ * config/mh-apollo68v, mh-sco, mh-sysv, mh-sysv4}: RANLIB=true.
+
+Mon Jun 15 13:50:34 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: use mh-sysv4 on solaris2
+
+Mon Jun 15 12:28:24 1992 Fred Fish (fnf@cygnus.com)
+
+ * config/mh-ncr3000 (INSTALL): Don't use /usr/ucb/install,
+ it is broken on ncr 3000's.
+ * config/mh-ncr3000 (RANLIB): Use RANLIB=true.
+
+Mon Jun 15 01:35:55 1992 John Gilmore (gnu at cygnus.com)
+
+ * readline.c: Make new SIGNALS_* macros to parameterize the
+ ugly changes in signal blocking. Use them throughout,
+ reducing #ifdef HAVE_POSIX_SIGNALS and HAVE_BSD_SIGNALS clutter
+ significantly. Make all such places use POSIX if available,
+ to avoid losing with poor `sigsetmask' emulation from libiberty.
+
+Sun Jun 14 15:19:51 1992 Stu Grossman (grossman at cygnus.com)
+
+ * readline.c (insert_some_chars): Return void.
+
+Thu Jun 11 01:27:45 1992 John Gilmore (gnu at cygnus.com)
+
+ * readline.c: #undef PC, which Solaris2 defines in sys/types.h,
+ clobbering the termcap global variable PC.
+
+Tue Jun 9 17:30:23 1992 Fred Fish (fnf@cygnus.com)
+
+ * config/{mh-ncr3000, mh-sysv4}: Change INSTALL to use
+ /usr/ucb/install.
+
+Mon Jun 8 23:10:07 1992 Fred Fish (fnf@cygnus.com)
+
+ * readline.h (rl_completer_quote_characters): Add declaration.
+ * readline.c (rl_completer_quote_characters): Add global var.
+ * readline.c (strpbrk): Add prototype and function.
+ * readline.c (rl_complete_internal): Add code to handle
+ expansion of quoted strings.
+
+Mon May 11 12:39:30 1992 John Gilmore (gnu at cygnus.com)
+
+ * readline.c: Can't initialize FILE *'s with stdin and stdout,
+ because they might not be constant. Patch from Tom Quinn,
+ trq@dinoysos.thphys.ox.ac.uk.
+
+Tue Apr 28 21:52:34 1992 John Gilmore (gnu at cygnus.com)
+
+ * readline.h: Declare rl_event_hook (which already existed).
+ Suggested by Christoph Tietz <tietz@zi.gmd.dbp.de>.
+
+Wed Apr 22 18:08:01 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * configure.in: remove subdirs declaration. The obsolete semantic
+ for subdirs has been usurped by per's new meaning.
+
+Tue Apr 21 11:54:23 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: rework CFLAGS so that they can be set on the
+ command line to make. Remove MINUS_G. Default CFLAGS to -g.
+
+Fri Apr 10 23:02:27 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Recognize new ncr3000 config.
+ * config/mh-ncr3000: New NCR 3000 config file.
+
+Wed Mar 25 10:46:30 1992 John Gilmore (gnu at cygnus.com)
+
+ * history.c (stifle_history): Negative arg treated as zero.
+
+Tue Mar 24 23:46:20 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * config/mh-sysv: INSTALL_PROG -> INSTALL.
+
+Mon Feb 10 01:41:35 1992 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * history.c (history_do_write) Build a buffer of all of the lines
+ to write and write them in one fell swoop (lower overhead than
+ calling write () for each line). Suggested by Peter Ho.
+
+ * vi_mode.c (rl_vi_subst) Don't forget to end the undo group.
+
+Sat Mar 7 00:15:36 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: remove FIXME's on info and install-info targets.
+
+Fri Mar 6 22:02:04 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: added check target.
+
+Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in, configure.in: removed traces of namesubdir,
+ -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
+ copyrights to '92, changed some from Cygnus to FSF.
+
+Fri Feb 21 14:37:32 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * readline.c, examples/fileman.c: patches from DJ to support DOS
+
+Thu Feb 20 23:23:16 1992 Stu Grossman (grossman at cygnus.com)
+
+ * readline.c (rl_read_init_file): Make sure that null filename is
+ not passed to open() or else we end up opening the directory, and
+ read a bunch of garbage into keymap[].
+
+Mon Feb 17 17:15:09 1992 Fred Fish (fnf at cygnus.com)
+
+ * readline.c (readline_default_bindings): Only make use of VLNEXT
+ when both VLNEXT and TERMIOS_TTY_DRIVER is defined. On SVR4
+ <termio.h> includes <termios.h>, so VLNEXT is always defined.
+
+ * sysdep-norm.h (_POSIX_VERSION): Define this for all SVR4
+ systems so that <termios.h> gets used, instead of <termio.h>.
+
+Fri Dec 20 12:04:31 1991 Fred Fish (fnf at cygnus.com)
+
+ * configure.in: Change svr4 references to sysv4.
+
+Tue Dec 10 04:07:20 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: infodir belongs in datadir.
+
+Fri Dec 6 23:23:14 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: remove spaces following hyphens, bsd make can't
+ cope. added clean-info. added standards.text support. Don't
+ know how to make info anymore.
+
+ * configure.in: commontargets is no longer a recognized hook, so
+ remove it. new subdir called doc.
+
+Thu Dec 5 22:46:10 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: idestdir and ddestdir go away. Added copyrights
+ and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
+ and mandir now keyed off datadir by default.
+
+Fri Nov 22 09:02:32 1991 John Gilmore (gnu at cygnus.com)
+
+ * sysdep-obsd.h: Rename from sysdep-newsos.h.
+ * configure.in: Use sysdep-obsd for Mach as well as NEWs.
+
+ * sysdep-norm.h, sysdep-aix.h: Add <sys/types.h>, which POSIX
+ requires to make <dirent.h> work. Improve Sun alloca decl.
+
+Thu Nov 21 18:48:08 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Clean up ../glob/tilde.c -> tilde.o path.
+ Clean up makefile a bit in general.
+
+Thu Nov 21 14:40:29 1991 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in, config/mh-svr4: Make SVR4 work.
+
+ * readline.c: Move config stuff to sysdep.h, use typedef dirent
+ consistently, remove refs to d_namlen (& D_NAMLEN) to improve
+ portability. Also, update copyright notice.
+ readline.h: remove config stuff that I added erroneously in the
+ first place.
+
+ * emacs_keymap.c, funmap.c, history.c, keymaps.c, vi_keymap.c,
+ vi_mode.c: move config stuff to sysdep.h, update copyright notices.
+
+Tue Nov 19 15:02:13 1991 Stu Grossman (grossman at cygnus.com)
+
+ * history.c: #include "sysdep.h".
+
+Tue Nov 19 10:49:17 1991 Fred Fish (fnf at cygnus.com)
+
+ * Makefile.in, config/hm-sysv, config/hm-sco: Change SYSV to
+ USG to match current usage.
+
+ * readline.c: Add USGr4 to list of defined things to check for
+ to use <dirent.h> style directory access.
+
+ * config/hm-svr4: New file for System V Release 4 (USGr4).
+
+Mon Nov 18 23:59:52 1991 Stu Grossman (grossman at cygnus.com)
+
+ * readline.c (filename_completion_function): use struct dirent
+ instead of struct direct.
+
+Fri Nov 1 07:02:13 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c (rl_translate_keyseq) Make C-? translate to RUBOUT
+ unconditionally.
+
+Mon Oct 28 11:34:52 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c; Use Posix directory routines and macros.
+
+ * funmap.c; Add entry for call-last-kbd-macro.
+
+ * readline.c (rl_prep_term); Use system EOF character on POSIX
+ systems also.
+
+Thu Oct 3 16:19:53 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c; Make a distinction between having a TERMIOS tty
+ driver, and having POSIX signal handling. You might one without
+ the other. New defines used HAVE_POSIX_SIGNALS, and
+ TERMIOS_TTY_DRIVER.
+
+Tue Jul 30 22:37:26 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: rl_getc () If a call to read () returns without an
+ error, but with zero characters, the file is empty, so return EOF.
+
+Thu Jul 11 20:58:38 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: (rl_get_next_history, rl_get_previous_history)
+ Reallocate the buffer space if the line being moved to is longer
+ the the current space allocated. Amazing that no one has found
+ this bug until now.
+
+Sun Jul 7 02:37:05 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c:(rl_parse_and_bind) Allow leading whitespace.
+ Make sure TERMIO and TERMIOS systems treat CR and NL
+ disctinctly.
+
+Tue Jun 25 04:09:27 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: Rework parsing conditionals to pay attention to the
+ prior states of the conditional stack. This makes $if statements
+ work correctly.
+
+Mon Jun 24 20:45:59 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: support for displaying key binding information
+ includes the functions rl_list_funmap_names (),
+ invoking_keyseqs_in_map (), rl_invoking_keyseqs (),
+ rl_dump_functions (), and rl_function_dumper ().
+
+ funmap.c: support for same includes rl_funmap_names ().
+
+ readline.c, funmap.c: no longer define STATIC_MALLOC. However,
+ update both version of xrealloc () to handle a null pointer.
+
+Thu Apr 25 12:03:49 1991 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * vi_mode.c (rl_vi_fword, fWord, etc. All functions use
+ the macro `isident()'. Fixed movement bug which prevents
+ continious movement through the text.
+
+Fri Jul 27 16:47:01 1990 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c (parser_if) Allow "$if term=foo" construct.
+
+Wed May 23 16:10:33 1990 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c (rl_dispatch) Correctly remember the last command
+ executed. Fixed typo in username_completion_function ().
+
+Mon Apr 9 19:55:48 1990 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: username_completion_function (); For text passed in
+ with a leading `~', remember that this could be a filename (after
+ it is completed).
+
+Thu Apr 5 13:44:24 1990 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: rl_search_history (): Correctly handle case of an
+ unfound search string, but a graceful exit (as with ESC).
+
+ * readline.c: rl_restart_output (); The Apollo passes the address
+ of the file descriptor to TIOCSTART, not the descriptor itself.
+
+Tue Mar 20 05:38:55 1990 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * readline.c: rl_complete (); second call in a row causes possible
+ completions to be listed.
+
+ * readline.c: rl_redisplay (), added prompt_this_line variable
+ which is the first character character following \n in prompt.
+
+Sun Mar 11 04:32:03 1990 Brian Fox (bfox at gnuwest.fsf.org)
+
+ * Signals are now supposedly handled inside of SYSV compilation.
+
+Wed Jan 17 19:24:09 1990 Brian Fox (bfox at sbphy.ucsb.edu)
+
+ * history.c: history_expand (); fixed overwriting memory error,
+ added needed argument to call to get_history_event ().
+
+Thu Jan 11 10:54:04 1990 Brian Fox (bfox at sbphy.ucsb.edu)
+
+ * readline.c: added mark_modified_lines to control the
+ display of an asterisk on modified history lines. Also
+ added a user variable called mark-modified-lines to the
+ `set' command.
+
+Thu Jan 4 10:38:05 1990 Brian Fox (bfox at sbphy.ucsb.edu)
+
+ * readline.c: start_insert (). Only use IC if we don't have an im
+ capability.
+
+Fri Sep 8 09:00:45 1989 Brian Fox (bfox at aurel)
+
+ * readline.c: rl_prep_terminal (). Only turn on 8th bit
+ as meta-bit iff the terminal is not using parity.
+
+Sun Sep 3 08:57:40 1989 Brian Fox (bfox at aurel)
+
+ * readline.c: start_insert (). Uses multiple
+ insertion call in cases where that makes sense.
+
+ rl_insert (). Read type-ahead buffer for additional
+ keys that are bound to rl_insert, and insert them
+ all at once. Make insertion of single keys given
+ with an argument much more efficient.
+
+Tue Aug 8 18:13:57 1989 Brian Fox (bfox at aurel)
+
+ * readline.c: Changed handling of EOF. readline () returns
+ (char *)EOF or consed string. The EOF character is read from the
+ tty, or if the tty doesn't have one, defaults to C-d.
+
+ * readline.c: Added support for event driven programs.
+ rl_event_hook is the address of a function you want called
+ while Readline is waiting for input.
+
+ * readline.c: Cleanup time. Functions without type declarations
+ do not use return with a value.
+
+ * history.c: history_expand () has new variable which is the
+ characters to ignore immediately following history_expansion_char.
+
+Sun Jul 16 08:14:00 1989 Brian Fox (bfox at aurel)
+
+ * rl_prep_terminal ()
+ BSD version turns off C-s, C-q, C-y, C-v.
+
+ * readline.c -- rl_prep_terminal ()
+ SYSV version hacks readline_echoing_p.
+ BSD version turns on passing of the 8th bit for the duration
+ of reading the line.
+
+Tue Jul 11 06:25:01 1989 Brian Fox (bfox at aurel)
+
+ * readline.c: new variable rl_tilde_expander.
+ If non-null, this contains the address of a function to call if
+ the standard meaning for expanding a tilde fails. The function is
+ called with the text sans tilde (as in "foo"), and returns a
+ malloc()'ed string which is the expansion, or a NULL pointer if
+ there is no expansion.
+
+ * readline.h - new file chardefs.h
+ Separates things that only readline.c needs from the standard
+ header file publishing interesting things about readline.
+
+ * readline.c:
+ readline_default_bindings () now looks at terminal chararacters
+ and binds those as well.
+
+Wed Jun 28 20:20:51 1989 Brian Fox (bfox at aurel)
+
+ * Made readline and history into independent libraries.
+
diff --git a/readline/MANIFEST b/readline/MANIFEST
index a51ca05..f23ff41 100644
--- a/readline/MANIFEST
+++ b/readline/MANIFEST
@@ -11,8 +11,8 @@ MANIFEST f
INSTALL f
CHANGELOG f
CHANGES f
-USAGE f
aclocal.m4 f
+acconfig.h f
config.h.in f
configure f
configure.in f
@@ -28,14 +28,11 @@ posixstat.h f
readline.h f
rlconf.h f
rldefs.h f
-rlprivate.h f
-rlshell.h f
rlstdc.h f
rltty.h f
rlwinsize.h f
tcap.h f
tilde.h f
-xmalloc.h f
bind.c f
complete.c f
display.c f
@@ -80,7 +77,6 @@ doc/manvers.texinfo f
doc/rlman.texinfo f
doc/rltech.texinfo f
doc/rluser.texinfo f
-doc/rluserman.texinfo f
doc/hist.texinfo f
doc/hstech.texinfo f
doc/hsuser.texinfo f
@@ -88,10 +84,8 @@ doc/readline.3 f
doc/texi2dvi f
doc/texi2html f
examples/Makefile.in f
-examples/excallback.c f
examples/fileman.c f
examples/manexamp.c f
-examples/rlfe.c f
examples/rltest.c f
examples/rl.c f
examples/rlversion.c f
@@ -100,14 +94,10 @@ examples/Inputrc f
# formatted documentation, from MANIFEST.doc
doc/readline.ps f
doc/history.ps f
-doc/rluserman.ps f
doc/readline.dvi f
doc/history.dvi f
-doc/rluserman.dvi f
doc/readline.info f
doc/history.info f
-doc/rluserman.info f
doc/readline.html f
doc/history.html f
-doc/rluserman.html f
doc/readline.0 f
diff --git a/readline/Makefile.in b/readline/Makefile.in
index 023496d..5c667ed 100644
--- a/readline/Makefile.in
+++ b/readline/Makefile.in
@@ -1,6 +1,6 @@
## -*- text -*- ##
# Master Makefile for the GNU readline library.
-# Copyright (C) 1994 Free Software Foundation, Inc.
+# Copyright (C) 1994, 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
@@ -14,12 +14,12 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
RL_LIBRARY_VERSION = @LIBVERSION@
RL_LIBRARY_NAME = readline
srcdir = @srcdir@
-VPATH = .:@srcdir@
+VPATH = @srcdir@
top_srcdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
@@ -60,8 +60,6 @@ CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
-TERMCAP_LIB = @TERMCAP_LIB@
-
# For libraries which include headers from other libraries.
INCLUDES = -I. -I$(srcdir) -I$(includedir)
@@ -90,7 +88,7 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
- ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h
+ ansi_stdlib.h tcap.h rlstdc.h
HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
TILDEOBJ = tilde.o
@@ -117,8 +115,6 @@ INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
all: static
-everything: static shared examples
-
static: $(STATIC_LIBS)
libreadline.a: $(OBJECTS)
@@ -131,8 +127,8 @@ libhistory.a: $(HISTOBJ) xmalloc.o
$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
-test -n "$(RANLIB)" && $(RANLIB) $@
-readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
- $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
+readline: $(OBJECTS) readline.h rldefs.h chardefs.h
+ $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
Makefile makefile: config.status $(srcdir)/Makefile.in
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
@@ -151,9 +147,9 @@ stamp-h: config.status $(srcdir)/config.h.in
CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
echo > $@
-#$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
-# cd $(srcdir) && autoconf ## Comment-me-out in distribution
-
+# CYGNUS LOCAL: Never run autoconf.
+#$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
+# cd $(srcdir) && autoconf Comment-me-out in distribution
shared: force
-test -d shlib || mkdir shlib
@@ -169,41 +165,45 @@ examples: force
force:
-install-headers: installdirs ${INSTALLED_HEADERS}
- for f in ${INSTALLED_HEADERS}; do \
- $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
- done
-
-uninstall-headers:
- -test -n "$(includedir)" && cd $(includedir)/readline && \
- ${RM} ${INSTALLED_HEADERS}
-
-maybe-uninstall-headers: uninstall-headers
-
-install: installdirs $(STATIC_LIBS) install-headers
- -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
- $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
- -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
- -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
- $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
- -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
- -( if test -d doc ; then \
- cd doc && \
- ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
- fi )
+## CYGNUS LOCAL
+## Don't mess with people's installed readline's.
+## This tries to install this version of readline over whatever
+## version is already installed on the system (which could be a
+## newer version). There is no real reason for us to install
+## readline along with GDB. GDB links statically against readline,
+## so it doesn't depend on us installing it on the system.
+
+install:
+
+#install: installdirs $(STATIC_LIBS)
+# for f in ${INSTALLED_HEADERS}; do \
+# $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
+# done
+# -( if test -f $(libdir)/libreadline.a ; then $(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old; fi )
+# $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
+# -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
+# -( if test -f $(libdir)/libhistory.a; then $(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old; fi )
+# $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
+# -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
+# -( if test -d doc ; then \
+# cd doc && \
+# ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
+# fi )
installdirs: $(srcdir)/support/mkdirs
-$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
$(includedir)/readline $(libdir) $(infodir) $(man3dir)
-uninstall: uninstall-headers
+uninstall:
+ -test -n "$(includedir)" && cd $(includedir)/readline && \
+ ${RM} ${INSTALLED_HEADERS}
-test -n "$(libdir)" && cd $(libdir) && \
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
-install-shared: installdirs install-headers shared
+install-shared: installdirs shared
-( cd shlib ; ${MAKE} ${MFLAGS} install )
-uninstall-shared: maybe-uninstall-headers
+uninstall-shared:
-( cd shlib; ${MAKE} ${MFLAGS} uninstall )
TAGS: force
@@ -214,7 +214,6 @@ tags: force
clean: force
$(RM) $(OBJECTS) $(STATIC_LIBS)
- $(RM) readline readline.exe
-( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
@@ -242,7 +241,7 @@ installcheck:
dist: force
@echo Readline distributions are created using $(srcdir)/support/mkdist.
@echo Here is a sample of the necessary commands:
- @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
+ @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION)
@echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
@echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
@@ -301,8 +300,6 @@ macro.o: readline.h keymaps.h chardefs.h tilde.h
macro.o: history.h rlstdc.h
nls.o: ansi_stdlib.h
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-nls.o: readline.h keymaps.h chardefs.h tilde.h
-nls.o: history.h rlstdc.h
parens.o: rlconf.h
parens.o: ${BUILD_DIR}/config.h
parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
@@ -341,54 +338,6 @@ vi_mode.o: history.h ansi_stdlib.h rlstdc.h
xmalloc.o: ${BUILD_DIR}/config.h
xmalloc.o: ansi_stdlib.h
-bind.o: rlshell.h
-histfile.o: rlshell.h
-nls.o: rlshell.h
-readline.o: rlshell.h
-shell.o: rlshell.h
-terminal.o: rlshell.h
-histexpand.o: rlshell.h
-
-bind.o: rlprivate.h
-callback.o: rlprivate.h
-complete.o: rlprivate.h
-display.o: rlprivate.h
-input.o: rlprivate.h
-isearch.o: rlprivate.h
-kill.o: rlprivate.h
-macro.o: rlprivate.h
-nls.o: rlprivate.h
-parens.o: rlprivate.h
-readline.o: rlprivate.h
-rltty.o: rlprivate.h
-search.o: rlprivate.h
-signals.o: rlprivate.h
-terminal.o: rlprivate.h
-undo.o: rlprivate.h
-util.o: rlprivate.h
-vi_mode.o: rlprivate.h
-
-bind.o: xmalloc.h
-complete.o: xmalloc.h
-display.o: xmalloc.h
-funmap.o: xmalloc.h
-histexpand.o: xmalloc.h
-histfile.o: xmalloc.h
-history.o: xmalloc.h
-input.o: xmalloc.h
-isearch.o: xmalloc.h
-keymaps.o: xmalloc.h
-kill.o: xmalloc.h
-macro.o: xmalloc.h
-readline.o: xmalloc.h
-savestring.o: xmalloc.h
-search.o: xmalloc.h
-shell.o: xmalloc.h
-tilde.o: xmalloc.h
-tilde.o: xmalloc.h
-util.o: xmalloc.h
-vi_mode.o: xmalloc.h
-
readline.o: $(srcdir)/readline.c
vi_mode.o: $(srcdir)/vi_mode.c
funmap.o: $(srcdir)/funmap.c
diff --git a/readline/README b/readline/README
index 41a5d0c..56565b2 100644
--- a/readline/README
+++ b/readline/README
@@ -1,7 +1,7 @@
Introduction
============
-This is the Gnu Readline library, version 4.1.
+This is the Gnu Readline library, version 4.0.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
diff --git a/readline/acconfig.h b/readline/acconfig.h
index 4f42238..577cf9c 100644
--- a/readline/acconfig.h
+++ b/readline/acconfig.h
@@ -17,12 +17,38 @@
/* Definitions pulled in from aclocal.m4. */
#undef VOID_SIGHANDLER
-#undef TIOCGWINSZ_IN_SYS_IOCTL
+#undef GWINSZ_IN_SYS_IOCTL
#undef TIOCSTAT_IN_SYS_IOCTL
#undef HAVE_GETPW_DECLS
+#undef FIONREAD_IN_SYS_IOCTL
+
+#undef HAVE_BSD_SIGNALS
+
+#undef HAVE_LSTAT
+
+#undef HAVE_POSIX_SIGNALS
+
+#undef HAVE_POSIX_SIGSETJMP
+
+#undef HAVE_USG_SIGHOLD
+
+#undef MUST_REINSTALL_SIGHANDLERS
+
+#undef SPEED_T_IN_SYS_TYPES
+
+#undef STRCOLL_BROKEN
+
+#undef STRUCT_DIRENT_HAS_D_FILENO
+
+#undef STRUCT_DIRENT_HAS_D_INO
+
+#undef STRUCT_WINSIZE_IN_SYS_IOCTL
+
+#undef STRUCT_WINSIZE_IN_TERMIOS
+
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
diff --git a/readline/aclocal.m4 b/readline/aclocal.m4
index f8f5b74..c277a0c 100644
--- a/readline/aclocal.m4
+++ b/readline/aclocal.m4
@@ -316,19 +316,13 @@ AC_CACHE_VAL(bash_cv_opendir_not_robust,
main()
{
DIR *dir;
-int fd, err;
-err = mkdir("/tmp/bash-aclocal", 0700);
-if (err < 0) {
- perror("mkdir");
- exit(1);
-}
-unlink("/tmp/bash-aclocal/not_a_directory");
-fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
+int fd;
+unlink("/tmp/not_a_directory");
+fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
write(fd, "\n", 1);
close(fd);
-dir = opendir("/tmp/bash-aclocal/not_a_directory");
-unlink("/tmp/bash-aclocal/not_a_directory");
-rmdir("/tmp/bash-aclocal");
+dir = opendir("/tmp/not_a_directory");
+unlink("/tmp/not_a_directory");
exit (dir == 0);
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
[AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
@@ -360,59 +354,25 @@ AC_DEFINE(VOID_SIGHANDLER)
fi
])
-dnl
-dnl A signed 16-bit integer quantity
-dnl
-AC_DEFUN(BASH_TYPE_BITS16_T,
-[
-if test "$ac_cv_sizeof_short" = 2; then
- AC_CHECK_TYPE(bits16_t, short)
-elif test "$ac_cv_sizeof_char" = 2; then
- AC_CHECK_TYPE(bits16_t, char)
-else
- AC_CHECK_TYPE(bits16_t, short)
-fi
-])
-
-dnl
-dnl An unsigned 16-bit integer quantity
-dnl
-AC_DEFUN(BASH_TYPE_U_BITS16_T,
-[
-if test "$ac_cv_sizeof_short" = 2; then
- AC_CHECK_TYPE(u_bits16_t, unsigned short)
-elif test "$ac_cv_sizeof_char" = 2; then
- AC_CHECK_TYPE(u_bits16_t, unsigned char)
-else
- AC_CHECK_TYPE(u_bits16_t, unsigned short)
-fi
-])
-
-dnl
-dnl A signed 32-bit integer quantity
-dnl
-AC_DEFUN(BASH_TYPE_BITS32_T,
+AC_DEFUN(BASH_TYPE_INT32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
- AC_CHECK_TYPE(bits32_t, int)
+ AC_CHECK_TYPE(int32_t, int)
elif test "$ac_cv_sizeof_long" = 4; then
- AC_CHECK_TYPE(bits32_t, long)
+ AC_CHECK_TYPE(int32_t, long)
else
- AC_CHECK_TYPE(bits32_t, int)
+ AC_CHECK_TYPE(int32_t, int)
fi
])
-dnl
-dnl An unsigned 32-bit integer quantity
-dnl
-AC_DEFUN(BASH_TYPE_U_BITS32_T,
+AC_DEFUN(BASH_TYPE_U_INT32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
- AC_CHECK_TYPE(u_bits32_t, unsigned int)
+ AC_CHECK_TYPE(u_int32_t, unsigned int)
elif test "$ac_cv_sizeof_long" = 4; then
- AC_CHECK_TYPE(u_bits32_t, unsigned long)
+ AC_CHECK_TYPE(u_int32_t, unsigned long)
else
- AC_CHECK_TYPE(u_bits32_t, unsigned int)
+ AC_CHECK_TYPE(u_int32_t, unsigned int)
fi
])
@@ -427,9 +387,6 @@ else
fi
])
-dnl
-dnl A signed 64-bit quantity
-dnl
AC_DEFUN(BASH_TYPE_BITS64_T,
[
if test "$ac_sv_sizeof_char_p" = 8; then
@@ -470,20 +427,6 @@ if test $bash_cv_func_lstat = yes; then
fi
])
-AC_DEFUN(BASH_FUNC_INET_ATON,
-[
-AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
-[AC_TRY_LINK([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
-bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
-if test $bash_cv_func_inet_aton = yes; then
- AC_DEFINE(HAVE_INET_ATON)
-fi
-])
-
AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
[AC_MSG_CHECKING([for a c_line member of struct termios])
AC_CACHE_VAL(bash_cv_termios_ldisc,
@@ -902,7 +845,7 @@ AC_CACHE_VAL(bash_cv_sys_named_pipes,
/* Add more tests in here as appropriate. */
main()
{
-int fd, err;
+int fd;
#if defined (HAVE_MKFIFO)
exit (0);
@@ -915,19 +858,12 @@ exit (1);
#if defined (NeXT)
exit (1);
#endif
-err = mkdir("/tmp/bash-aclocal", 0700);
-if (err < 0) {
- perror ("mkdir");
- exit(1);
-}
-fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
-if (fd == -1) {
- rmdir ("/tmp/bash-aclocal");
+
+fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
+if (fd == -1)
exit (1);
-}
close(fd);
-unlink ("/tmp/bash-aclocal/sh-np-autoconf");
-rmdir ("/tmp/bash-aclocal");
+unlink ("/tmp/sh-np-autoconf");
exit(0);
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
[AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
@@ -1101,32 +1037,12 @@ elif test $bash_cv_dev_fd = "whacky"; then
fi
])
-AC_DEFUN(BASH_CHECK_DEV_STDIN,
-[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
-AC_CACHE_VAL(bash_cv_dev_stdin,
-[if test -d /dev/fd && test -r /dev/stdin; then
- bash_cv_dev_stdin=present
- elif test -d /proc/self/fd && test -r /dev/stdin; then
- bash_cv_dev_stdin=present
- else
- bash_cv_dev_stdin=absent
- fi
-])
-AC_MSG_RESULT($bash_cv_dev_stdin)
-if test $bash_cv_dev_stdin = "present"; then
- AC_DEFINE(HAVE_DEV_STDIN)
-fi
-])
-
-dnl
-dnl Check for the presence of getpeername in libsocket.
-dnl If libsocket is present, check for libnsl and add it to LIBS if
-dnl it's there, since most systems with libsocket require linking
-dnl with libnsl as well. This should only be called if getpeername
-dnl was not found in libc.
dnl
-dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
-dnl AS WELL
+dnl Check for the presence of getpeername (the only networking function
+dnl bash currently requires) in libsocket. If libsocket is present,
+dnl check for libnsl and add it to LIBS if it's there, since most
+dnl systems with libsocket require linking with libnsl as well.
+dnl This should only be called if getpeername was not found in libc.
dnl
AC_DEFUN(BASH_CHECK_SOCKLIB,
[
@@ -1168,32 +1084,6 @@ if test $bash_cv_have_socklib = yes; then
fi
])
-dnl
-dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
-dnl system, we can't use AC_PREREQ
-dnl
-AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
-[if test "X$bash_cv_have_gethostbyname" = "X"; then
-_bash_needmsg=yes
-else
-AC_MSG_CHECKING(for gethostbyname in socket library)
-_bash_needmsg=
-fi
-AC_CACHE_VAL(bash_cv_have_gethostbyname,
-[AC_TRY_LINK([#include <netdb.h>],
-[ struct hostent *hp;
- hp = gethostbyname("localhost");
-], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
-)
-if test "X$_bash_needmsg" = Xyes; then
- AC_MSG_CHECKING(for gethostbyname in socket library)
-fi
-AC_MSG_RESULT($bash_cv_have_gethostbyname)
-if test "$bash_cv_have_gethostbyname" = yes; then
-AC_DEFINE(HAVE_GETHOSTBYNAME)
-fi
-])
-
AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
[AC_MSG_CHECKING(for default mail directory)
AC_CACHE_VAL(bash_cv_mail_dir,
@@ -1409,19 +1299,3 @@ switch (0) case 0: case (sizeof (off_t) <= 4):;
if test $bash_cv_off_t_64 = yes; then
AC_DEFINE(HAVE_OFF_T_64)
fi])
-
-AC_DEFUN(BASH_STRUCT_TIMEVAL,
-[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
-AC_CACHE_VAL(bash_cv_struct_timeval,
-[
-AC_EGREP_HEADER(struct timeval, sys/time.h,
- bash_cv_struct_timeval=yes,
- AC_EGREP_HEADER(struct timeval, time.h,
- bash_cv_struct_timeval=yes,
- bash_cv_struct_timeval=no))
-])
-AC_MSG_RESULT($bash_cv_struct_timeval)
-if test $bash_cv_struct_timeval = yes; then
- AC_DEFINE(HAVE_TIMEVAL)
-fi
-])
diff --git a/readline/ansi_stdlib.h b/readline/ansi_stdlib.h
index a720cb9..52339da 100644
--- a/readline/ansi_stdlib.h
+++ b/readline/ansi_stdlib.h
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
- Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_STDLIB_H_)
#define _STDLIB_H_ 1
diff --git a/readline/bind.c b/readline/bind.c
index 6a6424e..73cd827 100644
--- a/readline/bind.c
+++ b/readline/bind.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -42,6 +42,7 @@
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
+#include <signal.h>
#include <errno.h>
#if !defined (errno)
@@ -57,25 +58,65 @@ extern int errno;
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "rlshell.h"
-#include "xmalloc.h"
-
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+extern int _rl_horizontal_scroll_mode;
+extern int _rl_mark_modified_lines;
+extern int _rl_bell_preference;
+extern int _rl_meta_flag;
+extern int _rl_convert_meta_chars_to_ascii;
+extern int _rl_output_meta_chars;
+extern int _rl_complete_show_all;
+extern int _rl_complete_mark_directories;
+extern int _rl_print_completions_horizontally;
+extern int _rl_completion_case_fold;
+extern int _rl_enable_keypad;
+#if defined (PAREN_MATCHING)
+extern int rl_blink_matching_paren;
+#endif /* PAREN_MATCHING */
+#if defined (VISIBLE_STATS)
+extern int rl_visible_stats;
+#endif /* VISIBLE_STATS */
+extern int rl_complete_with_tilde_expansion;
+extern int rl_completion_query_items;
+extern int rl_inhibit_completion;
+extern char *_rl_comment_begin;
+extern unsigned char *_rl_isearch_terminators;
+
+extern int rl_explicit_arg;
+extern int rl_editing_mode;
+extern unsigned char _rl_parsing_conditionalized_out;
+extern Keymap _rl_keymap;
+
+extern char *possible_control_prefixes[], *possible_meta_prefixes[];
+
+/* Functions imported from funmap.c */
+extern char **rl_funmap_names ();
+extern int rl_add_funmap_entry ();
+
+/* Functions imported from util.c */
+extern char *_rl_strindex ();
+
+/* Functions imported from shell.c */
+extern char *get_env_value ();
+
/* Variables exported by this file. */
Keymap rl_binding_keymap;
-static int _rl_read_init_file __P((char *, int));
-static int glean_key_from_name __P((char *));
-static int substring_member_of_array __P((char *, char **));
+/* Forward declarations */
+void rl_set_keymap_from_edit_mode ();
-static int currently_reading_init_file;
+static int _rl_read_init_file ();
+static int glean_key_from_name ();
+static int substring_member_of_array ();
-/* used only in this file */
-static int _rl_prefer_visible_bell = 1;
+extern char *xmalloc (), *xrealloc ();
/* **************************************************************** */
/* */
@@ -609,7 +650,7 @@ _rl_read_file (filename, sizep)
char *buffer;
int i, file;
- if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0)
+ if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY | O_BINARY, 0666)) < 0)
return ((char *)NULL);
file_size = (size_t)finfo.st_size;
@@ -630,7 +671,7 @@ _rl_read_file (filename, sizep)
i = read (file, buffer, file_size);
close (file);
-#if 0
+#if 1
if (i < file_size)
#else
if (i < 0)
@@ -640,16 +681,33 @@ _rl_read_file (filename, sizep)
return ((char *)NULL);
}
-#if 0
buffer[file_size] = '\0';
- if (sizep)
- *sizep = file_size;
-#else
- buffer[i] = '\0';
- if (sizep)
- *sizep = i;
+
+#if O_BINARY
+ {
+ /* Systems which distinguish between text and binary files need
+ to strip the CR characters before each Newline, otherwise the
+ parsing functions won't work. */
+ char *s, *d;
+ size_t removed = 0;
+
+ for (s = buffer, d = buffer; s < buffer + file_size; s++)
+ {
+ if (removed)
+ *d = *s;
+ if (*s != '\r' || s[1] != '\n')
+ d++;
+ else
+ removed++;
+ }
+
+ file_size -= removed;
+ buffer[file_size] = '\0';
+ }
#endif
+ if (sizep)
+ *sizep = file_size;
return (buffer);
}
@@ -669,6 +727,7 @@ rl_re_read_init_file (count, ignore)
1. the filename used for the previous call
2. the value of the shell variable `INPUTRC'
3. ~/.inputrc
+ 4. (for __MSDOS__ only) ~/_inputrc
If the file existed and could be opened and read, 0 is returned,
otherwise errno is returned. */
int
@@ -688,11 +747,20 @@ rl_read_init_file (filename)
if (*filename == 0)
filename = DEFAULT_INPUTRC;
-#if defined (__MSDOS__)
- if (_rl_read_init_file (filename, 0) == 0)
- return 0;
- filename = "~/_inputrc";
+#ifdef __MSDOS__
+ {
+ /* DOS doesn't allow leading dots in file names. If the original
+ name fails (it could work if we are on Windows), fall back to
+ ~/_inputrc. */
+ int retval = _rl_read_init_file (filename, 0);
+
+ if (retval == 0)
+ return retval;
+ else if (strcmp (filename, "~/.inputrc") == 0)
+ filename = "~/_inputrc";
+ }
#endif
+
return (_rl_read_init_file (filename, 0));
}
@@ -721,8 +789,6 @@ _rl_read_init_file (filename, include_level)
last_readline_init_file = savestring (filename);
}
- currently_reading_init_file = 1;
-
/* Loop over the lines in the file. Lines that start with `#' are
comments; all other lines are commands for readline initialization. */
current_readline_init_lineno = 1;
@@ -733,12 +799,6 @@ _rl_read_init_file (filename, include_level)
/* Find the end of this line. */
for (i = 0; line + i != end && line[i] != '\n'; i++);
-#if defined (__CYGWIN32__)
- /* ``Be liberal in what you accept.'' */
- if (line[i] == '\n' && line[i-1] == '\r')
- line[i - 1] = '\0';
-#endif
-
/* Mark end of line. */
line[i] = '\0';
@@ -759,7 +819,6 @@ _rl_read_init_file (filename, include_level)
}
free (buffer);
- currently_reading_init_file = 0;
return (0);
}
@@ -767,11 +826,9 @@ static void
_rl_init_file_error (msg)
char *msg;
{
- if (currently_reading_init_file)
- fprintf (stderr, "readline: %s: line %d: %s\n", current_readline_init_file,
- current_readline_init_lineno, msg);
- else
- fprintf (stderr, "readline: %s\n", msg);
+ fprintf (stderr, "readline: %s: line %d: %s\n", current_readline_init_file,
+ current_readline_init_lineno,
+ msg);
}
/* **************************************************************** */
@@ -1218,273 +1275,154 @@ rl_parse_and_bind (string)
have one of two values; either "On" or 1 for truth, or "Off" or 0 for
false. */
-#define V_SPECIAL 0x1
-
static struct {
char *name;
int *value;
- int flags;
} boolean_varlist [] = {
- { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL },
- { "completion-ignore-case", &_rl_completion_case_fold, 0 },
- { "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 },
- { "disable-completion", &rl_inhibit_completion, 0 },
- { "enable-keypad", &_rl_enable_keypad, 0 },
- { "expand-tilde", &rl_complete_with_tilde_expansion, 0 },
- { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 },
- { "input-meta", &_rl_meta_flag, 0 },
- { "mark-directories", &_rl_complete_mark_directories, 0 },
- { "mark-modified-lines", &_rl_mark_modified_lines, 0 },
- { "meta-flag", &_rl_meta_flag, 0 },
- { "output-meta", &_rl_output_meta_chars, 0 },
- { "prefer-visible-bell", &_rl_prefer_visible_bell, V_SPECIAL },
- { "print-completions-horizontally", &_rl_print_completions_horizontally, 0 },
- { "show-all-if-ambiguous", &_rl_complete_show_all, 0 },
+#if defined (PAREN_MATCHING)
+ { "blink-matching-paren", &rl_blink_matching_paren },
+#endif
+ { "completion-ignore-case", &_rl_completion_case_fold },
+ { "convert-meta", &_rl_convert_meta_chars_to_ascii },
+ { "disable-completion", &rl_inhibit_completion },
+ { "enable-keypad", &_rl_enable_keypad },
+ { "expand-tilde", &rl_complete_with_tilde_expansion },
+ { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode },
+ { "input-meta", &_rl_meta_flag },
+ { "mark-directories", &_rl_complete_mark_directories },
+ { "mark-modified-lines", &_rl_mark_modified_lines },
+ { "meta-flag", &_rl_meta_flag },
+ { "output-meta", &_rl_output_meta_chars },
+ { "print-completions-horizontally", &_rl_print_completions_horizontally },
+ { "show-all-if-ambiguous", &_rl_complete_show_all },
#if defined (VISIBLE_STATS)
- { "visible-stats", &rl_visible_stats, 0 },
+ { "visible-stats", &rl_visible_stats },
#endif /* VISIBLE_STATS */
{ (char *)NULL, (int *)NULL }
};
-static int
-find_boolean_var (name)
- char *name;
-{
- register int i;
-
- for (i = 0; boolean_varlist[i].name; i++)
- if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
- return i;
- return -1;
-}
-
-/* Hooks for handling special boolean variables, where a
- function needs to be called or another variable needs
- to be changed when they're changed. */
-static void
-hack_special_boolean_var (i)
- int i;
-{
- char *name;
-
- name = boolean_varlist[i].name;
-
- if (_rl_stricmp (name, "blink-matching-paren") == 0)
- _rl_enable_paren_matching (rl_blink_matching_paren);
- else if (_rl_stricmp (name, "prefer-visible-bell") == 0)
- {
- if (_rl_prefer_visible_bell)
- _rl_bell_preference = VISIBLE_BELL;
- else
- _rl_bell_preference = AUDIBLE_BELL;
- }
-}
-
-/* These *must* correspond to the array indices for the appropriate
- string variable. (Though they're not used right now.) */
-#define V_BELLSTYLE 0
-#define V_COMBEGIN 1
-#define V_EDITMODE 2
-#define V_ISRCHTERM 3
-#define V_KEYMAP 4
-
-#define V_STRING 1
-#define V_INT 2
-
-/* Forward declarations */
-static int sv_bell_style __P((char *));
-static int sv_combegin __P((char *));
-static int sv_compquery __P((char *));
-static int sv_editmode __P((char *));
-static int sv_isrchterm __P((char *));
-static int sv_keymap __P((char *));
-
-static struct {
- char *name;
- int flags;
- Function *set_func;
-} string_varlist[] = {
- { "bell-style", V_STRING, sv_bell_style },
- { "comment-begin", V_STRING, sv_combegin },
- { "completion-query-items", V_INT, sv_compquery },
- { "editing-mode", V_STRING, sv_editmode },
- { "isearch-terminators", V_STRING, sv_isrchterm },
- { "keymap", V_STRING, sv_keymap },
- { (char *)NULL, 0 }
-};
-
-static int
-find_string_var (name)
- char *name;
-{
- register int i;
-
- for (i = 0; string_varlist[i].name; i++)
- if (_rl_stricmp (name, string_varlist[i].name) == 0)
- return i;
- return -1;
-}
-
-/* A boolean value that can appear in a `set variable' command is true if
- the value is null or empty, `on' (case-insenstive), or "1". Any other
- values result in 0 (false). */
-static int
-bool_to_int (value)
- char *value;
-{
- return (value == 0 || *value == '\0' ||
- (_rl_stricmp (value, "on") == 0) ||
- (value[0] == '1' && value[1] == '\0'));
-}
-
int
rl_variable_bind (name, value)
char *name, *value;
{
register int i;
- int v;
/* Check for simple variables first. */
- i = find_boolean_var (name);
- if (i >= 0)
+ for (i = 0; boolean_varlist[i].name; i++)
{
- *boolean_varlist[i].value = bool_to_int (value);
- if (boolean_varlist[i].flags & V_SPECIAL)
- hack_special_boolean_var (i);
- return 0;
+ if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
+ {
+ /* A variable is TRUE if the "value" is "on", "1" or "". */
+ *boolean_varlist[i].value = *value == 0 ||
+ _rl_stricmp (value, "on") == 0 ||
+ (value[0] == '1' && value[1] == '\0');
+ return 0;
+ }
}
- i = find_string_var (name);
-
- /* For the time being, unknown variable names or string names without a
- handler function are simply ignored. */
- if (i < 0 || string_varlist[i].set_func == 0)
- return 0;
-
- v = (*string_varlist[i].set_func) (value);
- return v;
-}
+ /* Not a boolean variable, so check for specials. */
-static int
-sv_editmode (value)
- char *value;
-{
- if (_rl_strnicmp (value, "vi", 2) == 0)
+ /* Editing mode change? */
+ if (_rl_stricmp (name, "editing-mode") == 0)
{
+ if (_rl_strnicmp (value, "vi", 2) == 0)
+ {
#if defined (VI_MODE)
- _rl_keymap = vi_insertion_keymap;
- rl_editing_mode = vi_mode;
+ _rl_keymap = vi_insertion_keymap;
+ rl_editing_mode = vi_mode;
#endif /* VI_MODE */
- return 0;
- }
- else if (_rl_strnicmp (value, "emacs", 5) == 0)
- {
- _rl_keymap = emacs_standard_keymap;
- rl_editing_mode = emacs_mode;
- return 0;
+ }
+ else if (_rl_strnicmp (value, "emacs", 5) == 0)
+ {
+ _rl_keymap = emacs_standard_keymap;
+ rl_editing_mode = emacs_mode;
+ }
}
- return 1;
-}
-static int
-sv_combegin (value)
- char *value;
-{
- if (value && *value)
+ /* Comment string change? */
+ else if (_rl_stricmp (name, "comment-begin") == 0)
{
- FREE (_rl_comment_begin);
- _rl_comment_begin = savestring (value);
- return 0;
- }
- return 1;
-}
-
-static int
-sv_compquery (value)
- char *value;
-{
- int nval = 100;
+ if (*value)
+ {
+ if (_rl_comment_begin)
+ free (_rl_comment_begin);
- if (value && *value)
+ _rl_comment_begin = savestring (value);
+ }
+ }
+ else if (_rl_stricmp (name, "completion-query-items") == 0)
{
- nval = atoi (value);
- if (nval < 0)
- nval = 0;
+ int nval = 100;
+ if (*value)
+ {
+ nval = atoi (value);
+ if (nval < 0)
+ nval = 0;
+ }
+ rl_completion_query_items = nval;
}
- rl_completion_query_items = nval;
- return 0;
-}
-
-static int
-sv_keymap (value)
- char *value;
-{
- Keymap kmap;
-
- kmap = rl_get_keymap_by_name (value);
- if (kmap)
+ else if (_rl_stricmp (name, "keymap") == 0)
{
- rl_set_keymap (kmap);
- return 0;
+ Keymap kmap;
+ kmap = rl_get_keymap_by_name (value);
+ if (kmap)
+ rl_set_keymap (kmap);
}
- return 1;
-}
-
-#define _SET_BELL(v) do { _rl_bell_preference = v; return 0; } while (0)
-
-static int
-sv_bell_style (value)
- char *value;
-{
- if (value == 0 || *value == '\0')
- _SET_BELL (AUDIBLE_BELL);
- else if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0)
- _SET_BELL (NO_BELL);
- else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0)
- _SET_BELL (AUDIBLE_BELL);
- else if (_rl_stricmp (value, "visible") == 0)
- _SET_BELL (VISIBLE_BELL);
- else
- return 1;
-}
-#undef _SET_BELL
-
-static int
-sv_isrchterm (value)
- char *value;
-{
- int beg, end, delim;
- char *v;
-
- if (value == 0)
- return 1;
-
- /* Isolate the value and translate it into a character string. */
- v = savestring (value);
- FREE (_rl_isearch_terminators);
- if (v[0] == '"' || v[0] == '\'')
+ else if (_rl_stricmp (name, "bell-style") == 0)
{
- delim = v[0];
- for (beg = end = 1; v[end] && v[end] != delim; end++)
- ;
+ if (!*value)
+ _rl_bell_preference = AUDIBLE_BELL;
+ else
+ {
+ if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0)
+ _rl_bell_preference = NO_BELL;
+ else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0)
+ _rl_bell_preference = AUDIBLE_BELL;
+ else if (_rl_stricmp (value, "visible") == 0)
+ _rl_bell_preference = VISIBLE_BELL;
+ }
}
- else
+ else if (_rl_stricmp (name, "prefer-visible-bell") == 0)
{
- for (beg = end = 0; whitespace (v[end]) == 0; end++)
- ;
+ /* Backwards compatibility. */
+ if (*value && (_rl_stricmp (value, "on") == 0 ||
+ (*value == '1' && !value[1])))
+ _rl_bell_preference = VISIBLE_BELL;
+ else
+ _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[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';
+ 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++)
+ ;
+ }
- free (v);
+ 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. */
return 0;
}
-
+
/* Return the character which matches NAME.
For example, `Space' returns ' '. */
diff --git a/readline/callback.c b/readline/callback.c
index 1172356..6915be4 100644
--- a/readline/callback.c
+++ b/readline/callback.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -35,7 +35,15 @@
/* System-specific feature definitions and include files. */
#include "rldefs.h"
#include "readline.h"
-#include "rlprivate.h"
+
+extern void readline_internal_setup ();
+extern char *readline_internal_teardown ();
+extern int readline_internal_char ();
+extern void _rl_init_line_state ();
+
+extern int _rl_meta_flag;
+extern char *rl_prompt;
+extern int rl_visible_prompt_length;
/* **************************************************************** */
/* */
diff --git a/readline/chardefs.h b/readline/chardefs.h
index 664c1e4..3e9e273 100644
--- a/readline/chardefs.h
+++ b/readline/chardefs.h
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _CHARDEFS_H_
#define _CHARDEFS_H_
diff --git a/readline/complete.c b/readline/complete.c
index fb48712..1188120 100644
--- a/readline/complete.c
+++ b/readline/complete.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -70,14 +70,20 @@ extern struct passwd *getpwent ();
/* Some standard library routines. */
#include "readline.h"
-#include "xmalloc.h"
-#include "rlprivate.h"
-#ifdef __STDC__
-typedef int QSFUNC (const void *, const void *);
-#else
-typedef int QSFUNC ();
-#endif
+extern char *tilde_expand ();
+extern char *rl_copy_text ();
+extern void _rl_abort_internal ();
+extern int _rl_qsort_string_compare ();
+extern void _rl_replace_text ();
+
+extern Function *rl_last_func;
+extern int rl_editing_mode;
+extern int screenwidth;
+
+extern void _rl_move_vert ();
+extern int _rl_vis_botlin;
+extern int rl_display_fixed;
/* 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.
@@ -89,25 +95,27 @@ typedef int QSFUNC ();
VFunction *rl_completion_display_matches_hook = (VFunction *)NULL;
/* Forward declarations for functions defined and used in this file. */
-char *filename_completion_function __P((char *, int));
-char **completion_matches __P((char *, CPFunction *));
+char *filename_completion_function ();
+char **completion_matches ();
#if defined (VISIBLE_STATS)
# if !defined (X_OK)
# define X_OK 1
# endif
-static int stat_char __P((char *));
+static int stat_char ();
#endif
-static char *rl_quote_filename __P((char *, int, char *));
-static char *rl_strpbrk __P((char *, char *));
+static char *rl_quote_filename ();
+static char *rl_strpbrk ();
+
+static char **remove_duplicate_matches ();
+static void insert_match ();
+static int append_to_match ();
+static void insert_all_matches ();
+static void display_matches ();
+static int compute_lcd_of_matches ();
-static char **remove_duplicate_matches __P((char **));
-static void insert_match __P((char *, int, int, char *));
-static int append_to_match __P((char *, int, int));
-static void insert_all_matches __P((char **, int, char *));
-static void display_matches __P((char **));
-static int compute_lcd_of_matches __P((char **, int, char *));
+extern char *xmalloc (), *xrealloc ();
/* **************************************************************** */
/* */
@@ -128,11 +136,7 @@ int _rl_complete_mark_directories = 1;
int _rl_print_completions_horizontally;
/* Non-zero means that case is not significant in filename completion. */
-#if defined (__MSDOS__) && !defined (__DJGPP__)
-int _rl_completion_case_fold = 1;
-#else
int _rl_completion_case_fold;
-#endif
/* Global variables available to applications using readline. */
@@ -413,10 +417,6 @@ printable_part (pathname)
char *temp;
temp = rl_filename_completion_desired ? strrchr (pathname, '/') : (char *)NULL;
-#if defined (__MSDOS__)
- if (rl_filename_completion_desired && temp == 0 && isalpha (pathname[0]) && pathname[1] == ':')
- temp = pathname + 1;
-#endif
return (temp ? ++temp : pathname);
}
@@ -477,12 +477,7 @@ print_filename (to_print, full_pathname)
c = to_print[-1];
to_print[-1] = '\0';
- /* If setting the last slash in full_pathname to a NUL results in
- full_pathname being the empty string, we are trying to complete
- files in the root directory. If we pass a null string to the
- bash directory completion hook, for example, it will expand it
- to the current directory. We just want the `/'. */
- s = tilde_expand (full_pathname && *full_pathname ? full_pathname : "/");
+ s = tilde_expand (full_pathname);
if (rl_directory_completion_hook)
(*rl_directory_completion_hook) (&s);
@@ -632,31 +627,25 @@ find_completion_word (fp, dp)
/* If there is an application-specific function to say whether or not
a character is quoted and we found a quote character, let that
function decide whether or not a character is a word break, even
- if it is found in rl_completer_word_break_characters. Don't bother
- if we're at the end of the line, though. */
- if (scan)
- {
- if (rl_char_is_quoted_p)
- isbrk = (found_quote == 0 ||
- (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) &&
- strchr (rl_completer_word_break_characters, scan) != 0;
- else
- isbrk = strchr (rl_completer_word_break_characters, scan) != 0;
+ if it is found in rl_completer_word_break_characters. */
+ if (rl_char_is_quoted_p)
+ isbrk = (found_quote == 0 ||
+ (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) &&
+ strchr (rl_completer_word_break_characters, scan) != 0;
+ else
+ isbrk = strchr (rl_completer_word_break_characters, scan) != 0;
- if (isbrk)
- {
- /* If the character that caused the word break was a quoting
- character, then remember it as the delimiter. */
- if (rl_basic_quote_characters &&
- strchr (rl_basic_quote_characters, scan) &&
- (end - rl_point) > 1)
- delimiter = scan;
-
- /* If the character isn't needed to determine something special
- about what kind of completion to perform, then advance past it. */
- if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0)
- rl_point++;
- }
+ if (isbrk)
+ {
+ /* If the character that caused the word break was a quoting
+ character, then remember it as the delimiter. */
+ if (rl_basic_quote_characters && strchr (rl_basic_quote_characters, scan) && (end - rl_point) > 1)
+ delimiter = scan;
+
+ /* If the character isn't needed to determine something special
+ about what kind of completion to perform, then advance past it. */
+ if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0)
+ rl_point++;
}
if (fp)
@@ -726,7 +715,7 @@ remove_duplicate_matches (matches)
/* Sort the array without matches[0], since we need it to
stay in place no matter what. */
if (i)
- qsort (matches+1, i-1, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
+ qsort (matches+1, i-1, sizeof (char *), _rl_qsort_string_compare);
/* Remember the lowest common denominator for it may be unique. */
lowest_common = savestring (matches[0]);
@@ -919,7 +908,7 @@ rl_display_match_list (matches, len, max)
/* Sort the items if they are not already sorted. */
if (rl_ignore_completion_duplicates == 0)
- qsort (matches + 1, len, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
+ qsort (matches + 1, len, sizeof (char *), _rl_qsort_string_compare);
crlf ();
@@ -1420,7 +1409,7 @@ username_completion_function (text, state)
{
#if defined (__WIN32__) || defined (__OPENNT)
return (char *)NULL;
-#else /* !__WIN32__ && !__OPENNT) */
+#else /* !__WIN32__ && !__OPENNT */
static char *username = (char *)NULL;
static struct passwd *entry;
static int namelen, first_char, first_char_loc;
@@ -1463,7 +1452,7 @@ username_completion_function (text, state)
return (value);
}
-#endif /* !__WIN32__ && !__OPENNT */
+#endif /* !__GO32__ */
}
/* Okay, now we write the entry_function for filename completion. In the
@@ -1505,24 +1494,18 @@ filename_completion_function (text, state)
temp = strrchr (dirname, '/');
-#if defined (__MSDOS__)
- /* special hack for //X/... */
- if (dirname[0] == '/' && dirname[1] == '/' && isalpha (dirname[2]) && dirname[3] == '/')
- temp = strrchr (dirname + 3, '/');
-#endif
-
if (temp)
{
strcpy (filename, ++temp);
*temp = '\0';
}
-#if defined (__MSDOS__)
- /* searches from current directory on the drive */
- else if (isalpha (dirname[0]) && dirname[1] == ':')
- {
- strcpy (filename, dirname + 2);
- dirname[2] = '\0';
- }
+#if defined (__WIN32__) || defined (__OPENNT) || defined (__MSDOS__)
+ /* Handle the drive-relative names "d:foo/bar". */
+ else if (dirname[1] == ':')
+ {
+ strcpy (filename, dirname + 2);
+ dirname[2] = '\0';
+ }
#endif
else
{
@@ -1685,7 +1668,11 @@ rl_menu_complete (count, ignore)
/* Clean up from previous call, if any. */
FREE (orig_text);
if (matches)
- free_match_list (matches);
+ {
+ for (match_list_index = 0; matches[match_list_index]; match_list_index++)
+ free (matches[match_list_index]);
+ free (matches);
+ }
match_list_index = match_list_size = 0;
matches = (char **)NULL;
diff --git a/readline/config.h.bot b/readline/config.h.bot
new file mode 100644
index 0000000..d7a6dc4
--- /dev/null
+++ b/readline/config.h.bot
@@ -0,0 +1,22 @@
+/* config.h.bot */
+/* modify settings or make new ones based on what autoconf tells us. */
+
+/* Ultrix botches type-ahead when switching from canonical to
+ non-canonical mode, at least through version 4.3 */
+#if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix)
+# define TERMIOS_MISSING
+#endif
+
+#if defined (STRCOLL_BROKEN)
+# undef HAVE_STRCOLL
+#endif
+
+#if defined (__STDC__) && defined (HAVE_STDARG_H)
+# define PREFER_STDARG
+# define USE_VARARGS
+#else
+# if defined (HAVE_VARARGS_H)
+# define PREFER_VARARGS
+# define USE_VARARGS
+# endif
+#endif
diff --git a/readline/config.h.in b/readline/config.h.in
index d9aa535..87f807f 100644
--- a/readline/config.h.in
+++ b/readline/config.h.in
@@ -1,21 +1,61 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* Define if you have the strcoll function and it is properly defined. */
+#undef HAVE_STRCOLL
+
/* Define if on MINIX. */
#undef _MINIX
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
+/* Definitions pulled in from aclocal.m4. */
#undef VOID_SIGHANDLER
-/* Define if you have the lstat function. */
+#undef GWINSZ_IN_SYS_IOCTL
+
+#undef TIOCSTAT_IN_SYS_IOCTL
+
+#undef HAVE_GETPW_DECLS
+
+#undef FIONREAD_IN_SYS_IOCTL
+
+#undef HAVE_BSD_SIGNALS
+
#undef HAVE_LSTAT
-/* Define if you have the memmove function. */
-#undef HAVE_MEMMOVE
+#undef HAVE_POSIX_SIGNALS
+
+#undef HAVE_POSIX_SIGSETJMP
+
+#undef HAVE_USG_SIGHOLD
+
+#undef MUST_REINSTALL_SIGHANDLERS
+
+#undef SPEED_T_IN_SYS_TYPES
+
+#undef STRCOLL_BROKEN
+
+#undef STRUCT_DIRENT_HAS_D_FILENO
+
+#undef STRUCT_DIRENT_HAS_D_INO
+
+#undef STRUCT_WINSIZE_IN_SYS_IOCTL
+
+#undef STRUCT_WINSIZE_IN_TERMIOS
+
+/* Define if you have the lstat function. */
+#undef HAVE_LSTAT
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@@ -26,26 +66,27 @@
/* Define if you have the setenv function. */
#undef HAVE_SETENV
+/* Define if you have the setlocale function. */
+#undef HAVE_SETLOCALE
+
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
-/* Define if you have the setlocale function. */
-#undef HAVE_SETLOCALE
-
/* Define if you have the tcgetattr function. */
#undef HAVE_TCGETATTR
-/* Define if you have the strcoll function. */
-#undef HAVE_STRCOLL
-
-#undef STRCOLL_BROKEN
-
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
+/* Define if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -87,43 +128,6 @@
/* Define if you have the <varargs.h> header file. */
#undef HAVE_VARARGS_H
-
-/* Define if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
-
-#undef HAVE_LOCALE_H
-
-/* Definitions pulled in from aclocal.m4. */
-#undef VOID_SIGHANDLER
-
-#undef GWINSZ_IN_SYS_IOCTL
-
-#undef STRUCT_WINSIZE_IN_SYS_IOCTL
-
-#undef STRUCT_WINSIZE_IN_TERMIOS
-
-#undef TIOCSTAT_IN_SYS_IOCTL
-
-#undef FIONREAD_IN_SYS_IOCTL
-
-#undef SPEED_T_IN_SYS_TYPES
-
-#undef HAVE_GETPW_DECLS
-
-#undef STRUCT_DIRENT_HAS_D_INO
-
-#undef STRUCT_DIRENT_HAS_D_FILENO
-
-#undef HAVE_BSD_SIGNALS
-
-#undef HAVE_POSIX_SIGNALS
-
-#undef HAVE_USG_SIGHOLD
-
-#undef MUST_REINSTALL_SIGHANDLERS
-
-#undef HAVE_POSIX_SIGSETJMP
-
/* config.h.bot */
/* modify settings or make new ones based on what autoconf tells us. */
diff --git a/readline/configure b/readline/configure
index bcb5ff8..cdcdf88 100755
--- a/readline/configure
+++ b/readline/configure
@@ -1,19 +1,7 @@
#! /bin/sh
-# From configure.in for Readline 4.1, version 2.22, from autoconf version 2.13
-LIBVERSION=4.1
-
-
-
-
-
-
-
-
-
-
-
-
+# From configure.in for Readline 4.0, version 2.14, from autoconf version 2.13
+LIBVERSION=4.0
@@ -133,6 +121,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -247,6 +236,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -417,6 +407,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -582,12 +577,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -630,8 +629,9 @@ fi
+
ac_aux_dir=
-for ac_dir in ./support $srcdir/./support; do
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -643,21 +643,20 @@ for ac_dir in ./support $srcdir/./support; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in ./support $srcdir/./support" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:661: checking host system type" >&5
+echo "configure:660: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -698,7 +697,7 @@ test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:702: checking for $ac_word" >&5
+echo "configure:701: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -728,7 +727,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:732: checking for $ac_word" >&5
+echo "configure:731: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -779,7 +778,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:783: checking for $ac_word" >&5
+echo "configure:782: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -811,7 +810,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -822,12 +821,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 826 "configure"
+#line 825 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -853,12 +852,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:857: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:856: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:862: checking whether we are using GNU C" >&5
+echo "configure:861: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -867,7 +866,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -886,7 +885,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:890: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:889: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -918,7 +917,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:922: checking how to run the C preprocessor" >&5
+echo "configure:921: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -933,13 +932,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 937 "configure"
+#line 936 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -950,13 +949,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 954 "configure"
+#line 953 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -967,13 +966,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 971 "configure"
+#line 970 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -999,17 +998,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1003: checking for minix/config.h" >&5
+echo "configure:1002: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1008 "configure"
+#line 1007 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1047,18 +1046,52 @@ EOF
fi
+
+if test "x$cross_compiling" = "xyes"; then
+ case "${host}" in
+ *-cygwin*)
+ cross_cache=${srcdir}/cross-build/cygwin.cache
+ if test -r "${cross_cache}"; then
+ echo "loading cross-build cache file ${cross_cache}"
+ . ${cross_cache}
+ fi
+ LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
+ unset cross_cache
+ ;;
+ *) echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
+ ;;
+ esac
+fi
+
+if test "x$cross_compiling" = "xyes"; then
+ CROSS_COMPILING_FLAG=-DCROSS_COMPILING
+else
+ CROSS_COMPILING_FLAG=
+fi
+
+
+if test -z "$CC_FOR_BUILD"; then
+ if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+ else
+ CC_FOR_BUILD=gcc
+ fi
+fi
+
+
+
# 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"
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1056: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1089: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1062 "configure"
+#line 1095 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1076,7 +1109,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1080 "configure"
+#line 1113 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1109,7 +1142,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1113: checking for a BSD compatible install" >&5
+echo "configure:1146: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1164,7 +1197,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1168: checking for $ac_word" >&5
+echo "configure:1201: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1194,7 +1227,7 @@ test -n "$ARFLAGS" || ARFLAGS="cr"
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1198: checking for $ac_word" >&5
+echo "configure:1231: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1226,12 +1259,12 @@ MAKE_SHELL=/bin/sh
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1230: checking return type of signal handlers" >&5
+echo "configure:1263: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1235 "configure"
+#line 1268 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1248,7 +1281,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1268,12 +1301,12 @@ EOF
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1272: checking whether stat file-mode macros are broken" >&5
+echo "configure:1305: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1277 "configure"
+#line 1310 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1328,12 +1361,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1332: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1365: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1337 "configure"
+#line 1370 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1341,7 +1374,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1366,7 +1399,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1370: checking for opendir in -ldir" >&5
+echo "configure:1403: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1374,7 +1407,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1378 "configure"
+#line 1411 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1385,7 +1418,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1407,7 +1440,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1411: checking for opendir in -lx" >&5
+echo "configure:1444: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1415,7 +1448,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1419 "configure"
+#line 1452 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1426,7 +1459,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1449,16 +1482,15 @@ fi
fi
-for ac_func in lstat memmove putenv select setenv setlocale \
- strcasecmp tcgetattr
+for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1457: checking for $ac_func" >&5
+echo "configure:1489: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1462 "configure"
+#line 1494 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1481,7 +1513,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1507,7 +1539,7 @@ done
echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:1511: checking for working strcoll" >&5
+echo "configure:1543: checking for working strcoll" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1515,7 +1547,7 @@ else
ac_cv_func_strcoll_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 1519 "configure"
+#line 1551 "configure"
#include "confdefs.h"
#include <string.h>
main ()
@@ -1525,7 +1557,7 @@ main ()
strcoll ("123", "456") >= 0);
}
EOF
-if { (eval echo configure:1529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strcoll_works=yes
else
@@ -1554,17 +1586,17 @@ for ac_hdr in unistd.h stdlib.h varargs.h stdarg.h string.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1558: checking for $ac_hdr" >&5
+echo "configure:1590: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+#line 1595 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1593,13 +1625,13 @@ done
echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
-echo "configure:1597: checking for type of signal functions" >&5
+echo "configure:1629: checking for type of signal functions" >&5
if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1603 "configure"
+#line 1635 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
@@ -1612,7 +1644,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=posix
else
@@ -1621,7 +1653,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1625 "configure"
+#line 1657 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
@@ -1631,7 +1663,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=4.2bsd
else
@@ -1640,7 +1672,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1676 "configure"
#include "confdefs.h"
#include <signal.h>
@@ -1653,7 +1685,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=svr3
else
@@ -1694,7 +1726,7 @@ fi
echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
-echo "configure:1698: checking if signal handlers must be reinstalled when invoked" >&5
+echo "configure:1730: checking if signal handlers must be reinstalled when invoked" >&5
if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1704,7 +1736,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 1708 "configure"
+#line 1740 "configure"
#include "confdefs.h"
#include <signal.h>
@@ -1751,7 +1783,7 @@ main()
}
EOF
-if { (eval echo configure:1755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_must_reinstall_sighandlers=no
else
@@ -1776,7 +1808,7 @@ fi
echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
-echo "configure:1780: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
+echo "configure:1812: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1786,7 +1818,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 1790 "configure"
+#line 1822 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -1827,7 +1859,7 @@ exit(1);
#endif
}
EOF
-if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_sigsetjmp=present
else
@@ -1850,12 +1882,12 @@ EOF
fi
echo $ac_n "checking for lstat""... $ac_c" 1>&6
-echo "configure:1854: checking for lstat" >&5
+echo "configure:1886: checking for lstat" >&5
if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1859 "configure"
+#line 1891 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -1865,7 +1897,7 @@ int main() {
lstat(".",(struct stat *)0);
; return 0; }
EOF
-if { (eval echo configure:1869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_func_lstat=yes
else
@@ -1886,12 +1918,12 @@ EOF
fi
echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
-echo "configure:1890: checking whether programs are able to redeclare getpw functions" >&5
+echo "configure:1922: checking whether programs are able to redeclare getpw functions" >&5
if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1895 "configure"
+#line 1927 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <pwd.h>
@@ -1902,7 +1934,7 @@ int main() {
struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
; return 0; }
EOF
-if { (eval echo configure:1906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_can_redecl_getpw=yes
else
@@ -1924,7 +1956,7 @@ fi
echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
-echo "configure:1928: checking whether or not strcoll and strcmp differ" >&5
+echo "configure:1960: checking whether or not strcoll and strcmp differ" >&5
if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1934,7 +1966,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 1938 "configure"
+#line 1970 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1973,7 +2005,7 @@ char *v[];
}
EOF
-if { (eval echo configure:1977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_strcoll_broken=yes
else
@@ -1997,12 +2029,12 @@ fi
echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
-echo "configure:2001: checking whether signal handlers are of type void" >&5
+echo "configure:2033: checking whether signal handlers are of type void" >&5
if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2006 "configure"
+#line 2038 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2017,7 +2049,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_void_sighandler=yes
else
@@ -2037,12 +2069,12 @@ EOF
fi
echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2041: checking for TIOCGWINSZ in sys/ioctl.h" >&5
+echo "configure:2073: checking for TIOCGWINSZ in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2046 "configure"
+#line 2078 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2050,7 +2082,7 @@ int main() {
int x = TIOCGWINSZ;
; return 0; }
EOF
-if { (eval echo configure:2054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocgwinsz_in_ioctl=yes
else
@@ -2071,12 +2103,12 @@ EOF
fi
echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2075: checking for TIOCSTAT in sys/ioctl.h" >&5
+echo "configure:2107: checking for TIOCSTAT in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2080 "configure"
+#line 2112 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2084,7 +2116,7 @@ int main() {
int x = TIOCSTAT;
; return 0; }
EOF
-if { (eval echo configure:2088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocstat_in_ioctl=yes
else
@@ -2105,12 +2137,12 @@ EOF
fi
echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2109: checking for FIONREAD in sys/ioctl.h" >&5
+echo "configure:2141: checking for FIONREAD in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2114 "configure"
+#line 2146 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2118,7 +2150,7 @@ int main() {
int x = FIONREAD;
; return 0; }
EOF
-if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_fionread_in_ioctl=yes
else
@@ -2139,19 +2171,19 @@ EOF
fi
echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2143: checking for speed_t in sys/types.h" >&5
+echo "configure:2175: checking for speed_t in sys/types.h" >&5
if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2148 "configure"
+#line 2180 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {
speed_t x;
; return 0; }
EOF
-if { (eval echo configure:2155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_speed_t_in_sys_types=yes
else
@@ -2172,12 +2204,12 @@ EOF
fi
echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
-echo "configure:2176: checking for struct winsize in sys/ioctl.h and termios.h" >&5
+echo "configure:2208: checking for struct winsize in sys/ioctl.h and termios.h" >&5
if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2181 "configure"
+#line 2213 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2185,7 +2217,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=ioctl_h
else
@@ -2193,7 +2225,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 2197 "configure"
+#line 2229 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <termios.h>
@@ -2201,7 +2233,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=termios_h
else
@@ -2234,12 +2266,12 @@ fi
echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
-echo "configure:2238: checking if struct dirent has a d_ino member" >&5
+echo "configure:2270: checking if struct dirent has a d_ino member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2243 "configure"
+#line 2275 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2268,7 +2300,7 @@ struct dirent d; int z; z = d.d_ino;
; return 0; }
EOF
-if { (eval echo configure:2272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_dino=yes
else
@@ -2290,12 +2322,12 @@ fi
echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
-echo "configure:2294: checking if struct dirent has a d_fileno member" >&5
+echo "configure:2326: checking if struct dirent has a d_fileno member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2299 "configure"
+#line 2331 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2324,7 +2356,7 @@ struct dirent d; int z; z = d.d_fileno;
; return 0; }
EOF
-if { (eval echo configure:2328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_d_fileno=yes
else
@@ -2353,14 +2385,14 @@ if test "X$bash_cv_termcap_lib" = "X"; then
_bash_needmsg=yes
else
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2357: checking which library has the termcap functions" >&5
+echo "configure:2389: checking which library has the termcap functions" >&5
_bash_needmsg=
fi
if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:2364: checking for tgetent in -ltermcap" >&5
+echo "configure:2396: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2368,7 +2400,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2372 "configure"
+#line 2404 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2379,7 +2411,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2398,7 +2430,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:2402: checking for tgetent in -lcurses" >&5
+echo "configure:2434: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2406,7 +2438,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2410 "configure"
+#line 2442 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2417,7 +2449,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2436,7 +2468,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:2440: checking for tgetent in -lncurses" >&5
+echo "configure:2472: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2444,7 +2476,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2448 "configure"
+#line 2480 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2455,7 +2487,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2484,7 +2516,7 @@ fi
if test "X$_bash_needmsg" = "Xyes"; then
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2488: checking which library has the termcap functions" >&5
+echo "configure:2520: checking which library has the termcap functions" >&5
fi
echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
@@ -2521,8 +2553,8 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
echo $ac_n "checking configuration for building shared libraries""... $ac_c" 1>&6
-echo "configure:2525: checking configuration for building shared libraries" >&5
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+echo "configure:2557: checking configuration for building shared libraries" >&5
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
@@ -2536,20 +2568,9 @@ echo "configure:2525: checking configuration for building shared libraries" >&5
echo "$ac_t""$SHLIB_STATUS" 1>&6
-
- # shared library versioning
- # quoted for m4 so I can use character classes
- SHLIB_MAJOR=`expr "$LIBVERSION" : '\([0-9]\)\..*'`
- SHLIB_MINOR=`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`
-
-
fi
-case "$host_os" in
-msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
-*) BUILD_DIR=`pwd` ;;
-esac
-
+BUILD_DIR=`pwd`
@@ -2707,6 +2728,8 @@ s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
+s%@CROSS_COMPILING_FLAG@%$CROSS_COMPILING_FLAG%g
+s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
@@ -2725,8 +2748,6 @@ s%@SHLIB_XLDFLAGS@%$SHLIB_XLDFLAGS%g
s%@SHLIB_LIBSUFF@%$SHLIB_LIBSUFF%g
s%@SHLIB_LIBVERSION@%$SHLIB_LIBVERSION%g
s%@SHLIB_LIBS@%$SHLIB_LIBS%g
-s%@SHLIB_MAJOR@%$SHLIB_MAJOR%g
-s%@SHLIB_MINOR@%$SHLIB_MINOR%g
s%@BUILD_DIR@%$BUILD_DIR%g
s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g
s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
diff --git a/readline/configure.in b/readline/configure.in
index f977fec..9afdaa7 100644
--- a/readline/configure.in
+++ b/readline/configure.in
@@ -4,8 +4,8 @@ dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION([for Readline 4.1, version 2.22, from autoconf version] AC_ACVERSION)
-LIBVERSION=4.1
+AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION)
+LIBVERSION=4.0
AC_INIT(readline.h)
AC_CONFIG_HEADER(config.h)
@@ -13,7 +13,7 @@ AC_CONFIG_HEADER(config.h)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.10)
-AC_CONFIG_AUX_DIR(./support)
+dnl AC_CONFIG_AUX_DIR(./support)
AC_CANONICAL_HOST
@@ -32,9 +32,46 @@ fi
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_CC
-dnl AC_AIX
AC_MINIX
+dnl BEGIN changes for CYGNUS cross-building for Cygwin
+
+dnl load up the cross-building cache file -- add more cases and cache
+dnl files as necessary
+if test "x$cross_compiling" = "xyes"; then
+ case "${host}" in
+ *-cygwin*)
+ cross_cache=${srcdir}/cross-build/cygwin.cache
+ if test -r "${cross_cache}"; then
+ echo "loading cross-build cache file ${cross_cache}"
+ . ${cross_cache}
+ fi
+ LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
+ unset cross_cache
+ ;;
+ *) echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
+ ;;
+ esac
+fi
+
+if test "x$cross_compiling" = "xyes"; then
+ CROSS_COMPILING_FLAG=-DCROSS_COMPILING
+else
+ CROSS_COMPILING_FLAG=
+fi
+AC_SUBST(CROSS_COMPILING_FLAG)
+
+if test -z "$CC_FOR_BUILD"; then
+ if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+ else
+ CC_FOR_BUILD=gcc
+ fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+
+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.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
@@ -54,8 +91,7 @@ AC_RETSIGTYPE
AC_HEADER_STAT
AC_HEADER_DIRENT
-AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
- strcasecmp tcgetattr)
+AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
AC_FUNC_STRCOLL
@@ -104,7 +140,7 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
@@ -118,20 +154,9 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
-
- # shared library versioning
- # quoted for m4 so I can use character classes
- SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
- SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
- AC_SUBST(SHLIB_MAJOR)
- AC_SUBST(SHLIB_MINOR)
fi
-case "$host_os" in
-msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
-*) BUILD_DIR=`pwd` ;;
-esac
-
+BUILD_DIR=`pwd`
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
diff --git a/readline/cross-build/cygwin.cache b/readline/cross-build/cygwin.cache
new file mode 100644
index 0000000..2fb0759
--- /dev/null
+++ b/readline/cross-build/cygwin.cache
@@ -0,0 +1,45 @@
+# This file is a shell script that caches the results of configure
+# tests for CYGWIN32 so they don't need to be done when cross-compiling.
+
+# AC_FUNC_GETPGRP should also define GETPGRP_VOID
+ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void='yes'}
+# AC_FUNC_SETVBUF_REVERSED should not define anything else
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed='no'}
+# on CYGWIN32, system calls do not restart
+ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'}
+bash_cv_sys_restartable_syscalls=${bash_cv_sys_restartable_syscalls='no'}
+
+# these may be necessary, but they are currently commented out
+#ac_cv_c_bigendian=${ac_cv_c_bigendian='no'}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p='4'}
+ac_cv_sizeof_int=${ac_cv_sizeof_int='4'}
+ac_cv_sizeof_long=${ac_cv_sizeof_long='4'}
+
+bash_cv_dup2_broken=${bash_cv_dup2_broken='no'}
+bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe='no'}
+bash_cv_type_rlimit=${bash_cv_type_rlimit='long'}
+bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist='no'}
+bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist='no'}
+bash_cv_sys_siglist=${bash_cv_sys_siglist='no'}
+bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust='no'}
+bash_cv_getenv_redef=${bash_cv_getenv_redef='yes'}
+bash_cv_printf_declared=${bash_cv_printf_declared='yes'}
+bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds='no'}
+bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen='no'}
+bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers='no'}
+bash_cv_job_control_missing=${bash_cv_job_control_missing='present'}
+bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes='missing'}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp='present'}
+bash_cv_mail_dir=${bash_cv_mail_dir='unknown'}
+bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken='no'}
+
+bash_cv_type_int32_t=${bash_cv_type_int32_t='int'}
+bash_cv_type_u_int32_t=${bash_cv_type_u_int32_t='int'}
+ac_cv_header_termcap_h=${ac_cv_header_termcap_h='yes'}
+ac_cv_header_termios_h=${ac_cv_header_termios_h='yes'}
+bash_cv_termcap_lib=${bash_cv_termcap_lib='-ltermcap'}
+
+bash_cv_tiocgwinsz_in_ioctl=${bash_cv_tiocgwinsz_in_ioctl='yes'}
+ac_cv_lib_termcap_tgetent=${ac_cv_lib_termcap_tgetent='yes'}
+
+# end of cross-build/cygwin32.cache
diff --git a/readline/display.c b/readline/display.c
index 4487004..3215a94 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -41,6 +41,11 @@
#include <stdio.h>
+#if defined (__GO32__)
+# include <go32.h>
+# include <pc.h>
+#endif /* __GO32__ */
+
/* System-specific feature definitions and include files. */
#include "rldefs.h"
@@ -51,25 +56,48 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "xmalloc.h"
-
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
-#if defined (HACK_TERMCAP_MOTION)
-extern char *term_forward_char;
+/* Global and pseudo-global variables and functions
+ imported from readline.c. */
+extern char *rl_prompt;
+extern int readline_echoing_p;
+
+extern int _rl_output_meta_chars;
+extern int _rl_horizontal_scroll_mode;
+extern int _rl_mark_modified_lines;
+extern int _rl_prefer_visible_bell;
+
+/* Variables and functions imported from terminal.c */
+extern void _rl_output_some_chars ();
+#ifdef _MINIX
+extern void _rl_output_character_function ();
+#else
+extern int _rl_output_character_function ();
#endif
+extern int _rl_backspace ();
+
+extern char *term_clreol, *term_clrpag;
+extern char *term_im, *term_ic, *term_ei, *term_DC;
+extern char *term_up, *term_dc, *term_cr, *term_IC;
+extern int screenheight, screenwidth, screenchars;
+extern int terminal_can_insert, _rl_term_autowrap;
-static void update_line __P((char *, char *, int, int, int, int));
-static void space_to_eol __P((int));
-static void delete_chars __P((int));
-static void insert_some_chars __P((char *, int));
-static void cr __P((void));
+/* Pseudo-global functions (local to the readline library) exported
+ by this file. */
+void _rl_move_cursor_relative (), _rl_output_some_chars ();
+void _rl_move_vert ();
+void _rl_clear_to_eol (), _rl_clear_screen ();
+
+static void update_line (), space_to_eol ();
+static void delete_chars (), insert_some_chars ();
+static void cr ();
static int *inv_lbreaks, *vis_lbreaks;
-static int inv_lbsize, vis_lbsize;
+
+extern char *xmalloc (), *xrealloc ();
/* Heuristic used to decide whether it is faster to move from CUR to NEW
by backing up or outputting a carriage return and moving forward. */
@@ -162,7 +190,7 @@ static int visible_first_line_len;
/* Expand the prompt string S and return the number of visible
characters in *LP, if LP is not null. This is currently more-or-less
a placeholder for expansion. LIP, if non-null is a place to store the
- index of the last invisible character in the returned string. */
+ index of the last invisible character in ther eturned string. */
/* Current implementation:
\001 (^A) start non-visible characters
@@ -222,18 +250,6 @@ expand_prompt (pmt, lp, lip)
return ret;
}
-/* Just strip out RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE from
- PMT and return the rest of PMT. */
-char *
-_rl_strip_prompt (pmt)
- char *pmt;
-{
- char *ret;
-
- ret = expand_prompt (pmt, (int *)NULL, (int *)NULL);
- return ret;
-}
-
/*
* Expand the prompt string into the various display components, if
* necessary.
@@ -291,49 +307,6 @@ rl_expand_prompt (prompt)
}
}
-/* Initialize the VISIBLE_LINE and INVISIBLE_LINE arrays, and their associated
- arrays of line break markers. MINSIZE is the minimum size of VISIBLE_LINE
- and INVISIBLE_LINE; if it is greater than LINE_SIZE, LINE_SIZE is
- increased. If the lines have already been allocated, this ensures that
- they can hold at least MINSIZE characters. */
-static void
-init_line_structures (minsize)
- int minsize;
-{
- register int n;
-
- if (invisible_line == 0) /* initialize it */
- {
- if (line_size < minsize)
- line_size = minsize;
- visible_line = xmalloc (line_size);
- invisible_line = xmalloc (line_size);
- }
- else if (line_size < minsize) /* ensure it can hold MINSIZE chars */
- {
- line_size *= 2;
- if (line_size < minsize)
- line_size = minsize;
- visible_line = xrealloc (visible_line, line_size);
- invisible_line = xrealloc (invisible_line, line_size);
- }
-
- for (n = minsize; n < line_size; n++)
- {
- visible_line[n] = 0;
- invisible_line[n] = 1;
- }
-
- if (vis_lbreaks == 0)
- {
- /* should be enough. */
- inv_lbsize = vis_lbsize = 256;
- inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
- vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
- inv_lbreaks[0] = vis_lbreaks[0] = 0;
- }
-}
-
/* Basic redisplay algorithm. */
void
rl_redisplay ()
@@ -352,7 +325,19 @@ rl_redisplay ()
if (invisible_line == 0)
{
- init_line_structures (0);
+ visible_line = xmalloc (line_size);
+ invisible_line = xmalloc (line_size);
+ for (in = 0; in < line_size; in++)
+ {
+ visible_line[in] = 0;
+ invisible_line[in] = 1;
+ }
+
+ /* should be enough, but then again, this is just for testing. */
+ inv_lbreaks = (int *)malloc (256 * sizeof (int));
+ vis_lbreaks = (int *)malloc (256 * sizeof (int));
+ inv_lbreaks[0] = vis_lbreaks[0] = 0;
+
rl_on_new_line ();
}
@@ -410,13 +395,12 @@ rl_redisplay ()
else
{
prompt_this_line++;
- pmtlen = prompt_this_line - rl_display_prompt; /* temp var */
if (forced_display)
{
- _rl_output_some_chars (rl_display_prompt, pmtlen);
+ _rl_output_some_chars (rl_display_prompt, prompt_this_line - rl_display_prompt);
/* Make sure we are at column zero even after a newline,
regardless of the state of terminal output processing. */
- if (pmtlen < 2 || prompt_this_line[-2] != '\r')
+ if (prompt_this_line[-2] != '\r')
cr ();
}
}
@@ -435,25 +419,11 @@ rl_redisplay ()
wrap_offset = 0;
}
-#define CHECK_INV_LBREAKS() \
- do { \
- if (newlines >= (inv_lbsize - 2)) \
- { \
- inv_lbsize *= 2; \
- inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
- } \
- } while (0)
-
#define CHECK_LPOS() \
do { \
lpos++; \
if (lpos >= screenwidth) \
{ \
- if (newlines >= (inv_lbsize - 2)) \
- { \
- inv_lbsize *= 2; \
- inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
- } \
inv_lbreaks[++newlines] = out; \
lpos = 0; \
} \
@@ -467,13 +437,14 @@ rl_redisplay ()
contents of the command line? */
while (lpos >= screenwidth)
{
+#if 0
+ temp = ((newlines + 1) * screenwidth) - ((newlines == 0) ? wrap_offset : 0);
+#else
/* XXX - possible fix from Darin Johnson <darin@acuson.com> for prompt
string with invisible characters that is longer than the screen
- width. XXX - this doesn't work right if invisible characters have
- to be put on the second screen line -- it adds too much (the number
- of invisible chars after the screenwidth). */
+ width. */
temp = ((newlines + 1) * screenwidth) + ((newlines == 0) ? wrap_offset : 0);
-
+#endif
inv_lbreaks[++newlines] = temp;
lpos -= screenwidth;
}
@@ -506,7 +477,6 @@ rl_redisplay ()
if (lpos + 4 >= screenwidth)
{
temp = screenwidth - lpos;
- CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out + temp;
lpos = 4 - temp;
}
@@ -536,7 +506,6 @@ rl_redisplay ()
{
register int temp2;
temp2 = screenwidth - lpos;
- CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out + temp2;
lpos = temp - temp2;
while (out < newout)
@@ -553,7 +522,6 @@ rl_redisplay ()
else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
{
line[out++] = '\0'; /* XXX - sentinel */
- CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out;
lpos = 0;
}
@@ -578,7 +546,6 @@ rl_redisplay ()
}
inv_botlin = lb_botlin = newlines;
- CHECK_INV_LBREAKS ();
inv_lbreaks[newlines+1] = out;
cursor_linenum = lb_linenum;
@@ -809,17 +776,11 @@ rl_redisplay ()
/* Swap visible and non-visible lines. */
{
char *temp = visible_line;
- int *itemp = vis_lbreaks, ntemp = vis_lbsize;
-
+ int *itemp = vis_lbreaks;
visible_line = invisible_line;
invisible_line = temp;
-
vis_lbreaks = inv_lbreaks;
inv_lbreaks = itemp;
-
- vis_lbsize = inv_lbsize;
- inv_lbsize = ntemp;
-
rl_display_fixed = 0;
/* If we are displaying on a single line, and last_lmargin is > 0, we
are not displaying any invisible characters, so set visible_wrap_offset
@@ -946,7 +907,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif
+#endif /* !__MSDOS__ */
_rl_output_some_chars (local_prompt, lendiff);
_rl_last_c_pos = lendiff;
}
@@ -1076,58 +1037,6 @@ rl_on_new_line ()
return 0;
}
-/* Tell the update routines that we have moved onto a new line with the
- prompt already displayed. Code originally from the version of readline
- distributed with CLISP. */
-int
-rl_on_new_line_with_prompt ()
-{
- int prompt_size, i, l, real_screenwidth, newlines;
- char *prompt_last_line;
-
- /* Initialize visible_line and invisible_line to ensure that they can hold
- the already-displayed prompt. */
- prompt_size = strlen (rl_prompt) + 1;
- init_line_structures (prompt_size);
-
- /* Make sure the line structures hold the already-displayed prompt for
- redisplay. */
- strcpy (visible_line, rl_prompt);
- strcpy (invisible_line, rl_prompt);
-
- /* If the prompt contains newlines, take the last tail. */
- prompt_last_line = strrchr (rl_prompt, '\n');
- if (!prompt_last_line)
- prompt_last_line = rl_prompt;
-
- l = strlen (prompt_last_line);
- _rl_last_c_pos = l;
-
- /* Dissect prompt_last_line into screen lines. Note that here we have
- to use the real screenwidth. Readline's notion of screenwidth might be
- one less, see terminal.c. */
- real_screenwidth = screenwidth + (_rl_term_autowrap ? 0 : 1);
- _rl_last_v_pos = l / real_screenwidth;
- /* If the prompt length is a multiple of real_screenwidth, we don't know
- whether the cursor is at the end of the last line, or already at the
- beginning of the next line. Output a newline just to be safe. */
- if (l > 0 && (l % real_screenwidth) == 0)
- _rl_output_some_chars ("\n", 1);
- last_lmargin = 0;
-
- newlines = 0; i = 0;
- while (i <= l)
- {
- _rl_vis_botlin = newlines;
- vis_lbreaks[newlines++] = i;
- i += real_screenwidth;
- }
- vis_lbreaks[newlines] = l;
- visible_wrap_offset = 0;
-
- return 0;
-}
-
/* Actually update the display, period. */
int
rl_forced_update_display ()
@@ -1185,6 +1094,8 @@ _rl_move_cursor_relative (new, data)
That kind of control is for people who don't know what the
data is underneath the cursor. */
#if defined (HACK_TERMCAP_MOTION)
+ extern char *term_forward_char;
+
if (term_forward_char)
for (i = _rl_last_c_pos; i < new; i++)
tputs (term_forward_char, 1, _rl_output_character_function);
@@ -1211,15 +1122,22 @@ _rl_move_vert (to)
if (_rl_last_v_pos == to || to > screenheight)
return;
+#if defined (__GO32__)
+ {
+ int row, col;
+
+ i = fflush (rl_outstream); /* make sure the cursor pos is current! */
+ ScreenGetCursor (&row, &col);
+ ScreenSetCursor ((row + to - _rl_last_v_pos), col);
+ delta = i;
+ }
+#else /* !__GO32__ */
+
if ((delta = to - _rl_last_v_pos) > 0)
{
for (i = 0; i < delta; i++)
putc ('\n', rl_outstream);
-#if defined (__MSDOS__)
- putc ('\r', rl_outstream);
-#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif
_rl_last_c_pos = 0;
}
else
@@ -1228,7 +1146,7 @@ _rl_move_vert (to)
for (i = 0; i < -delta; i++)
tputs (term_up, 1, _rl_output_character_function);
}
-
+#endif /* !__GO32__ */
_rl_last_v_pos = to; /* Now TO is here */
}
@@ -1436,9 +1354,11 @@ void
_rl_clear_to_eol (count)
int count;
{
+#if !defined (__GO32__)
if (term_clreol)
tputs (term_clreol, 1, _rl_output_character_function);
else if (count)
+#endif /* !__GO32__ */
space_to_eol (count);
}
@@ -1459,9 +1379,14 @@ space_to_eol (count)
void
_rl_clear_screen ()
{
+#if defined (__GO32__)
+ ScreenClear (); /* FIXME: only works in text modes */
+ ScreenSetCursor (0, 0); /* term_clrpag is "cl" which homes the cursor */
+#else
if (term_clrpag)
tputs (term_clrpag, 1, _rl_output_character_function);
else
+#endif /* !__GO32__ */
crlf ();
}
@@ -1471,6 +1396,21 @@ insert_some_chars (string, count)
char *string;
int count;
{
+#if defined (__GO32__)
+#ifndef __DJGPP__
+ int row, col, width;
+ char *row_start;
+
+ ScreenGetCursor (&row, &col);
+ width = ScreenCols ();
+ row_start = ScreenPrimary + (row * width);
+
+ memcpy (row_start + col + count, row_start + col, width - col - count);
+#endif /* !__DJGPP__ */
+ /* Place the text on the screen. */
+ _rl_output_some_chars (string, count);
+#else /* !_GO32 */
+
/* If IC is defined, then we do not have to "enter" insert mode. */
if (term_IC)
{
@@ -1503,6 +1443,7 @@ insert_some_chars (string, count)
if (term_ei && *term_ei)
tputs (term_ei, 1, _rl_output_character_function);
}
+#endif /* !__GO32__ */
}
/* Delete COUNT characters from the display line. */
@@ -1510,6 +1451,19 @@ static void
delete_chars (count)
int count;
{
+#if !defined (__DJGPP__)
+#if defined (__GO32__)
+ int row, col, width;
+ char *row_start;
+
+ ScreenGetCursor (&row, &col);
+ width = ScreenCols ();
+ row_start = ScreenPrimary + (row * width);
+
+ memcpy (row_start + col, row_start + col + count, width - col - count);
+ memset (row_start + width - count, 0, count * 2);
+#else /* !_GO32 */
+
if (count > screenwidth) /* XXX */
return;
@@ -1525,6 +1479,8 @@ delete_chars (count)
while (count--)
tputs (term_dc, 1, _rl_output_character_function);
}
+#endif /* !__GO32__ */
+#endif /* !__DJGPP__ */
}
void
@@ -1546,11 +1502,7 @@ _rl_update_final ()
if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == screenwidth))
{
char *last_line;
-#if 0
last_line = &visible_line[inv_lbreaks[_rl_vis_botlin]];
-#else
- last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]];
-#endif
_rl_move_cursor_relative (screenwidth - 1, last_line);
_rl_clear_to_eol (0);
putc (last_line[screenwidth - 1], rl_outstream);
@@ -1571,47 +1523,16 @@ cr ()
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif
+#endif /* !__MSDOS__ */
_rl_last_c_pos = 0;
}
}
-/* Redraw the last line of a multi-line prompt that may possibly contain
- terminal escape sequences. Called with the cursor at column 0 of the
- line to draw the prompt on. */
-static void
-redraw_prompt (t)
- char *t;
-{
- char *oldp, *oldl, *oldlprefix;
- int oldlen, oldlast, oldplen;
-
- /* Geez, I should make this a struct. */
- oldp = rl_display_prompt;
- oldl = local_prompt;
- oldlprefix = local_prompt_prefix;
- oldlen = visible_length;
- oldplen = prefix_length;
- oldlast = last_invisible;
-
- rl_display_prompt = t;
- local_prompt = expand_prompt (t, &visible_length, &last_invisible);
- local_prompt_prefix = (char *)NULL;
- rl_forced_update_display ();
-
- rl_display_prompt = oldp;
- local_prompt = oldl;
- local_prompt_prefix = oldlprefix;
- visible_length = oldlen;
- prefix_length = oldplen;
- last_invisible = oldlast;
-}
-
/* Redisplay the current line after a SIGWINCH is received. */
void
_rl_redisplay_after_sigwinch ()
{
- char *t;
+ char *t, *oldp, *oldl, *oldlprefix;
/* Clear the current line and put the cursor at column 0. Make sure
the right thing happens if we have wrapped to a new screen line. */
@@ -1621,7 +1542,7 @@ _rl_redisplay_after_sigwinch ()
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif
+#endif /* !__MSDOS__ */
_rl_last_c_pos = 0;
#if defined (__MSDOS__)
space_to_eol (screenwidth);
@@ -1644,7 +1565,17 @@ _rl_redisplay_after_sigwinch ()
/* Redraw only the last line of a multi-line prompt. */
t = strrchr (rl_display_prompt, '\n');
if (t)
- redraw_prompt (++t);
+ {
+ oldp = rl_display_prompt;
+ oldl = local_prompt;
+ oldlprefix = local_prompt_prefix;
+ rl_display_prompt = ++t;
+ local_prompt = local_prompt_prefix = (char *)NULL;
+ rl_forced_update_display ();
+ rl_display_prompt = oldp;
+ local_prompt = oldl;
+ local_prompt_prefix = oldlprefix;
+ }
else
rl_forced_update_display ();
}
@@ -1669,25 +1600,3 @@ _rl_erase_entire_line ()
cr ();
fflush (rl_outstream);
}
-
-/* return the `current display line' of the cursor -- the number of lines to
- move up to get to the first screen line of the current readline line. */
-int
-_rl_current_display_line ()
-{
- int ret, nleft;
-
- /* Find out whether or not there might be invisible characters in the
- editing buffer. */
- if (rl_display_prompt == rl_prompt)
- nleft = _rl_last_c_pos - screenwidth - rl_visible_prompt_length;
- else
- nleft = _rl_last_c_pos - screenwidth;
-
- if (nleft > 0)
- ret = 1 + nleft / screenwidth;
- else
- ret = 0;
-
- return ret;
-}
diff --git a/readline/doc/ChangeLog b/readline/doc/ChangeLog
new file mode 100644
index 0000000..3c26ae5
--- /dev/null
+++ b/readline/doc/ChangeLog
@@ -0,0 +1,53 @@
+Tue Apr 18 15:43:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * readline.0: Delete. Generated by Makefile, deleted by distclean
+ rule.
+
+Tue Mar 28 16:06:22 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inc-hist.texinfo, rluser.texinfo: Revert change Fri Mar 24
+ 18:04:32 2000 Andrew Cagney <cagney@b1.cygnus.com>.
+ Unconditionally provide @chapter and @node.
+
+Fri Mar 24 18:04:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inc-hist.texinfo: When GDBN omit the chapter/node.
+ * rluser.texinfo (Command Line Editing): Ditto.
+
+1999-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * hsuser.texinfo (Bash History Builtins): Comment out btindex
+ commands.
+
+ * inc-hist.texinfo: New file. Same as hsuser.texinfo, but w/o
+ cross reference to GNU History Manual.
+
+Tue Dec 22 10:07:58 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * hsuser.texinfo (Bash History Builtins): comment out btindex
+ commands.
+
+ * Import of Readline 2.2.1.
+
+ New files: readline.0, readline.3, texi2dvi, texi2html.
+
+1998-12-17 Felix Lee <flee@cygnus.com>
+
+ * inc-hist.texi: @node line "Using History" was wrong.
+
+Thu Jul 9 17:03:26 1998 Edith Epstein <eepstein@sophia.cygnus.com>
+
+ * inc-hist.texi: one line change.
+
+Wed Sep 20 12:57:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (maintainer-clean): New synonym for realclean.
+
+Tue Feb 2 11:40:04 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
+
+ * Makefile.in: configurable (and useable) Makefile template
+ * Makefile: removed, replaced with configurable Makefile.in
+ * texindex.c texinfo.tex: remove, replacing w/refs to tools
+ elsewhere in distribution tree
+ * configure.in: pro forma configure stub
+ * ChangeLog: new file
diff --git a/readline/doc/Makefile.in b/readline/doc/Makefile.in
index 4a38563..1031472 100644
--- a/readline/doc/Makefile.in
+++ b/readline/doc/Makefile.in
@@ -1,23 +1,6 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
-
-# Copyright (C) 1996 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
-
-topdir = @top_srcdir@
+top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = .:@srcdir@
@@ -25,33 +8,25 @@ prefix = @prefix@
infodir = @infodir@
mandir = @mandir@
-manpfx = man
-
-man1ext = 1
-man1dir = $(mandir)/$(manpfx)$(man1ext)
-man3ext = 3
-man3dir = $(mandir)/$(manpfx)$(man3ext)
+man3dir = $(mandir)/man3
SHELL = @MAKE_SHELL@
RM = rm -f
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-BUILD_DIR = @BUILD_DIR@
TEXINPUTDIR = $(srcdir)
-MAKEINFO = LANGUAGE= makeinfo
+MAKEINFO = makeinfo
TEXI2DVI = $(srcdir)/texi2dvi
TEXI2HTML = $(srcdir)/texi2html
QUIETPS = #set this to -q to shut up dvips
-PAPERSIZE = letter
-PSDPI = 300 # I don't have any 600-dpi printers
-DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky
+DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
- $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo \
- $(srcdir)/rluserman.texinfo
+ $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
$(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo
@@ -61,15 +36,16 @@ NROFF = groff -Tascii
# This should be a program that converts troff to postscript
GROFF = groff
-DVIOBJ = readline.dvi history.dvi rluserman.dvi
-INFOOBJ = readline.info history.info rluserman.info
-PSOBJ = readline.ps history.ps rluserman.ps
-HTMLOBJ = readline.html history.html rluserman.html
+DVIOBJ = readline.dvi history.dvi
+INFOOBJ = readline.info history.info
+PSOBJ = readline.ps history.ps
+HTMLOBJ = readline.html history.html
+HTMLTOC = readline_toc.html history_toc.html
TEXTOBJ = readline.0
-INTERMEDIATE_OBJ = rlman.dvi hist.dvi rluserman.dvi
+INTERMEDIATE_OBJ = rlman.dvi hist.dvi
-CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(TEXTOBJ)
+CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
.SUFFIXES: .0 .3 .ps .txt .dvi
@@ -87,12 +63,6 @@ readline.dvi: $(RLSRC)
readline.info: $(RLSRC)
$(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texinfo
-rluserman.dvi: $(RLSRC)
- TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rluserman.texinfo
-
-rluserman.info: $(RLSRC)
- $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rluserman.texinfo
-
history.dvi: ${HISTSRC}
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/hist.texinfo
mv hist.dvi history.dvi
@@ -104,25 +74,18 @@ readline.ps: readline.dvi
$(RM) $@
$(DVIPS) readline.dvi
-rluserman.ps: rluserman.dvi
- $(RM) $@
- $(DVIPS) rluserman.dvi
-
history.ps: history.dvi
$(RM) $@
$(DVIPS) history.dvi
readline.html: ${RLSRC}
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
- sed -e 's:rlman.html:readline.html:g' rlman.html > readline.html
+ sed -e 's:rlman.html:readline.html:' rlman.html > readline.html
$(RM) rlman.html
-rluserman.html: ${RLSRC}
- $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rluserman.texinfo
-
history.html: ${HISTSRC}
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
- sed -e 's:hist.html:history.html:g' hist.html > history.html
+ sed -e 's:hist.html:history.html:' hist.html > history.html
$(RM) hist.html
info: $(INFOOBJ)
@@ -135,7 +98,7 @@ readline.0: readline.3
clean:
$(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \
- *.fns *.kys *.tps *.vrs *.bt *.bts *.o core
+ *.fns *.kys *.tps *.vrs *.o core
distclean: clean
$(RM) $(CREATED_DOCS)
@@ -149,8 +112,8 @@ maintainer-clean: clean
$(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
-installdirs: $(topdir)/support/mkdirs
- -$(SHELL) $(topdir)/support/mkdirs $(infodir) $(man3dir)
+installdirs: $(top_srcdir)/support/mkdirs
+ -$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
install: installdirs
if test -f readline.info; then \
@@ -158,17 +121,12 @@ install: installdirs
else \
${INSTALL_DATA} $(srcdir)/readline.info $(infodir)/readline.info; \
fi
- if test -f rluserman.info; then \
- ${INSTALL_DATA} rluserman.info $(infodir)/rluserman.info; \
- else \
- ${INSTALL_DATA} $(srcdir)/rluserman.info $(infodir)/rluserman.info; \
- fi
if test -f history.info; then \
${INSTALL_DATA} history.info $(infodir)/history.info; \
else \
${INSTALL_DATA} $(srcdir)/history.info $(infodir)/history.info; \
fi
- -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir $(infodir)/readline.info ; \
install-info --dir-file=$(infodir)/dir $(infodir)/history.info ; \
else true; fi
@@ -176,6 +134,5 @@ install: installdirs
uninstall:
$(RM) $(infodir)/readline.info
- $(RM) $(infodir)/rluserman.info
$(RM) $(infodir)/history.info
$(RM) $(man3dir)/readline.3
diff --git a/readline/doc/hist.texinfo b/readline/doc/hist.texinfo
index 8a9c941..31a0ba0 100644
--- a/readline/doc/hist.texinfo
+++ b/readline/doc/hist.texinfo
@@ -55,8 +55,8 @@ provides a consistent user interface for recalling lines of previously
typed input.
Published by the Free Software Foundation @*
-59 Temple Place, Suite 330, @*
-Boston, MA 02111 USA
+675 Massachusetts Avenue, @*
+Cambridge, MA 02139 USA
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
diff --git a/readline/doc/hstech.texinfo b/readline/doc/hstech.texinfo
index 12fff2c..5410090 100644
--- a/readline/doc/hstech.texinfo
+++ b/readline/doc/hstech.texinfo
@@ -66,13 +66,6 @@ If the programmer desires, he can use the Readline library, which
includes some history manipulation by default, and has the added
advantage of command line editing.
-Before declaring any functions using any functionality the History
-library provides in other code, an application writer should include
-the file @code{<readline/history.h>} in any file that uses the
-History library's features. It supplies extern declarations for all
-of the library's public functions and variables, and declares all of
-the public data structures.
-
@node History Storage
@section History Storage
@@ -341,7 +334,7 @@ if expansions did take place;
@item -1
if there was an error in expansion;
@item 2
-if the returned line should be displayed, but not executed,
+if the returned line should only be displayed, but not executed,
as with the @code{:p} modifier (@pxref{Modifiers}).
@end table
diff --git a/readline/doc/hsuser.texinfo b/readline/doc/hsuser.texinfo
index 5f75f5d..7c4582d 100644
--- a/readline/doc/hsuser.texinfo
+++ b/readline/doc/hsuser.texinfo
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
-Copyright (C) 1988-1999 Free Software Foundation, Inc.
+Copyright (C) 1988, 1991, 1996 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
@@ -26,16 +26,11 @@ into another language, under the above conditions for modified versions.
@node Using History Interactively
@chapter Using History Interactively
-@ifclear BashFeatures
-@defcodeindex bt
-@end ifclear
-
@ifset BashFeatures
-This chapter describes how to use the @sc{gnu} History Library
-interactively, from a user's standpoint.
-It should be considered a user's guide.
-For information on using the @sc{gnu} History Library in other programs,
-see the @sc{gnu} Readline Library Manual.
+This chapter describes how to use the GNU History Library interactively,
+from a user's standpoint. It should be considered a user's guide. For
+information on using the GNU History Library in other programs,
+see the GNU Readline Library Manual.
@end ifset
@ifclear BashFeatures
This chapter describes how to use the GNU History Library interactively,
@@ -68,25 +63,20 @@ information on using the GNU History Library in your own programs,
When the @samp{-o history} option to the @code{set} builtin
is enabled (@pxref{The Set Builtin}),
the shell provides access to the @var{command history},
-the list of commands previously typed.
-The value of the @code{HISTSIZE} shell variable is used as the
-number of commands to save in a history list.
-The text of the last @code{$HISTSIZE}
-commands (default 500) is saved.
-The shell stores each command in the history list prior to
-parameter and variable expansion
+the list of commands previously typed. The text of the last
+@code{HISTSIZE}
+commands (default 500) is saved in a history list. The shell
+stores each command in the history list prior to parameter and
+variable expansion
but after history expansion is performed, subject to the
values of the shell variables
@code{HISTIGNORE} and @code{HISTCONTROL}.
-
When the shell starts up, the history is initialized from the
file named by the @code{HISTFILE} variable (default @file{~/.bash_history}).
-The file named by the value of @code{HISTFILE} is truncated, if
-necessary, to contain no more than the number of lines specified by
-the value of the @code{HISTFILESIZE} variable.
-When an interactive shell exits, the last
-@code{$HISTSIZE} lines are copied from the history list to the file
-named by @code{$HISTFILE}.
+@code{HISTFILE} is truncated, if necessary, to contain no more than
+the number of lines specified by the value of the @code{HISTFILESIZE}
+variable. When an interactive shell exits, the last
+@code{HISTSIZE} lines are copied from the history list to @code{HISTFILE}.
If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
the lines are appended to the history file,
otherwise the history file is overwritten.
@@ -98,11 +88,11 @@ lines. If @code{HISTFILESIZE} is not set, no truncation is performed.
The builtin command @code{fc} may be used to list or edit and re-execute
a portion of the history list.
-The @code{history} builtin may be used to display or modify the history
+The @code{history} builtin can be used to display or modify the history
list and manipulate the history file.
-When using command-line editing, search commands
+When using the command-line editing, search commands
are available in each editing mode that provide access to the
-history list (@pxref{Commands For History}).
+history list.
The shell allows control over which commands are saved on the history
list. The @code{HISTCONTROL} and @code{HISTIGNORE}
@@ -115,20 +105,19 @@ semicolons where necessary to preserve syntactic correctness.
The @code{lithist}
shell option causes the shell to save the command with embedded newlines
instead of semicolons.
-The @code{shopt} builtin is used to set these options.
@xref{Bash Builtins}, for a description of @code{shopt}.
@node Bash History Builtins
@section Bash History Builtins
@cindex history builtins
-Bash provides two builtin commands which manipulate the
+Bash provides two builtin commands that allow you to manipulate the
history list and history file.
@table @code
@item fc
-@btindex fc
+@comment btindex fc
@example
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
@@ -160,29 +149,25 @@ that typing @samp{r cc} runs the last command beginning with @code{cc}
and typing @samp{r} re-executes the last command (@pxref{Aliases}).
@item history
-@btindex history
+@comment btindex history
@example
-history [@var{n}]
-history -c
-history -d @var{offset}
+history [-c] [@var{n}]
history [-anrw] [@var{filename}]
history -ps @var{arg}
@end example
-With no options, display the history list with line numbers.
-Lines prefixed with with a @samp{*} have been modified.
-An argument of @var{n} lists only the last @var{n} lines.
-Options, if supplied, have the following meanings:
+Display the history list with line numbers. Lines prefixed with
+with a @samp{*} have been modified. An argument of @var{n} says
+to list only the last @var{n} lines. Options, if supplied, have
+the following meanings:
@table @code
-@item -c
-Clear the history list. This may be combined
-with the other options to replace the history list completely.
+@item -w
+Write out the current history to the history file.
-@item -d @var{offset}
-Delete the history entry at position @var{offset}.
-@var{offset} should be specified as it appears when the history is
-displayed.
+@item -r
+Read the current history file and append its contents to
+the history list.
@item -a
Append the new
@@ -194,24 +179,20 @@ Append the history lines not already read from the history file
to the current history list. These are lines appended to the history
file since the beginning of the current Bash session.
-@item -r
-Read the current history file and append its contents to
-the history list.
-
-@item -w
-Write out the current history to the history file.
-
-@item -p
-Perform history substitution on the @var{arg}s and display the result
-on the standard output, without storing the results in the history list.
+@item -c
+Clear the history list. This may be combined
+with the other options to replace the history list completely.
@item -s
The @var{arg}s are added to the end of
the history list as a single entry.
+@item -p
+Perform history substitution on the @var{arg}s and display the result
+on the standard output, without storing the results in the history list.
@end table
-When any of the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} options is
+When the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} option is
used, if @var{filename}
is given, then it is used as the history file. If not, then
the value of the @code{HISTFILE} variable is used.
@@ -328,26 +309,6 @@ may be omitted if the word designator begins with a @samp{^}, @samp{$},
of the line, with the first word being denoted by 0 (zero). Words are
inserted into the current line separated by single spaces.
-@need 0.75
-For example,
-
-@table @code
-@item !!
-designates the preceding command. When you type this, the preceding
-command is repeated in toto.
-
-@item !!:$
-designates the last argument of the preceding command. This may be
-shortened to @code{!$}.
-
-@item !fi:2
-designates the second argument of the most recent command starting with
-the letters @code{fi}.
-@end table
-
-@need 0.75
-Here are the word designators:
-
@table @code
@item 0 (zero)
diff --git a/readline/doc/inc-hist.texinfo b/readline/doc/inc-hist.texinfo
new file mode 100644
index 0000000..06774b7
--- /dev/null
+++ b/readline/doc/inc-hist.texinfo
@@ -0,0 +1,399 @@
+@ignore
+This file documents the user interface to the GNU History library.
+
+Copyright (C) 1988, 1991, 1996 Free Software Foundation, Inc.
+Authored by Brian Fox and Chet Ramey.
+
+Permission is granted to make and distribute verbatim copies of this manual
+provided the copyright notice and this permission notice are preserved on
+all copies.
+
+Permission is granted to process this file through Tex and print the
+results, provided the printed document carries copying permission notice
+identical to this one except for the removal of this paragraph (this
+paragraph not being relevant to the printed manual).
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+GNU Copyright statement is available to the distributee, and provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions.
+@end ignore
+
+@node Using History Interactively
+@chapter Using History Interactively
+
+@ifset BashFeatures
+This chapter describes how to use the GNU History Library interactively,
+from a user's standpoint. It should be considered a user's guide. For
+information on using the GNU History Library in other programs,
+see the GNU Readline Library Manual.
+@end ifset
+@ifclear BashFeatures
+This chapter describes how to use the GNU History Library interactively,
+from a user's standpoint. It should be considered a user's guide.
+@c For
+@c information on using the GNU History Library in your own programs,
+@c @pxref{Programming with GNU History}.
+@end ifclear
+
+@ifset BashFeatures
+@menu
+* Bash History Facilities:: How Bash lets you manipulate your command
+ history.
+* Bash History Builtins:: The Bash builtin commands that manipulate
+ the command history.
+* History Interaction:: What it feels like using History as a user.
+@end menu
+@end ifset
+@ifclear BashFeatures
+@menu
+* History Interaction:: What it feels like using History as a user.
+@end menu
+@end ifclear
+
+@ifset BashFeatures
+@node Bash History Facilities
+@section Bash History Facilities
+@cindex command history
+@cindex history list
+
+When the @samp{-o history} option to the @code{set} builtin
+is enabled (@pxref{The Set Builtin}),
+the shell provides access to the @var{command history},
+the list of commands previously typed. The text of the last
+@code{HISTSIZE}
+commands (default 500) is saved in a history list. The shell
+stores each command in the history list prior to parameter and
+variable expansion
+but after history expansion is performed, subject to the
+values of the shell variables
+@code{HISTIGNORE} and @code{HISTCONTROL}.
+When the shell starts up, the history is initialized from the
+file named by the @code{HISTFILE} variable (default @file{~/.bash_history}).
+@code{HISTFILE} is truncated, if necessary, to contain no more than
+the number of lines specified by the value of the @code{HISTFILESIZE}
+variable. When an interactive shell exits, the last
+@code{HISTSIZE} lines are copied from the history list to @code{HISTFILE}.
+If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
+the lines are appended to the history file,
+otherwise the history file is overwritten.
+If @code{HISTFILE}
+is unset, or if the history file is unwritable, the history is
+not saved. After saving the history, the history file is truncated
+to contain no more than @code{$HISTFILESIZE}
+lines. If @code{HISTFILESIZE} is not set, no truncation is performed.
+
+The builtin command @code{fc} may be used to list or edit and re-execute
+a portion of the history list.
+The @code{history} builtin can be used to display or modify the history
+list and manipulate the history file.
+When using the command-line editing, search commands
+are available in each editing mode that provide access to the
+history list.
+
+The shell allows control over which commands are saved on the history
+list. The @code{HISTCONTROL} and @code{HISTIGNORE}
+variables may be set to cause the shell to save only a subset of the
+commands entered.
+The @code{cmdhist}
+shell option, if enabled, causes the shell to attempt to save each
+line of a multi-line command in the same history entry, adding
+semicolons where necessary to preserve syntactic correctness.
+The @code{lithist}
+shell option causes the shell to save the command with embedded newlines
+instead of semicolons.
+@xref{Bash Builtins}, for a description of @code{shopt}.
+
+@node Bash History Builtins
+@section Bash History Builtins
+@cindex history builtins
+
+Bash provides two builtin commands that allow you to manipulate the
+history list and history file.
+
+@table @code
+
+@item fc
+@c btindex fc
+@example
+@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
+@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
+@end example
+
+Fix Command. In the first form, a range of commands from @var{first} to
+@var{last} is selected from the history list. Both @var{first} and
+@var{last} may be specified as a string (to locate the most recent
+command beginning with that string) or as a number (an index into the
+history list, where a negative number is used as an offset from the
+current command number). If @var{last} is not specified it is set to
+@var{first}. If @var{first} is not specified it is set to the previous
+command for editing and @minus{}16 for listing. If the @samp{-l} flag is
+given, the commands are listed on standard output. The @samp{-n} flag
+suppresses the command numbers when listing. The @samp{-r} flag
+reverses the order of the listing. Otherwise, the editor given by
+@var{ename} is invoked on a file containing those commands. If
+@var{ename} is not given, the value of the following variable expansion
+is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}. This says to use the
+value of the @code{FCEDIT} variable if set, or the value of the
+@code{EDITOR} variable if that is set, or @code{vi} if neither is set.
+When editing is complete, the edited commands are echoed and executed.
+
+In the second form, @var{command} is re-executed after each instance
+of @var{pat} in the selected command is replaced by @var{rep}.
+
+A useful alias to use with the @code{fc} command is @code{r='fc -s'}, so
+that typing @samp{r cc} runs the last command beginning with @code{cc}
+and typing @samp{r} re-executes the last command (@pxref{Aliases}).
+
+@item history
+@c btindex history
+@example
+history [-c] [@var{n}]
+history [-anrw] [@var{filename}]
+history -ps @var{arg}
+@end example
+
+Display the history list with line numbers. Lines prefixed with
+with a @samp{*} have been modified. An argument of @var{n} says
+to list only the last @var{n} lines. Options, if supplied, have
+the following meanings:
+
+@table @code
+@item -w
+Write out the current history to the history file.
+
+@item -r
+Read the current history file and append its contents to
+the history list.
+
+@item -a
+Append the new
+history lines (history lines entered since the beginning of the
+current Bash session) to the history file.
+
+@item -n
+Append the history lines not already read from the history file
+to the current history list. These are lines appended to the history
+file since the beginning of the current Bash session.
+
+@item -c
+Clear the history list. This may be combined
+with the other options to replace the history list completely.
+
+@item -s
+The @var{arg}s are added to the end of
+the history list as a single entry.
+
+@item -p
+Perform history substitution on the @var{arg}s and display the result
+on the standard output, without storing the results in the history list.
+@end table
+
+When the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} option is
+used, if @var{filename}
+is given, then it is used as the history file. If not, then
+the value of the @code{HISTFILE} variable is used.
+
+@end table
+@end ifset
+
+@node History Interaction
+@section History Expansion
+@cindex history expansion
+
+The History library provides a history expansion feature that is similar
+to the history expansion provided by @code{csh}. This section
+describes the syntax used to manipulate the history information.
+
+History expansions introduce words from the history list into
+the input stream, making it easy to repeat commands, insert the
+arguments to a previous command into the current input line, or
+fix errors in previous commands quickly.
+
+History expansion takes place in two parts. The first is to determine
+which line from the history list should be used during substitution.
+The second is to select portions of that line for inclusion into the
+current one. The line selected from the history is called the
+@dfn{event}, and the portions of that line that are acted upon are
+called @dfn{words}. Various @dfn{modifiers} are available to manipulate
+the selected words. The line is broken into words in the same fashion
+that Bash does, so that several words
+surrounded by quotes are considered one word.
+History expansions are introduced by the appearance of the
+history expansion character, which is @samp{!} by default.
+@ifset BashFeatures
+Only @samp{\} and @samp{'} may be used to escape the history expansion
+character.
+@end ifset
+
+@ifset BashFeatures
+Several shell options settable with the @code{shopt}
+builtin (@pxref{Bash Builtins}) may be used to tailor
+the behavior of history expansion. If the
+@code{histverify} shell option is enabled, and Readline
+is being used, history substitutions are not immediately passed to
+the shell parser.
+Instead, the expanded line is reloaded into the Readline
+editing buffer for further modification.
+If Readline is being used, and the @code{histreedit}
+shell option is enabled, a failed history expansion will be
+reloaded into the Readline editing buffer for correction.
+The @samp{-p} option to the @code{history} builtin command
+may be used to see what a history expansion will do before using it.
+The @samp{-s} option to the @code{history} builtin may be used to
+add commands to the end of the history list without actually executing
+them, so that they are available for subsequent recall.
+This is most useful in conjunction with Readline.
+
+The shell allows control of the various characters used by the
+history expansion mechanism with the @code{histchars} variable.
+@end ifset
+
+@menu
+* Event Designators:: How to specify which history line to use.
+* Word Designators:: Specifying which words are of interest.
+* Modifiers:: Modifying the results of substitution.
+@end menu
+
+@node Event Designators
+@subsection Event Designators
+@cindex event designators
+
+An event designator is a reference to a command line entry in the
+history list.
+@cindex history events
+
+@table @asis
+
+@item @code{!}
+Start a history substitution, except when followed by a space, tab,
+the end of the line, @samp{=} or @samp{(}.
+
+@item @code{!@var{n}}
+Refer to command line @var{n}.
+
+@item @code{!-@var{n}}
+Refer to the command @var{n} lines back.
+
+@item @code{!!}
+Refer to the previous command. This is a synonym for @samp{!-1}.
+
+@item @code{!@var{string}}
+Refer to the most recent command starting with @var{string}.
+
+@item @code{!?@var{string}[?]}
+Refer to the most recent command containing @var{string}. The trailing
+@samp{?} may be omitted if the @var{string} is followed immediately by
+a newline.
+
+@item @code{^@var{string1}^@var{string2}^}
+Quick Substitution. Repeat the last command, replacing @var{string1}
+with @var{string2}. Equivalent to
+@code{!!:s/@var{string1}/@var{string2}/}.
+
+@item @code{!#}
+The entire command line typed so far.
+
+@end table
+
+@node Word Designators
+@subsection Word Designators
+
+Word designators are used to select desired words from the event.
+A @samp{:} separates the event specification from the word designator. It
+may be omitted if the word designator begins with a @samp{^}, @samp{$},
+@samp{*}, @samp{-}, or @samp{%}. Words are numbered from the beginning
+of the line, with the first word being denoted by 0 (zero). Words are
+inserted into the current line separated by single spaces.
+
+@table @code
+
+@item 0 (zero)
+The @code{0}th word. For many applications, this is the command word.
+
+@item @var{n}
+The @var{n}th word.
+
+@item ^
+The first argument; that is, word 1.
+
+@item $
+The last argument.
+
+@item %
+The word matched by the most recent @samp{?@var{string}?} search.
+
+@item @var{x}-@var{y}
+A range of words; @samp{-@var{y}} abbreviates @samp{0-@var{y}}.
+
+@item *
+All of the words, except the @code{0}th. This is a synonym for @samp{1-$}.
+It is not an error to use @samp{*} if there is just one word in the event;
+the empty string is returned in that case.
+
+@item @var{x}*
+Abbreviates @samp{@var{x}-$}
+
+@item @var{x}-
+Abbreviates @samp{@var{x}-$} like @samp{@var{x}*}, but omits the last word.
+
+@end table
+
+If a word designator is supplied without an event specification, the
+previous command is used as the event.
+
+@node Modifiers
+@subsection Modifiers
+
+After the optional word designator, you can add a sequence of one or more
+of the following modifiers, each preceded by a @samp{:}.
+
+@table @code
+
+@item h
+Remove a trailing pathname component, leaving only the head.
+
+@item t
+Remove all leading pathname components, leaving the tail.
+
+@item r
+Remove a trailing suffix of the form @samp{.@var{suffix}}, leaving
+the basename.
+
+@item e
+Remove all but the trailing suffix.
+
+@item p
+Print the new command but do not execute it.
+
+@ifset BashFeatures
+@item q
+Quote the substituted words, escaping further substitutions.
+
+@item x
+Quote the substituted words as with @samp{q},
+but break into words at spaces, tabs, and newlines.
+@end ifset
+
+@item s/@var{old}/@var{new}/
+Substitute @var{new} for the first occurrence of @var{old} in the
+event line. Any delimiter may be used in place of @samp{/}.
+The delimiter may be quoted in @var{old} and @var{new}
+with a single backslash. If @samp{&} appears in @var{new},
+it is replaced by @var{old}. A single backslash will quote
+the @samp{&}. The final delimiter is optional if it is the last
+character on the input line.
+
+@item &
+Repeat the previous substitution.
+
+@item g
+Cause changes to be applied over the entire event line. Used in
+conjunction with @samp{s}, as in @code{gs/@var{old}/@var{new}/},
+or with @samp{&}.
+
+@end table
diff --git a/readline/doc/manvers.texinfo b/readline/doc/manvers.texinfo
index 3122b6c..63924e3 100644
--- a/readline/doc/manvers.texinfo
+++ b/readline/doc/manvers.texinfo
@@ -1,6 +1,6 @@
-@set EDITION 4.1
-@set VERSION 4.1
-@set UPDATED 2000 January 19
-@set UPDATE-MONTH January 2000
+@set EDITION 4.0
+@set VERSION 4.0
+@set UPDATED 31 December 1998
+@set UPDATE-MONTH December 1998
-@set LASTCHANGE Wed Jan 19 12:16:30 EST 2000
+@set LASTCHANGE Thu Dec 31 10:17:05 EST 1998
diff --git a/readline/doc/readline.0 b/readline/doc/readline.0
deleted file mode 100644
index 8d453cd..0000000
--- a/readline/doc/readline.0
+++ /dev/null
@@ -1,1188 +0,0 @@
-
-
-
-READLINE(3) READLINE(3)
-
-
-NNAAMMEE
- readline - get a line from a user with editing
-
-SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssttddiioo..hh>>
- ##iinncclluuddee <<rreeaaddlliinnee..hh>>
- ##iinncclluuddee <<hhiissttoorryy..hh>>
-
- cchhaarr **rreeaaddlliinnee ((pprroommpptt))
- cchhaarr **pprroommpptt;;
-
-CCOOPPYYRRIIGGHHTT
- Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by
- the Free Software Foundation, Inc.
-
-DDEESSCCRRIIPPTTIIOONN
- rreeaaddlliinnee will read a line from the terminal and return it,
- using pprroommpptt as a prompt. If pprroommpptt is null, no prompt is
- issued. The line returned is allocated with _m_a_l_l_o_c(3), so
- the caller must free it when finished. The line returned
- has the final newline removed, so only the text of the
- line remains.
-
- rreeaaddlliinnee offers editing capabilities while the user is
- entering the line. By default, the line editing commands
- are similar to those of emacs. A vi-style line editing
- interface is also available.
-
-RREETTUURRNN VVAALLUUEE
- rreeaaddlliinnee returns the text of the line read. A blank line
- returns the empty string. If EEOOFF is encountered while
- reading a line, and the line is empty, NNUULLLL is returned.
- If an EEOOFF is read with a non-empty line, it is treated as
- a newline.
-
-NNOOTTAATTIIOONN
- An emacs-style notation is used to denote keystrokes.
- Control keys are denoted by C-_k_e_y, e.g., C-n means Con-
- trol-N. Similarly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x
- means Meta-X. (On keyboards without a _m_e_t_a key, M-_x means
- ESC _x, i.e., press the Escape key then the _x key. This
- makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means
- ESC-Control-_x, or press the Escape key then hold the Con-
- trol key while pressing the _x key.)
-
- Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which
- normally act as a repeat count. Sometimes, however, it is
- the sign of the argument that is significant. Passing a
- negative argument to a command that acts in the forward
- direction (e.g., kkiillll--lliinnee) causes that command to act in
- a backward direction. Commands whose behavior with argu-
- ments deviates from this are noted.
-
- When a command is described as _k_i_l_l_i_n_g text, the text
-
-
-
-GNU 1999 Jun 1 1
-
-
-
-
-
-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
- kills cause the text to be accumulated into one unit,
- which can be yanked all at once. Commands which do not
- kill text separate the chunks of text on the kill ring.
-
-IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
- Readline is customized by putting commands in an initial-
- ization file (the _i_n_p_u_t_r_c file). The name of this file is
- taken from the value of the IINNPPUUTTRRCC environment variable.
- If that variable is unset, the default is _~_/_._i_n_p_u_t_r_c.
- When a program which uses the readline library starts up,
- the init file is read, and the key bindings and variables
- are set. There are only a few basic constructs allowed in
- the readline init file. Blank lines are ignored. Lines
- beginning with a ## are comments. Lines beginning with a $$
- indicate conditional constructs. Other lines denote key
- bindings and variable settings. Each program using this
- library may add its own commands and bindings.
-
- For example, placing
-
- M-Control-u: universal-argument
- or
- C-Meta-u: universal-argument
- into the _i_n_p_u_t_r_c would make M-C-u execute the readline
- command _u_n_i_v_e_r_s_a_l_-_a_r_g_u_m_e_n_t.
-
- The following symbolic character names are recognized
- while processing key bindings: _R_U_B_O_U_T, _D_E_L, _E_S_C, _L_F_D, _N_E_W_-
- _L_I_N_E, _R_E_T, _R_E_T_U_R_N, _S_P_C, _S_P_A_C_E, and _T_A_B.
-
- In addition to command names, readline allows keys to be
- bound to a string that is inserted when the key is pressed
- (a _m_a_c_r_o).
-
-
- KKeeyy BBiinnddiinnggss
- The syntax for controlling key bindings in the _i_n_p_u_t_r_c
- file is simple. All that is required is the name of the
- command or the text of a macro and a key sequence to which
- it should be bound. The name may be specified in one of
- two ways: as a symbolic key name, possibly with _M_e_t_a_- or
- _C_o_n_t_r_o_l_- prefixes, or as a key sequence. When using the
- form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_n_a_m_e is the name
- of a key spelled out in English. For example:
-
- Control-u: universal-argument
- Meta-Rubout: backward-kill-word
- Control-o: ">&output"
-
- In the above example, _C_-_u is bound to the function uunniivveerr--
- ssaall--aarrgguummeenntt, _M_-_D_E_L is bound to the function bbaacckk--
- wwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to run the macro
-
-
-
-GNU 1999 Jun 1 2
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- expressed on the right hand side (that is, to insert the
- text _>_&_o_u_t_p_u_t into the line).
-
- In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyy--
- sseeqq differs from kkeeyynnaammee above in that strings denoting an
- entire key sequence may be specified by placing the
- sequence within double quotes. Some GNU Emacs style key
- escapes can be used, as in the following example.
-
- "\C-u": universal-argument
- "\C-x\C-r": re-read-init-file
- "\e[11~": "Function Key 1"
-
- In this example, _C_-_u is again bound to the function uunnii--
- vveerrssaall--aarrgguummeenntt. _C_-_x _C_-_r is bound to the function
- rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is bound to insert the
- text FFuunnccttiioonn KKeeyy 11. The full set of GNU Emacs style
- escape sequences is
- \\CC-- control prefix
- \\MM-- meta prefix
- \\ee an escape character
- \\\\ backslash
- \\"" literal "
- \\'' literal '
-
- In addition to the GNU Emacs style escape sequences, a
- second set of backslash escapes is available:
- \\aa alert (bell)
- \\bb backspace
- \\dd delete
- \\ff form feed
- \\nn newline
- \\rr carriage return
- \\tt horizontal tab
- \\vv vertical tab
- \\_n_n_n the character whose ASCII code is the octal
- value _n_n_n (one to three digits)
- \\xx_n_n_n the character whose ASCII code is the hex-
- adecimal value _n_n_n (one to three digits)
-
- When entering the text of a macro, single or double quotes
- should be used to indicate a macro definition. Unquoted
- text is assumed to be a function name. In the macro body,
- the backslash escapes described above are expanded. Back-
- slash will quote any other character in the macro text,
- including " and '.
-
- BBaasshh allows the current readline key bindings to be dis-
- played or modified with the bbiinndd builtin command. The
- editing mode may be switched during interactive use by
- using the --oo option to the sseett builtin command. Other
- programs using this library provide similar mechanisms.
- The _i_n_p_u_t_r_c file may be edited and re-read if a program
- does not provide any other means to incorporate new
-
-
-
-GNU 1999 Jun 1 3
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- bindings.
-
- VVaarriiaabblleess
- Readline has variables that can be used to further cus-
- tomize its behavior. A variable may be set in the _i_n_p_u_t_r_c
- file with a statement of the form
-
- sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e
-
- Except where noted, readline variables can take the values
- OOnn or OOffff. The variables and their default values are:
-
- bbeellll--ssttyyllee ((aauuddiibbllee))
- Controls what happens when readline wants to ring
- the terminal bell. If set to nnoonnee, readline never
- rings the bell. If set to vviissiibbllee, readline uses a
- visible bell if one is available. If set to aauuddii--
- bbllee, readline attempts to ring the terminal's bell.
- ccoommmmeenntt--bbeeggiinn ((````##''''))
- The string that is inserted in vvii mode when the
- iinnsseerrtt--ccoommmmeenntt command is executed. This command
- is bound to MM--## in emacs mode and to ## in vi com-
- mand mode.
- ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff))
- If set to OOnn, readline performs filename matching
- and completion in a case-insensitive fashion.
- ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000))
- This determines when the user is queried about
- viewing the number of possible completions gener-
- ated by the ppoossssiibbllee--ccoommpplleettiioonnss command. It may
- be set to any integer value greater than or equal
- to zero. If the number of possible completions is
- greater than or equal to the value of this vari-
- able, the user is asked whether or not he wishes to
- view them; otherwise they are simply listed on the
- terminal.
- ccoonnvveerrtt--mmeettaa ((OOnn))
- If set to OOnn, readline will convert characters with
- the eighth bit set to an ASCII key sequence by
- stripping the eighth bit and prepending an escape
- character (in effect, using escape as the _m_e_t_a _p_r_e_-
- _f_i_x).
- ddiissaabbllee--ccoommpplleettiioonn ((OOffff))
- If set to OOnn, readline will inhibit word comple-
- tion. Completion characters will be inserted into
- the line as if they had been mapped to sseellff--iinnsseerrtt.
- eeddiittiinngg--mmooddee ((eemmaaccss))
- Controls whether readline begins with a set of key
- bindings similar to _e_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can
- be set to either eemmaaccss or vvii.
- eennaabbllee--kkeeyyppaadd ((OOffff))
- When set to OOnn, readline will try to enable the
- application keypad when it is called. Some systems
- need this to enable the arrow keys.
-
-
-
-GNU 1999 Jun 1 4
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- eexxppaanndd--ttiillddee ((OOffff))
- If set to oonn, tilde expansion is performed when
- readline attempts word completion.
- hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff))
- When set to OOnn, makes readline use a single line
- for display, scrolling the input horizontally on a
- single screen line when it becomes longer than the
- 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))
- 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_,
- _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, and _v_i_-_i_n_s_e_r_t.
- _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is equivalent
- to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the
- value of eeddiittiinngg--mmooddee also affects the default
- keymap.
- mmaarrkk--ddiirreeccttoorriieess ((OOnn))
- If set to OOnn, complete<d directory names have a
- slash appended.
- mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
- If set to OOnn, history lines that have been modified
- are displayed with a preceding asterisk (**).
- oouuttppuutt--mmeettaa ((OOffff))
- If set to OOnn, readline will display characters with
- the eighth bit set directly rather than as a meta-
- prefixed escape sequence.
- pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff))
- If set to OOnn, readline will display completions
- with matches sorted horizontally in alphabetical
- order, rather than down the screen.
- sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
- This alters the default behavior of the completion
- functions. If set to oonn, words which have more
- than one possible completion cause the matches to
- be listed immediately instead of ringing the bell.
- vviissiibbllee--ssttaattss ((OOffff))
- If set to OOnn, a character denoting a file's type as
- reported by ssttaatt(2) is appended to the filename
- when listing possible completions.
-
- CCoonnddiittiioonnaall CCoonnssttrruuccttss
- Readline implements a facility similar in spirit to the
-
-
-
-GNU 1999 Jun 1 5
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- conditional compilation features of the C preprocessor
- which allows key bindings and variable settings to be per-
- 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
- are required to isolate it.
-
- mmooddee The mmooddee== form of the $$iiff directive is used
- to test whether readline is in emacs or vi
- mode. This may be used in conjunction with
- 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_-
- _c_t_l_x keymaps only if readline is starting
- out in emacs mode.
-
- tteerrmm The tteerrmm== form may be used to include termi-
- nal-specific key bindings, perhaps to bind
- the key sequences output by the terminal's
- function keys. The word on the right side
- of the == is tested against the full name of
- the terminal and the portion of the terminal
- name before the first --. This allows _s_u_n to
- match both _s_u_n and _s_u_n_-_c_m_d, for instance.
-
- aapppplliiccaattiioonn
- The aapppplliiccaattiioonn construct is used to include
- application-specific settings. Each program
- 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
- test for a particular value. This could be
- used to bind key sequences to functions use-
- ful for a specific program. For instance,
- the following command adds a key sequence
- that quotes the current or previous word in
- Bash:
-
- $$iiff bash
- # Quote the current or previous word
- "\C-xq": "\eb\"\ef\""
- $$eennddiiff
-
- $$eennddiiff This command, as seen in the previous example, ter-
- minates an $$iiff command.
-
- $$eellssee Commands in this branch of the $$iiff directive are
- executed if the test fails.
-
- $$iinncclluuddee
- This directive takes a single filename as an argu-
- ment and reads commands and bindings from that
-
-
-
-GNU 1999 Jun 1 6
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- file. For example, the following directive would
- 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_-_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
- string is typed, readline displays the next entry from the
- history matching the string typed so far. An incremental
- search requires only as many characters as needed to find
- the desired history entry. The characters present in the
- 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-
- minate 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 line.
- When the search is terminated, the history entry contain-
- ing the search string becomes the current line. To find
- other matching entries in the history list, type Control-S
- or Control-R as appropriate. This will search backward or
- forward in the history for the next line matching the
- search string typed so far. Any other key sequence bound
- to a readline command will terminate the search and exe-
- 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
- before starting to search for matching history lines. The
- search string may be typed by the user or be part of the
- contents of the current line.
-
-EEDDIITTIINNGG CCOOMMMMAANNDDSS
- The following is a list of the names of the commands and
- the default key sequences to which they are bound. Com-
- mand names without an accompanying key sequence are
- unbound by default.
-
- CCoommmmaannddss ffoorr MMoovviinngg
- bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa))
- Move to the start of the current line.
- eenndd--ooff--lliinnee ((CC--ee))
- Move to the end of the line.
- ffoorrwwaarrdd--cchhaarr ((CC--ff))
- Move forward a character.
- bbaacckkwwaarrdd--cchhaarr ((CC--bb))
- Move back a character.
-
-
-
-
-GNU 1999 Jun 1 7
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- ffoorrwwaarrdd--wwoorrdd ((MM--ff))
- Move forward to the end of the next word. Words
- are composed of alphanumeric characters (letters
- and digits).
- bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
- Move back to the start of the current or 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
- Refresh the current line.
-
- CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy
- aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn))
- Accept the line regardless of where the cursor is.
- If this line is non-empty, add it to the history
- list. If the line is a modified history line, then
- restore the history line to its original state.
- pprreevviioouuss--hhiissttoorryy ((CC--pp))
- Fetch the previous command from the history list,
- moving back in the list.
- nneexxtt--hhiissttoorryy ((CC--nn))
- Fetch the next command from the history list, mov-
- ing forward in the list.
- bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<))
- Move to the first line in the history.
- eenndd--ooff--hhiissttoorryy ((MM-->>))
- Move to the end of the input history, i.e., the
- line currently being entered.
- rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr))
- Search backward starting at the current line and
- moving `up' through the history as necessary. This
- is an incremental search.
- ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss))
- Search forward starting at the current line and
- moving `down' through the history as necessary.
- This is an incremental search.
- nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp))
- Search backward through the history starting at the
- current line using a non-incremental search for a
- string supplied by the user.
- nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn))
- Search forward through the history using a non-
- incremental search for a string supplied by the
- user.
- hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd
- Search forward through the history for the string
- of characters between the start of the current line
- and the current cursor position (the _p_o_i_n_t). This
- is a non-incremental search.
-
-
-
-
-GNU 1999 Jun 1 8
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd
- Search backward through the history for the string
- of characters between the start of the current line
- and the point. This is a non-incremental search.
- 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--__))
- Insert the last argument to the previous command
- (the last word of the previous history entry).
- With an argument, behave exactly like yyaannkk--nntthh--aarrgg.
- Successive calls to yyaannkk--llaasstt--aarrgg move back through
- the history list, inserting the last argument of
- each line in turn.
-
- CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt
- ddeelleettee--cchhaarr ((CC--dd))
- Delete the character under the cursor. If point is
- at the beginning of the line, there are no charac-
- ters in the line, and the last character typed was
- not bound to BBddeelleettee--cchhaarr, then return EEOOFF.
- bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt))
- Delete the character behind the cursor. When given
- a numeric argument, save the deleted text on the
- 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))
- Add the next character that you type to the line
- verbatim. This is how to insert characters like
- CC--qq, for example.
- ttaabb--iinnsseerrtt ((MM--TTAABB))
- Insert a tab character.
- sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......))
- Insert the character typed.
- ttrraannssppoossee--cchhaarrss ((CC--tt))
- Drag the character before point forward over the
- character at point. Point moves forward as well.
- If point is at the end of the line, then transpose
- the two characters before point. Negative argu-
- ments don't work.
- ttrraannssppoossee--wwoorrddss ((MM--tt))
- Drag the word behind the cursor past the word in
- front of the cursor moving the cursor over that
- word as well.
-
-
-
-
-GNU 1999 Jun 1 9
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- uuppccaassee--wwoorrdd ((MM--uu))
- Uppercase the current (or following) word. With a
- negative argument, uppercase the previous word, but
- do not move point.
- ddoowwnnccaassee--wwoorrdd ((MM--ll))
- Lowercase the current (or following) word. With a
- negative argument, lowercase the previous word, but
- do not move point.
- ccaappiittaalliizzee--wwoorrdd ((MM--cc))
- Capitalize the current (or following) word. With a
- negative argument, capitalize the previous word,
- but do not move point.
-
- KKiilllliinngg aanndd YYaannkkiinngg
- kkiillll--lliinnee ((CC--kk))
- Kill the text from the current cursor position to
- the end of the line.
- bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt))
- Kill backward to the beginning of the line.
- uunniixx--lliinnee--ddiissccaarrdd ((CC--uu))
- Kill backward from point to the beginning of the
- line. The killed text is saved on the kill-ring.
- kkiillll--wwhhoollee--lliinnee
- Kill all characters on the current line, no matter
- where the cursor is.
- kkiillll--wwoorrdd ((MM--dd))
- Kill from the cursor to the end of the current
- word, or if between words, to the end of the next
- word. Word boundaries are the same as those used
- by ffoorrwwaarrdd--wwoorrdd.
- bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt))
- Kill the word behind the cursor. Word boundaries
- are the same as those used by bbaacckkwwaarrdd--wwoorrdd.
- uunniixx--wwoorrdd--rruubboouutt ((CC--ww))
- Kill the word behind the cursor, using white space
- as a word boundary. The word boundaries are dif-
- ferent from bbaacckkwwaarrdd--kkiillll--wwoorrdd.
- ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\))
- Delete all spaces and tabs around point.
- kkiillll--rreeggiioonn
- Kill the text between the point and _m_a_r_k (saved
- cursor position). This text is referred to as the
- _r_e_g_i_o_n.
- ccooppyy--rreeggiioonn--aass--kkiillll
- Copy the text in the region to the kill buffer.
- ccooppyy--bbaacckkwwaarrdd--wwoorrdd
- Copy the word before point to the kill buffer. The
- word boundaries are the same as bbaacckkwwaarrdd--wwoorrdd.
- ccooppyy--ffoorrwwaarrdd--wwoorrdd
- Copy the word following point to the kill buffer.
- The word boundaries are the same as ffoorrwwaarrdd--wwoorrdd.
- yyaannkk ((CC--yy))
- Yank the top of the kill ring into the buffer at
- the cursor.
-
-
-
-GNU 1999 Jun 1 10
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- yyaannkk--ppoopp ((MM--yy))
- Rotate the kill ring, and yank the new top. Only
- works following yyaannkk or yyaannkk--ppoopp.
-
- NNuummeerriicc AArrgguummeennttss
- ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----))
- Add this digit to the argument already accumulat-
- ing, or start a new argument. M-- starts a nega-
- tive argument.
- uunniivveerrssaall--aarrgguummeenntt
- This is another way to specify an argument. If
- this command is followed by one or more digits,
- optionally with a leading minus sign, those digits
- define the argument. If the command is followed by
- digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the
- numeric argument, but is otherwise ignored. As a
- special case, if this command is immediately fol-
- lowed by a character that is neither a digit or
- minus sign, the argument count for the next command
- is multiplied by four. The argument count is ini-
- tially one, so executing this function the first
- time makes the argument count four, a second time
- makes the argument count sixteen, and so on.
-
- CCoommpplleettiinngg
- ccoommpplleettee ((TTAABB))
- Attempt to perform completion on the text before
- point. The actual completion performed is applica-
- tion-specific. BBaasshh, for instance, attempts com-
- pletion treating the text as a variable (if the
- text begins with $$), username (if the text begins
- with ~~), hostname (if the text begins with @@), or
- command (including aliases and functions) in turn.
- If none of these produces a match, filename comple-
- tion is attempted. GGddbb, on the other hand, allows
- completion of program functions and variables, and
- only attempts filename completion under certain
- circumstances.
- ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??))
- List the possible completions of the text before
- point.
- iinnsseerrtt--ccoommpplleettiioonnss ((MM--**))
- Insert all completions of the text before point
- that would have been generated by ppoossssiibbllee--ccoommppllee--
- ttiioonnss.
- mmeennuu--ccoommpplleettee
- Similar to ccoommpplleettee, but replaces the word to be
- completed with a single match from the list of pos-
- sible completions. Repeated execution of mmeennuu--ccoomm--
- pplleettee steps through the list of possible comple-
- tions, inserting each match in turn. At the end of
- the list of completions, the bell is rung and the
- original text is restored. An argument of _n moves
- _n positions forward in the list of matches; a
-
-
-
-GNU 1999 Jun 1 11
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- negative argument may be used to move backward
- through the list. This command is intended to be
- bound to TTAABB, but is unbound by default.
- 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
- ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
- Begin saving the characters typed into the current
- keyboard macro.
- eenndd--kkbbdd--mmaaccrroo ((CC--xx ))))
- Stop saving the characters typed into the current
- keyboard macro and store the definition.
- ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee))
- Re-execute the last keyboard macro defined, by mak-
- ing the characters in the macro appear as if typed
- at the keyboard.
-
- MMiisscceellllaanneeoouuss
- rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr))
- Read in the contents of the _i_n_p_u_t_r_c file, and
- incorporate any bindings or variable assignments
- found there.
- aabboorrtt ((CC--gg))
- Abort the current editing command and ring the ter-
- minal's bell (subject to the setting of
- bbeellll--ssttyyllee).
- ddoo--uuppppeerrccaassee--vveerrssiioonn ((MM--aa,, MM--bb,, MM--_x,, ......))
- If the metafied character _x is lowercase, run the
- command that is bound to the corresponding upper-
- case character.
- pprreeffiixx--mmeettaa ((EESSCC))
- Metafy the next character typed. EESSCC ff is equiva-
- lent to MMeettaa--ff.
- uunnddoo ((CC--__,, CC--xx CC--uu))
- Incremental undo, separately remembered for each
- line.
- rreevveerrtt--lliinnee ((MM--rr))
- Undo all changes made to this line. This is like
- executing the uunnddoo command enough times to return
- the line to its initial state.
- ttiillddee--eexxppaanndd ((MM--&&))
- Perform tilde expansion on the current word.
- sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>))
- Set the mark to the current point. If a numeric
- argument is supplied, the mark is set to that posi-
- tion.
- eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx))
- Swap the point with the mark. The current cursor
- position is set to the saved position, and the old
-
-
-
-GNU 1999 Jun 1 12
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- cursor position is saved as the mark.
- cchhaarraacctteerr--sseeaarrcchh ((CC--]]))
- A character is read and point is moved to the next
- occurrence of that character. A negative count
- searches for previous occurrences.
- cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]]))
- A character is read and point is moved to the pre-
- vious occurrence of that character. A negative
- count searches for subsequent occurrences.
- iinnsseerrtt--ccoommmmeenntt ((MM--##))
- The value of the readline ccoommmmeenntt--bbeeggiinn variable is
- inserted at the beginning of the current line, and
- the line is accepted as if a newline had been
- typed. This makes the current line a shell com-
- ment.
- dduummpp--ffuunnccttiioonnss
- Print all of the functions and their key bindings
- to the readline output stream. If a numeric argu-
- 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.
- dduummpp--vvaarriiaabblleess
- Print all of the settable variables and their val-
- ues to the readline output stream. If a numeric
- argument is supplied, the output is formatted in
- such a way that it can be made part of an _i_n_p_u_t_r_c
- file.
- dduummpp--mmaaccrrooss
- Print all of the readline key sequences bound to
- macros and the strings they ouput. If a numeric
- argument is supplied, the output is formatted in
- such a way that it can be made part of an _i_n_p_u_t_r_c
- file.
- eemmaaccss--eeddiittiinngg--mmooddee ((CC--ee))
- When in vvii editing mode, this causes a switch to
- eemmaaccss editing mode.
- vvii--eeddiittiinngg--mmooddee ((MM--CC--jj))
- When in eemmaaccss editing mode, this causes a switch to
- vvii editing mode.
-
-DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
- The following is a list of the default emacs and vi bind-
- ings. Characters with the 8th bit set are written as
- M-<character>, and are referred to as _m_e_t_a_f_i_e_d characters.
- The printable ASCII characters not mentioned in the list
- of emacs standard bindings are bound to the _s_e_l_f_-_i_n_s_e_r_t
- function, which just inserts the given character into the
- input line. In vi insertion mode, all characters not
- specifically mentioned are bound to _s_e_l_f_-_i_n_s_e_r_t. Charac-
- ters assigned to signal generation by _s_t_t_y(1) or the ter-
- minal driver, such as C-Z or C-C, retain that function.
- Upper and lower case _m_e_t_a_f_i_e_d characters are bound to the
- same function in the emacs mode meta keymap. The remain-
- ing characters are unbound, which causes readline to ring
- the bell (subject to the setting of the bbeellll--ssttyyllee
-
-
-
-GNU 1999 Jun 1 13
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- variable).
-
- EEmmaaccss MMooddee
- Emacs Standard bindings
-
- "C-@" set-mark
- "C-A" beginning-of-line
- "C-B" backward-char
- "C-D" delete-char
- "C-E" end-of-line
- "C-F" forward-char
- "C-G" abort
- "C-H" backward-delete-char
- "C-I" complete
- "C-J" accept-line
- "C-K" kill-line
- "C-L" clear-screen
- "C-M" accept-line
- "C-N" next-history
- "C-P" previous-history
- "C-Q" quoted-insert
- "C-R" reverse-search-history
- "C-S" forward-search-history
- "C-T" transpose-chars
- "C-U" unix-line-discard
- "C-V" quoted-insert
- "C-W" unix-word-rubout
- "C-Y" yank
- "C-]" character-search
- "C-_" undo
- " " to "/" self-insert
- "0" to "9" self-insert
- ":" to "~" self-insert
- "C-?" backward-delete-char
-
- Emacs Meta bindings
-
- "M-C-G" abort
- "M-C-H" backward-kill-word
- "M-C-I" tab-insert
- "M-C-J" vi-editing-mode
- "M-C-M" vi-editing-mode
- "M-C-R" revert-line
- "M-C-Y" yank-nth-arg
- "M-C-[" complete
- "M-C-]" character-search-backward
- "M-space" set-mark
- "M-#" insert-comment
- "M-&" tilde-expand
- "M-*" insert-completions
- "M--" digit-argument
- "M-." yank-last-arg
- "M-0" digit-argument
- "M-1" digit-argument
-
-
-
-GNU 1999 Jun 1 14
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- "M-2" digit-argument
- "M-3" digit-argument
- "M-4" digit-argument
- "M-5" digit-argument
- "M-6" digit-argument
- "M-7" digit-argument
- "M-8" digit-argument
- "M-9" digit-argument
- "M-<" beginning-of-history
- "M-=" possible-completions
- "M->" end-of-history
- "M-?" possible-completions
- "M-B" backward-word
- "M-C" capitalize-word
- "M-D" kill-word
- "M-F" forward-word
- "M-L" downcase-word
- "M-N" non-incremental-forward-search-history
- "M-P" non-incremental-reverse-search-history
- "M-R" revert-line
- "M-T" transpose-words
- "M-U" upcase-word
- "M-Y" yank-pop
- "M-\" delete-horizontal-space
- "M-~" tilde-expand
- "M-C-?" backward-delete-word
- "M-_" yank-last-arg
-
- Emacs Control-X bindings
-
- "C-XC-G" abort
- "C-XC-R" re-read-init-file
- "C-XC-U" undo
- "C-XC-X" exchange-point-and-mark
- "C-X(" start-kbd-macro
- "C-X)" end-kbd-macro
- "C-XE" call-last-kbd-macro
- "C-XC-?" backward-kill-line
-
-
- VVII MMooddee bbiinnddiinnggss
- VI Insert Mode functions
-
- "C-D" vi-eof-maybe
- "C-H" backward-delete-char
- "C-I" complete
- "C-J" accept-line
- "C-M" accept-line
- "C-R" reverse-search-history
- "C-S" forward-search-history
- "C-T" transpose-chars
- "C-U" unix-line-discard
- "C-V" quoted-insert
- "C-W" unix-word-rubout
-
-
-
-GNU 1999 Jun 1 15
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- "C-Y" yank
- "C-[" vi-movement-mode
- "C-_" undo
- " " to "~" self-insert
- "C-?" backward-delete-char
-
- VI Command Mode functions
-
- "C-D" vi-eof-maybe
- "C-E" emacs-editing-mode
- "C-G" abort
- "C-H" backward-char
- "C-J" accept-line
- "C-K" kill-line
- "C-L" clear-screen
- "C-M" accept-line
- "C-N" next-history
- "C-P" previous-history
- "C-Q" quoted-insert
- "C-R" reverse-search-history
- "C-S" forward-search-history
- "C-T" transpose-chars
- "C-U" unix-line-discard
- "C-V" quoted-insert
- "C-W" unix-word-rubout
- "C-Y" yank
- " " forward-char
- "#" insert-comment
- "$" end-of-line
- "%" vi-match
- "&" vi-tilde-expand
- "*" vi-complete
- "+" next-history
- "," vi-char-search
- "-" previous-history
- "." vi-redo
- "/" vi-search
- "0" beginning-of-line
- "1" to "9" vi-arg-digit
- ";" vi-char-search
- "=" vi-complete
- "?" vi-search
- "A" vi-append-eol
- "B" vi-prev-word
- "C" vi-change-to
- "D" vi-delete-to
- "E" vi-end-word
- "F" vi-char-search
- "G" vi-fetch-history
- "I" vi-insert-beg
- "N" vi-search-again
- "P" vi-put
- "R" vi-replace
- "S" vi-subst
-
-
-
-GNU 1999 Jun 1 16
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- "T" vi-char-search
- "U" revert-line
- "W" vi-next-word
- "X" backward-delete-char
- "Y" vi-yank-to
- "\" vi-complete
- "^" vi-first-print
- "_" vi-yank-arg
- "`" vi-goto-mark
- "a" vi-append-mode
- "b" vi-prev-word
- "c" vi-change-to
- "d" vi-delete-to
- "e" vi-end-word
- "f" vi-char-search
- "h" backward-char
- "i" vi-insertion-mode
- "j" next-history
- "k" prev-history
- "l" forward-char
- "m" vi-set-mark
- "n" vi-search-again
- "p" vi-put
- "r" vi-change-char
- "s" vi-subst
- "t" vi-char-search
- "u" undo
- "w" vi-next-word
- "x" vi-delete
- "y" vi-yank-to
- "|" vi-column
- "~" vi-change-case
-
-SSEEEE AALLSSOO
- _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
- _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
- _b_a_s_h(1)
-
-FFIILLEESS
- _~_/_._i_n_p_u_t_r_c
- Individual rreeaaddlliinnee initialization file
-
-AAUUTTHHOORRSS
- Brian Fox, Free Software Foundation
- bfox@gnu.org
-
- Chet Ramey, Case Western Reserve University
- chet@ins.CWRU.Edu
-
-BBUUGG RREEPPOORRTTSS
- If you find a bug in rreeaaddlliinnee,, you should report it. But
- first, you should make sure that it really is a bug, and
- that it appears in the latest version of the rreeaaddlliinnee
- library that you have.
-
-
-
-GNU 1999 Jun 1 17
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- Once you have determined that a bug actually exists, mail
- 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
- `philosophical' bug reports may be mailed to _b_u_g_-_r_e_a_d_-
- _l_i_n_e@_g_n_u_._o_r_g or posted to the Usenet newsgroup
- ggnnuu..bbaasshh..bbuugg.
-
- Comments and bug reports concerning this manual page
- should be directed to _c_h_e_t_@_i_n_s_._C_W_R_U_._E_d_u.
-
-BBUUGGSS
- It's too big and too slow.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-GNU 1999 Jun 1 18
-
-
diff --git a/readline/doc/readline.3 b/readline/doc/readline.3
index c1ed9cf..6b36f2f 100644
--- a/readline/doc/readline.3
+++ b/readline/doc/readline.3
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Tue Jun 1 13:28:03 EDT 1999
+.\" Last Change: Thu Dec 31 10:16:30 EST 1998
.\"
-.TH READLINE 3 "1999 Jun 1" GNU
+.TH READLINE 3 "1998 Dec 31" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -148,7 +148,6 @@ processing key bindings:
.IR SPACE ,
and
.IR TAB .
-.PP
In addition to command names, readline allows keys to be bound
to a string that is inserted when the key is pressed (a \fImacro\fP).
.PP
@@ -565,7 +564,7 @@ Move forward to the end of the next word. Words are composed of
alphanumeric characters (letters and digits).
.TP
.B backward\-word (M\-b)
-Move back to the start of the current or previous word. Words are
+Move back to the start of this, or the previous, word. Words are
composed of alphanumeric characters (letters and digits).
.TP
.B clear\-screen (C\-l)
@@ -1173,9 +1172,9 @@ VI Command Mode functions
Individual \fBreadline\fP initialization file
.PD
.SH AUTHORS
-Brian Fox, Free Software Foundation
+Brian Fox, Free Software Foundation (primary author)
.br
-bfox@gnu.org
+bfox@ai.MIT.Edu
.PP
Chet Ramey, Case Western Reserve University
.br
diff --git a/readline/doc/rlman.texinfo b/readline/doc/rlman.texinfo
index 759f0eb..41bafbf 100644
--- a/readline/doc/rlman.texinfo
+++ b/readline/doc/rlman.texinfo
@@ -55,8 +55,8 @@ in the consistency of user interface across discrete programs that need
to provide a command line interface.
Published by the Free Software Foundation @*
-59 Temple Place, Suite 330, @*
-Boston, MA 02111 USA
+675 Massachusetts Avenue, @*
+Cambridge, MA 02139 USA
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
diff --git a/readline/doc/rltech.texinfo b/readline/doc/rltech.texinfo
index 51c340a..ea8d7f8 100644
--- a/readline/doc/rltech.texinfo
+++ b/readline/doc/rltech.texinfo
@@ -167,13 +167,6 @@ programs. This section describes the various functions and variables
defined within the Readline library which allow a user program to add
customized functionality to Readline.
-Before declaring any functions that customize Readline's behavior, or
-using any functionality Readline provides in other code, an
-application writer should include the file @code{<readline/readline.h>}
-in any file that uses Readline's features. Since some of the definitions
-in @code{readline.h} use the @code{stdio} library, the file
-@code{<stdio.h>} should be included before @code{readline.h}.
-
@menu
* The Function Type:: C declarations to make code readable.
* Function Writing:: Variables and calling conventions.
@@ -248,9 +241,7 @@ These variables are available to function writers.
@deftypevar {char *} rl_line_buffer
This is the line gathered so far. You are welcome to modify the
-contents of the line, but see @ref{Allowing Undoing}. The
-function @code{rl_extend_line_buffer} is available to increase
-the memory allocated to @code{rl_line_buffer}.
+contents of the line, but see @ref{Allowing Undoing}.
@end deftypevar
@deftypevar int rl_point
@@ -291,16 +282,6 @@ The prompt Readline uses. This is set from the argument to
@code{readline ()}, and should not be assigned to directly.
@end deftypevar
-@deftypevar int rl_already_prompted
-If an application wishes to display the prompt itself, rather than have
-Readline do it the first time @code{readline()} is called, it should set
-this variable to a non-zero value after displaying the prompt.
-The prompt must also be passed as the argument to @code{readline()} so
-the redisplay functions can update the display properly.
-The calling application is responsible for managing the value; Readline
-never sets it.
-@end deftypevar
-
@deftypevar {char *} rl_library_version
The version number of this revision of the library.
@end deftypevar
@@ -466,13 +447,6 @@ several internal keymaps: @code{emacs_standard_keymap},
@code{emacs_standard_keymap} is the default, and the examples in
this manual assume that.
-Since @code{readline} installs a set of default key bindings the first
-time it is called, there is always the danger that a custom binding
-installed before the first call to @code{readline} will be overridden.
-An alternate mechanism is to install custom key bindings in an
-initialization function assigned to the @code{rl_startup_hook} variable
-(@pxref{Readline Variables}).
-
These functions manage key bindings.
@deftypefun int rl_bind_key (int key, Function *function)
@@ -560,12 +534,6 @@ the list is formatted in such a way that it can be made part of an
Print the names of all bindable Readline functions to @code{rl_outstream}.
@end deftypefun
-@deftypefun {char **} rl_funmap_names ()
-Return a NULL terminated array of known function names. The array is
-sorted. The array itself is allocated, but not the strings inside. You
-should free () the array when you done, but not the pointrs.
-@end deftypefun
-
@node Allowing Undoing
@subsection Allowing Undoing
@@ -647,19 +615,10 @@ Readline thinks the screen display is correct.
@end deftypefun
@deftypefun int rl_on_new_line ()
-Tell the update functions that we have moved onto a new (empty) line,
+Tell the update routines that we have moved onto a new (empty) line,
usually after ouputting a newline.
@end deftypefun
-@deftypefun int rl_on_new_line_with_prompt ()
-Tell the update functions that we have moved onto a new line, with
-@var{rl_prompt} already displayed.
-This could be used by applications that want to output the prompt string
-themselves, but still need Readline to know the prompt string length for
-redisplay.
-It should be used after setting @var{rl_already_prompted}.
-@end deftypefun
-
@deftypefun int rl_reset_line_state ()
Reset the display state to a clean state and redisplay the current line
starting on a new line.
@@ -729,7 +688,7 @@ before Readline attempts to read characters from the terminal with
@code{rl_read_key ()}.
@end deftypefun
-@deftypefun int rl_extend_line_buffer (int len)
+@deftypefun rl_extend_line_buffer (int len)
Ensure that @code{rl_line_buffer} has enough space to hold @var{len}
characters, possibly reallocating it if necessary.
@end deftypefun
@@ -741,8 +700,6 @@ Initialize or re-initialize Readline's internal state.
@deftypefun int rl_reset_terminal (char *terminal_name)
Reinitialize Readline's idea of the terminal settings using
@var{terminal_name} as the terminal type (e.g., @code{vt100}).
-If @var{terminal_name} is NULL, the value of the @code{TERM}
-environment variable is used.
@end deftypefun
@deftypefun int alphabetic (int c)
@@ -1149,7 +1106,7 @@ for subsequent calls.
@deftypevar {Function *} rl_completion_entry_function
A pointer to the generator function for @code{completion_matches ()}.
-@code{NULL} means to use @code{filename_completion_function ()}, the default
+@code{NULL} means to use @code{filename_entry_function ()}, the default
filename completer.
@end deftypevar
diff --git a/readline/doc/rluser.texinfo b/readline/doc/rluser.texinfo
index 9f088ff..755f7ca 100644
--- a/readline/doc/rluser.texinfo
+++ b/readline/doc/rluser.texinfo
@@ -7,10 +7,10 @@
This file documents the end user interface to the GNU command line
editing features. It is to be an appendix to manuals for programs which
use these features. There is a document entitled "readline.texinfo"
-which contains both end-user and programmer documentation for the
-GNU Readline Library.
+which contains both end-user and programmer documentation for the GNU
+Readline Library.
-Copyright (C) 1988-1999 Free Software Foundation, Inc.
+Copyright (C) 1988, 1991, 1993, 1996 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
@@ -36,19 +36,11 @@ into another language, under the above conditions for modified versions.
@comment If you are including this manual as an appendix, then set the
@comment variable readline-appendix.
-@ifclear BashFeatures
-@defcodeindex bt
-@end ifclear
-
@node Command Line Editing
@chapter Command Line Editing
-This chapter describes the basic features of the @sc{gnu}
+This chapter describes the basic features of the @sc{GNU}
command line editing interface.
-@ifset BashFeatures
-Command line editing is provided by the Readline library, which is
-used by several different programs, including Bash.
-@end ifset
@menu
* Introduction and Notation:: Notation used in this text.
@@ -58,12 +50,6 @@ used by several different programs, including Bash.
available for binding
* Readline vi Mode:: A short description of how to make Readline
behave like the vi editor.
-@ifset BashFeatures
-* Programmable Completion:: How to specify the possible completions for
- a specific command.
-* Programmable Completion Builtins:: Builtin commands to specify how to
- complete arguments for a particular command.
-@end ifset
@end menu
@node Introduction and Notation
@@ -77,19 +63,9 @@ produced when the @key{k} key is pressed while the Control key
is depressed.
The text @key{M-k} is read as `Meta-K' and describes the character
-produced when the Meta key (if you have one) is depressed, and the @key{k}
-key is pressed.
-The Meta key is labeled @key{ALT} on many keyboards.
-On keyboards with two keys labeled @key{ALT} (usually to either side of
-the space bar), the @key{ALT} on the left side is generally set to
-work as a Meta key.
-The @key{ALT} key on the right may also be configured to work as a
-Meta key or may be configured as some other modifier, such as a
-Compose key for typing accented characters.
-
-If you do not have a Meta or @key{ALT} key, or another key working as
-a Meta key, the identical keystroke can be generated by typing @key{ESC}
-@i{first}, and then typing @key{k}.
+produced when the meta key (if you have one) is depressed, and the @key{k}
+key is pressed. If you do not have a meta key, the identical keystroke
+can be generated by typing @key{ESC} @i{first}, and then typing @key{k}.
Either process is known as @dfn{metafying} the @key{k} key.
The text @key{M-C-k} is read as `Meta-Control-k' and describes the
@@ -99,10 +75,6 @@ In addition, several keys have their own names. Specifically,
@key{DEL}, @key{ESC}, @key{LFD}, @key{SPC}, @key{RET}, and @key{TAB} all
stand for themselves when seen in this text, or in an init file
(@pxref{Readline Init File}).
-If your keyboard lacks a @key{LFD} key, typing @key{C-j} will
-produce the desired character.
-The @key{RET} key may be labeled @key{Return} or @key{Enter} on
-some keyboards.
@node Readline Interaction
@section Readline Interaction
@@ -138,8 +110,8 @@ character appears where the cursor was, and then the cursor moves one
space to the right. If you mistype a character, you can use your
erase character to back up and delete the mistyped character.
-Sometimes you may mistype a character, and
-not notice the error until you have typed several other characters. In
+Sometimes you may miss typing a character that you wanted to type, and
+not notice your error until you have typed several other characters. In
that case, you can type @key{C-b} to move the cursor to the left, and then
correct your mistake. Afterwards, you can move the cursor to the right
with @key{C-f}.
@@ -148,7 +120,7 @@ When you add text in the middle of a line, you will notice that characters
to the right of the cursor are `pushed over' to make room for the text
that you have inserted. Likewise, when you delete text behind the cursor,
characters to the right of the cursor are `pulled back' to fill in the
-blank space created by the removal of the text. A list of the bare
+blank space created by the removal of the text. A list of the basic bare
essentials for editing the text of an input line follows.
@table @asis
@@ -156,28 +128,22 @@ essentials for editing the text of an input line follows.
Move back one character.
@item @key{C-f}
Move forward one character.
-@item @key{DEL} or @key{Backspace}
+@item @key{DEL}
Delete the character to the left of the cursor.
@item @key{C-d}
Delete the character underneath the cursor.
@item @w{Printing characters}
Insert the character into the line at the cursor.
-@item @key{C-_} or @key{C-x C-u}
+@item @key{C-_}
Undo the last editing command. You can undo all the way back to an
empty line.
@end table
-@noindent
-(Depending on your configuration, the @key{Backspace} key be set to
-delete the character to the left of the cursor and the @key{DEL} key set
-to delete the character underneath the cursor, like @key{C-d}, rather
-than the character to the left of the cursor.)
-
@node Readline Movement Commands
@subsection Readline Movement Commands
-The above table describes the most basic keystrokes that you need
+The above table describes the most basic possible keystrokes that you need
in order to do editing of the input line. For your convenience, many
other commands have been added in addition to @key{C-b}, @key{C-f},
@key{C-d}, and @key{DEL}. Here are some commands for moving more rapidly
@@ -209,8 +175,6 @@ operate on characters while meta keystrokes operate on words.
@dfn{Killing} text means to delete the text from the line, but to save
it away for later use, usually by @dfn{yanking} (re-inserting)
it back into the line.
-(`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
-
If the description for a command says that it `kills' text, then you can
be sure that you can get the text back in a different (or the same)
place later.
@@ -230,14 +194,12 @@ Here is the list of commands for killing text.
Kill the text from the current cursor position to the end of the line.
@item M-d
-Kill from the cursor to the end of the current word, or, if between
+Kill from the cursor to the end of the current word, or if between
words, to the end of the next word.
-Word boundaries are the same as those used by @key{M-f}.
@item M-DEL
-Kill from the cursor the start of the previous word, or, if between
+Kill from the cursor the start of the previous word, or if between
words, to the start of the previous word.
-Word boundaries are the same as those used by @key{M-b}.
@item C-w
Kill from the cursor to the previous whitespace. This is different than
@@ -269,7 +231,7 @@ start of the line, you might type @samp{M-- C-k}.
The general way to pass numeric arguments to a command is to type meta
digits before the command. If the first `digit' typed is a minus
-sign (@samp{-}), then the sign of the argument will be negative. Once
+sign (@key{-}), then the sign of the argument will be negative. Once
you have typed one meta digit to get the argument started, you can type
the remainder of the digits, and then the command. For example, to give
the @key{C-d} command an argument of 10, you could type @samp{M-1 0 C-d}.
@@ -290,18 +252,15 @@ As each character of the search string is typed, Readline displays
the next entry from the history matching the string typed so far.
An incremental search requires only as many characters as needed to
find the desired history entry.
-To search backward in the history for a particular string, type
-@key{C-r}. Typing @key{C-s} searches forward through the history.
-The characters present in the value of the @code{isearch-terminators} variable
+The characters present in the value of the @var{isearch-terminators} variable
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.
When the search is terminated, the history entry containing the
search string becomes the current line.
-
-To find other matching entries in the history list, type @key{C-r} or
-@key{C-s} as appropriate.
+To find other matching entries in the history list, type @key{C-s} or
+@key{C-r} as appropriate.
This will search backward or forward in the history for the next
entry matching the search string typed so far.
Any other key sequence bound to a Readline command will terminate
@@ -317,11 +276,11 @@ typed by the user or be part of the contents of the current line.
@section Readline Init File
@cindex initialization file, readline
-Although the Readline library comes with a set of Emacs-like
+Although the Readline library comes with a set of @code{emacs}-like
keybindings installed by default, it is possible to use a different set
of keybindings.
Any user can customize programs that use Readline by putting
-commands in an @dfn{inputrc} file, conventionally in his home directory.
+commands in an @dfn{inputrc} file in his home directory.
The name of this
@ifset BashFeatures
file is taken from the value of the shell variable @code{INPUTRC}. If
@@ -367,11 +326,6 @@ change from the default Emacs-like key binding to use
set editing-mode vi
@end example
-@ifset BashFeatures
-The @w{@code{bind -V}} command lists the current Readline variable names
-and values. @xref{Bash Builtins}.
-@end ifset
-
A great deal of run-time behavior is changeable with the following
variables.
@@ -409,7 +363,7 @@ them; otherwise, they are simply listed. The default limit is
@vindex convert-meta
If set to @samp{on}, Readline will convert characters with the
eighth bit set to an ASCII key sequence by stripping the eighth
-bit and prefixing an @key{ESC} character, converting them to a
+bit and prepending an @key{ESC} character, converting them to a
meta-prefixed key sequence. The default value is @samp{on}.
@item disable-completion
@@ -515,7 +469,7 @@ completions. The default is @samp{off}.
@item Key Bindings
The syntax for controlling key bindings in the init file is
-simple. First you need to find the name of the command that you
+simple. First you have to know the name of the command that you
want to change. The following sections contain tables of the command
name, the default keybinding, if any, and a short description of what
the command does.
@@ -526,12 +480,6 @@ command on a line in the init file. The name of the key
can be expressed in different ways, depending on which is most
comfortable for you.
-@ifset BashFeatures
-The @w{@code{bind -p}} command displays Readline function names and
-bindings in a format that can put directly into an initialization file.
-@xref{Bash Builtins}.
-@end ifset
-
@table @asis
@item @w{@var{keyname}: @var{function-name} or @var{macro}}
@var{keyname} is the name of a key spelled out in English. For example:
@@ -549,7 +497,7 @@ expressed on the right hand side (that is, to insert the text
@item @w{"@var{keyseq}": @var{function-name} or @var{macro}}
@var{keyseq} differs from @var{keyname} above in that strings
denoting an entire key sequence can be specified, by placing
-the key sequence in double quotes. Some @sc{gnu} Emacs style key
+the key sequence in double quotes. Some GNU Emacs style key
escapes can be used, as in the following example, but the
special character names are not recognized.
@@ -567,7 +515,7 @@ the text @samp{Function Key 1}.
@end table
-The following @sc{gnu} Emacs style escape sequences are available when
+The following GNU Emacs style escape sequences are available when
specifying key sequences:
@table @code
@@ -580,12 +528,12 @@ an escape character
@item @kbd{\\}
backslash
@item @kbd{\"}
-@key{"}, a double quotation mark
+@key{"}
@item @kbd{\'}
-@key{'}, a single quote or apostrophe
+@key{'}
@end table
-In addition to the @sc{gnu} Emacs style escape sequences, a second
+In addition to the GNU Emacs style escape sequences, a second
set of backslash escapes is available:
@table @code
@@ -606,10 +554,10 @@ horizontal tab
@item \v
vertical tab
@item \@var{nnn}
-the character whose @code{ASCII} code is the octal value @var{nnn}
+the character whose ASCII code is the octal value @var{nnn}
(one to three digits)
@item \x@var{nnn}
-the character whose @code{ASCII} code is the hexadecimal value @var{nnn}
+the character whose ASCII code is the hexadecimal value @var{nnn}
(one to three digits)
@end table
@@ -814,17 +762,6 @@ $endif
This section describes Readline commands that may be bound to key
sequences.
-@ifset BashFeatures
-You can list your key bindings by executing
-@w{@code{bind -P}} or, for a more terse format, suitable for an
-@var{inputrc} file, @w{@code{bind -p}}. (@xref{Bash Builtins}.)
-@end ifset
-
-Command names without an accompanying key sequence are unbound by default.
-In the following descriptions, @var{point} refers to the current cursor
-position, and @var{mark} refers to a cursor position saved by the
-@code{set-mark} command.
-The text between the point and mark is referred to as the @var{region}.
@node Commands For Moving
@subsection Commands For Moving
@@ -846,7 +783,7 @@ Move forward to the end of the next word. Words are composed of
letters and digits.
@item backward-word (M-b)
-Move back to the start of the current or previous word. Words are
+Move back to the start of this, or the previous, word. Words are
composed of letters and digits.
@item clear-screen (C-l)
@@ -909,9 +846,9 @@ for a string supplied by the user.
@item history-search-forward ()
Search forward through the history for the string of characters
-between the start of the current line and the point.
-This is a non-incremental search.
-By default, this command is unbound.
+between the start of the current line and the current cursor
+position (the @var{point}). This is a non-incremental search. By
+default, this command is unbound.
@item history-search-backward ()
Search backward through the history for the string of characters
@@ -971,11 +908,11 @@ the character at the cursor, moving the
cursor forward as well. If the insertion point
is at the end of the line, then this
transposes the last two characters of the line.
-Negative arguments have no effect.
+Negative arguments don't work.
@item transpose-words (M-t)
-Drag the word before point past the word after point,
-moving point past that word as well.
+Drag the word behind the cursor past the word in front of the cursor
+moving the cursor over that word as well.
@item upcase-word (M-u)
Uppercase the current (or following) word. With a negative argument,
@@ -997,36 +934,38 @@ capitalize the previous word, but do not move the cursor.
@ftable @code
@item kill-line (C-k)
-Kill the text from point to the end of the line.
+Kill the text from the current cursor position to the end of the line.
@item backward-kill-line (C-x Rubout)
Kill backward to the beginning of the line.
@item unix-line-discard (C-u)
Kill backward from the cursor to the beginning of the current line.
+The killed text is saved on the kill-ring.
@item kill-whole-line ()
-Kill all characters on the current line, no matter point is.
-By default, this is unbound.
+Kill all characters on the current line, no matter where the
+cursor is. By default, this is unbound.
@item kill-word (M-d)
-Kill from point to the end of the current word, or if between
-words, to the end of the next word.
-Word boundaries are the same as @code{forward-word}.
+Kill from the cursor to the end of the current word, or if between
+words, to the end of the next word. Word boundaries are the same
+as @code{forward-word}.
@item backward-kill-word (M-DEL)
-Kill the word behind point.
-Word boundaries are the same as @code{backward-word}.
+Kill the word behind the cursor. Word boundaries are the same
+as @code{backward-word}.
@item unix-word-rubout (C-w)
-Kill the word behind point, using white space as a word boundary.
-The killed text is saved on the kill-ring.
+Kill the word behind the cursor, using white space as a word
+boundary. The killed text is saved on the kill-ring.
@item delete-horizontal-space ()
Delete all spaces and tabs around point. By default, this is unbound.
@item kill-region ()
-Kill the text in the current region.
+Kill the text between the point and the @emph{mark} (saved
+cursor position). This text is referred to as the @var{region}.
By default, this command is unbound.
@item copy-region-as-kill ()
@@ -1170,7 +1109,7 @@ the text against lines from the history list for possible
completion matches.
@item complete-into-braces (M-@{)
-Perform filename completion and insert the list of possible completions
+Perform filename completion and return the list of possible completions
enclosed within braces so the list is available to the shell
(@pxref{Brace Expansion}).
@@ -1199,7 +1138,7 @@ in the macro appear as if typed at the keyboard.
@ftable @code
@item re-read-init-file (C-x C-r)
-Read in the contents of the @var{inputrc} file, and incorporate
+Read in the contents of the inputrc file, and incorporate
any bindings or variable assignments found there.
@item abort (C-g)
@@ -1253,8 +1192,7 @@ The value of the @code{comment-begin}
variable is inserted at the beginning of the current line,
and the line is accepted as if a newline had been typed.
@ifset BashFeatures
-The default value of @code{comment-begin} causes this command
-to make the current line a shell comment.
+This makes the current line a shell comment.
@end ifset
@item dump-functions ()
@@ -1347,283 +1285,3 @@ switches you into `command' mode, where you can edit the text of the
line with the standard @code{vi} movement keys, move to previous
history lines with @samp{k} and subsequent lines with @samp{j}, and
so forth.
-
-@ifset BashFeatures
-@node Programmable Completion
-@section Programmable Completion
-@cindex programmable completion
-
-When word completion is attempted for an argument to a command for
-which a completion specification (a @var{compspec}) has been defined
-using the @code{complete} builtin (@pxref{Programmable Completion Builtins}),
-the programmable completion facilities are invoked.
-
-First, the command name is identified.
-If a compspec has been defined for that command, the
-compspec is used to generate the list of possible completions for the word.
-If the command word is a full pathname, a compspec for the full
-pathname is searched for first.
-If no compspec is found for the full pathname, an attempt is made to
-find a compspec for the portion following the final slash.
-
-Once a compspec has been found, it is used to generate the list of
-matching words.
-If a compspec is not found, the default Bash completion
-described above (@pxref{Commands For Completion}) is performed.
-
-First, the actions specified by the compspec are used.
-Only matches which are prefixed by the word being completed are
-returned.
-When the @samp{-f} or @samp{-d} option is used for filename or
-directory name completion, the shell variable @code{FIGNORE} is
-used to filter the matches.
-@xref{Bash Variables}, for a description of @code{FIGNORE}.
-
-Any completions specified by a filename expansion pattern to the
-@samp{-G} option are generated next.
-The words generated by the pattern need not match the word being completed.
-The @code{GLOBIGNORE} shell variable is not used to filter the matches,
-but the @code{FIGNORE} shell variable is used.
-
-Next, the string specified as the argument to the @samp{-W} option
-is considered.
-The string is first split using the characters in the @code{IFS}
-special variable as delimiters.
-Shell quoting is honored.
-Each word is then expanded using
-brace expansion, tilde expansion, parameter and variable expansion,
-command substitution, arithmetic expansion, and pathname expansion,
-as described above (@pxref{Shell Expansions}).
-The results are split using the rules described above
-(@pxref{Word Splitting}).
-The results of the expansion are prefix-matched against the word being
-completed, and the matching words become the possible completions.
-
-After these matches have been generated, any shell function or command
-specified with the @samp{-F} and @samp{-C} options is invoked.
-When the command or function is invoked, the @code{COMP_LINE} and
-@code{COMP_POINT} variables are assigned values as described above
-(@pxref{Bash Variables}).
-If a shell function is being invoked, the @code{COMP_WORDS} and
-@code{COMP_CWORD} variables are also set.
-When the function or command is invoked, the first argument is the
-name of the command whose arguments are being completed, the
-second argument is the word being completed, and the third argument
-is the word preceding the word being completed on the current command line.
-No filtering of the generated completions against the word being completed
-is performed; the function or command has complete freedom in generating
-the matches.
-
-Any function specified with @samp{-F} is invoked first.
-The function may use any of the shell facilities, including the
-@code{compgen} builtin described below
-(@pxref{Programmable Completion Builtins}), to generate the matches.
-It must put the possible completions in the @code{COMPREPLY} array
-variable.
-
-Next, any command specified with the @samp{-C} option is invoked
-in an environment equivalent to command substitution.
-It should print a list of completions, one per line, to
-the standard output.
-Backslash may be used to escape a newline, if necessary.
-
-After all of the possible completions are generated, any filter
-specified with the @samp{-X} option is applied to the list.
-The filter is a pattern as used for pathname expansion; a @samp{&}
-in the pattern is replaced with the text of the word being completed.
-A literal @samp{&} may be escaped with a backslash; the backslash
-is removed before attempting a match.
-Any completion that matches the pattern will be removed from the list.
-A leading @samp{!} negates the pattern; in this case any completion
-not matching the pattern will be removed.
-
-Finally, any prefix and suffix specified with the @samp{-P} and @samp{-S}
-options are added to each member of the completion list, and the result is
-returned to the Readline completion code as the list of possible
-completions.
-
-If a compspec is found, whatever it generates is returned to the completion
-code as the full set of possible completions.
-The default Bash completions are not attempted, and the Readline
-default of filename completion is disabled.
-
-@node Programmable Completion Builtins
-@section Programmable Completion Builtins
-@cindex completion builtins
-
-Two builtin commands are available to manipulate the programmable completion
-facilities.
-
-@table @code
-@item compgen
-@btindex compgen
-@example
-@code{compgen [@var{option}] [@var{word}]}
-@end example
-
-Generate possible completion matches for @var{word} according to
-the @var{option}s, which may be any option accepted by the
-@code{complete}
-builtin with the exception of @samp{-p} and @samp{-r}, and write
-the matches to the standard output.
-When using the @samp{-F} or @samp{-C} options, the various shell variables
-set by the programmable completion facilities, while available, will not
-have useful values.
-
-The matches will be generated in the same way as if the programmable
-completion code had generated them directly from a completion specification
-with the same flags.
-If @var{word} is specified, only those completions matching @var{word}
-will be displayed.
-
-The return value is true unless an invalid option is supplied, or no
-matches were generated.
-
-@item complete
-@btindex complete
-@example
-@code{complete [-abcdefjkvu] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
-[-P @var{prefix}] [-S @var{suffix}] [-X @var{filterpat}] [-F @var{function}]
-[-C @var{command}] @var{name} [@var{name} @dots{}]}
-@code{complete -pr [@var{name} @dots{}]}
-@end example
-
-Specify how arguments to each @var{name} should be completed.
-If the @samp{-p} option is supplied, or if no options are supplied, existing
-completion specifications are printed in a way that allows them to be
-reused as input.
-The @samp{-r} option removes a completion specification for
-each @var{name}, or, if no @var{name}s are supplied, all
-completion specifications.
-
-The process of applying these completion specifications when word completion
-is attempted is described above (@pxref{Programmable Completion}).
-
-Other options, if specified, have the following meanings.
-The arguments to the @samp{-G}, @samp{-W}, and @samp{-X} options
-(and, if necessary, the @samp{-P} and @samp{-S} options)
-should be quoted to protect them from expansion before the
-@code{complete} builtin is invoked.
-
-@table @code
-@item -A @var{action}
-The @var{action} may be one of the following to generate a list of possible
-completions:
-
-@table @code
-@item alias
-Alias names. May also be specified as @samp{-a}.
-
-@item arrayvar
-Array variable names.
-
-@item binding
-Readline key binding names (@pxref{Bindable Readline Commands}).
-
-@item builtin
-Names of shell builtin commands. May also be specified as @samp{-b}.
-
-@item command
-Command names. May also be specified as @samp{-c}.
-
-@item directory
-Directory names. May also be specified as @samp{-d}.
-
-@item disabled
-Names of disabled shell builtins.
-
-@item enabled
-Names of enabled shell builtins.
-
-@item export
-Names of exported shell variables. May also be specified as @samp{-e}.
-
-@item file
-File names. May also be specified as @samp{-f}.
-
-@item function
-Names of shell functions.
-
-@item helptopic
-Help topics as accepted by the @code{help} builtin (@pxref{Bash Builtins}).
-
-@item hostname
-Hostnames, as taken from the file specified by the
-@code{HOSTFILE} shell variable (@pxref{Bash Variables}).
-
-@item job
-Job names, if job control is active. May also be specified as @samp{-j}.
-
-@item keyword
-Shell reserved words. May also be specified as @samp{-k}.
-
-@item running
-Names of running jobs, if job control is active.
-
-@item setopt
-Valid arguments for the @samp{-o} option to the @code{set} builtin
-(@pxref{The Set Builtin}).
-
-@item shopt
-Shell option names as accepted by the @code{shopt} builtin
-(@pxref{Bash Builtins}).
-
-@item signal
-Signal names.
-
-@item stopped
-Names of stopped jobs, if job control is active.
-
-@item user
-User names. May also be specified as @samp{-u}.
-
-@item variable
-Names of all shell variables. May also be specified as @samp{-v}.
-@end table
-
-@item -G @var{globpat}
-The filename expansion pattern @var{globpat} is expanded to generate
-the possible completions.
-
-@item -W @var{wordlist}
-The @var{wordlist} is split using the characters in the
-@code{IFS} special variable as delimiters, and each resultant word
-is expanded.
-The possible completions are the members of the resultant list which
-match the word being completed.
-
-@item -C @var{command}
-@var{command} is executed in a subshell environment, and its output is
-used as the possible completions.
-
-@item -F @var{function}
-The shell function @var{function} is executed in the current shell
-environment.
-When it finishes, the possible completions are retrieved from the value
-of the @code{COMPREPLY} array variable.
-
-@item -X @var{filterpat}
-@var{filterpat} is a pattern as used for filename expansion.
-It is applied to the list of possible completions generated by the
-preceding options and arguments, and each completion matching
-@var{filterpat} is removed from the list.
-A leading @samp{!} in @var{filterpat} negates the pattern; in this
-case, any completion not matching @var{filterpat} is removed.
-
-@item -P @var{prefix}
-@var{prefix} is added at the beginning of each possible completion
-after all other options have been applied.
-
-@item -S @var{suffix}
-@var{suffix} is appended to each possible completion
-after all other options have been applied.
-@end table
-
-The return value is true unless an invalid option is supplied, an option
-other than @samp{-p} or @samp{-r} is supplied without a @var{name}
-argument, an attempt is made to remove a completion specification for
-a @var{name} for which no specification exists, or
-an error occurs adding a completion specification.
-
-@end table
-@end ifset
diff --git a/readline/emacs_keymap.c b/readline/emacs_keymap.c
index daba213..4ba3858 100644
--- a/readline/emacs_keymap.c
+++ b/readline/emacs_keymap.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (BUFSIZ)
#include <stdio.h>
@@ -76,7 +76,11 @@ KEYMAP_ENTRY_ARRAY emacs_standard_keymap = {
{ ISFUNC, rl_insert }, /* & */
{ ISFUNC, rl_insert }, /* ' */
{ ISFUNC, rl_insert }, /* ( */
+#if defined (PAREN_MATCHING)
+ { ISFUNC, rl_insert_close }, /* ) */
+#else
{ ISFUNC, rl_insert }, /* ) */
+#endif /* !PAREN_MATCHING */
{ ISFUNC, rl_insert }, /* * */
{ ISFUNC, rl_insert }, /* + */
{ ISFUNC, rl_insert }, /* , */
@@ -136,7 +140,11 @@ KEYMAP_ENTRY_ARRAY emacs_standard_keymap = {
/* Some more punctuation. */
{ ISFUNC, rl_insert }, /* [ */
{ ISFUNC, rl_insert }, /* \ */
+#if defined (PAREN_MATCHING)
+ { ISFUNC, rl_insert_close }, /* ] */
+#else
{ ISFUNC, rl_insert }, /* ] */
+#endif /* !PAREN_MATCHING */
{ ISFUNC, rl_insert }, /* ^ */
{ ISFUNC, rl_insert }, /* _ */
{ ISFUNC, rl_insert }, /* ` */
@@ -172,7 +180,11 @@ KEYMAP_ENTRY_ARRAY emacs_standard_keymap = {
/* Final punctuation. */
{ ISFUNC, rl_insert }, /* { */
{ ISFUNC, rl_insert }, /* | */
+#if defined (PAREN_MATCHING)
+ { ISFUNC, rl_insert_close }, /* } */
+#else
{ ISFUNC, rl_insert }, /* } */
+#endif /* !PAREN_MATCHING */
{ ISFUNC, rl_insert }, /* ~ */
{ ISFUNC, rl_rubout }, /* RUBOUT */
diff --git a/readline/examples/Makefile.in b/readline/examples/Makefile.in
index 7246e75..879aa49 100644
--- a/readline/examples/Makefile.in
+++ b/readline/examples/Makefile.in
@@ -1,22 +1,5 @@
+# This is the Makefile for the examples subdirectory of readline. -*- text -*-
#
-# This is the Makefile for the readline examples subdirectory.
-#
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
-
SHELL = @MAKE_SHELL@
RM = rm -f
@@ -28,7 +11,7 @@ BUILD_DIR = .
DEFS = @DEFS@
CC = @CC@
CFLAGS = @CFLAGS@
-LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DREADLINE_LIBRARY
+LOCAL_CFLAGS = @LOCAL_CFLAGS@
CPPFLAGS = @CPPFLAGS@
INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
@@ -36,9 +19,6 @@ INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
LDFLAGS = -g -L..
-READLINE_LIB = ../libreadline.a
-HISTORY_LIB = ../libhistory.a
-
TERMCAP_LIB = @TERMCAP_LIB@
.c.o:
@@ -59,12 +39,12 @@ fileman: fileman.o
rltest: rltest.o
$(CC) $(LDFLAGS) -o $@ rltest.o -lreadline $(TERMCAP_LIB)
-rlversion: rlversion.o $(READLINE_LIB)
+rlversion: rlversion.o
$(CC) $(LDFLAGS) -o $@ rlversion.o -lreadline $(TERMCAP_LIB)
clean mostlyclean:
$(RM) $(OBJECTS)
- $(RM) $(EXECUTABLES) *.exe
+ $(RM) $(EXECUTABLES)
distclean maintainer-clean: clean
$(RM) Makefile
@@ -73,13 +53,3 @@ fileman.o: fileman.c
rltest.o: rltest.c
rl.o: rl.c
rlversion.o: rlversion.c
-
-# Stuff for Per Bothner's `rlfe' program
-
-rlfe: rlfe.o $(READLINE_LIB) $(HISTORY_LIB)
- $(CC) $(LDFLAGS) -o $@ rlfe.o -lreadline -lhistory ${TERMCAP_LIB}
-
-rlfe.o: rlfe.c
-
-rlfe.o: $(top_srcdir)/readline.h
-rlfe.o: $(top_srcdir)/history.h
diff --git a/readline/examples/fileman.c b/readline/examples/fileman.c
index dc29a40..0702a5b 100644
--- a/readline/examples/fileman.c
+++ b/readline/examples/fileman.c
@@ -1,22 +1,22 @@
/* fileman.c -- A tiny application which demonstrates how to use the
GNU Readline library. This application interactively allows users
to manipulate files and their modes. */
+/*
+ * Remove the next line if you're compiling this against an installed
+ * libreadline.a
+ */
+#define READLINE_LIBRARY
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_FILE_H
-# include <sys/file.h>
+#include <sys/file.h>
#endif
#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
@@ -26,10 +26,6 @@
# include <strings.h>
#endif /* !HAVE_STRING_H */
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
#ifdef READLINE_LIBRARY
# include "readline.h"
# include "history.h"
@@ -38,6 +34,7 @@
# include <readline/history.h>
#endif
+extern char *getwd ();
extern char *xmalloc ();
/* The names of functions that actually do the manipulation. */
@@ -303,12 +300,7 @@ com_view (arg)
if (!valid_argument ("view", arg))
return 1;
-#if defined (__MSDOS__)
- /* more.com doesn't grok slashes in pathnames */
- sprintf (syscom, "less %s", arg);
-#else
sprintf (syscom, "more %s", arg);
-#endif
return (system (syscom));
}
@@ -414,7 +406,7 @@ com_pwd (ignore)
{
char dir[1024], *s;
- s = getcwd (dir, sizeof(dir) - 1);
+ s = getwd (dir);
if (s == 0)
{
printf ("Error getting pwd: %s\n", dir);
diff --git a/readline/examples/rl.c b/readline/examples/rl.c
index 2d1d17e..17a6343 100644
--- a/readline/examples/rl.c
+++ b/readline/examples/rl.c
@@ -2,9 +2,15 @@
* rl - command-line interface to read a line from the standard input
* (or another fd) using readline.
*
- * usage: rl [-p prompt] [-u unit] [-d default] [-n nchars]
+ * usage: rl [-p prompt] [-u unit] [-d default]
*/
+/*
+ * Remove the next line if you're compiling this against an installed
+ * libreadline.a
+ */
+#define READLINE_LIBRARY
+
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
@@ -12,14 +18,8 @@
#include <stdio.h>
#include <sys/types.h>
#include "posixstat.h"
-
-#if defined (READLINE_LIBRARY)
-# include "readline.h"
-# include "history.h"
-#else
-# include <readline/readline.h>
-# include <readline/history.h>
-#endif
+#include "readline.h"
+#include "history.h"
extern int optind;
extern char *optarg;
@@ -40,24 +40,22 @@ set_deftext ()
deftext = (char *)NULL;
rl_startup_hook = (Function *)NULL;
}
- return 0;
}
static void
usage()
{
- fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default] [-n nchars]\n",
+ fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default]\n",
progname, progname);
}
-int
main (argc, argv)
int argc;
char **argv;
{
char *temp, *prompt;
struct stat sb;
- int opt, fd, nch;
+ int opt, fd;
FILE *ifp;
progname = strrchr(argv[0], '/');
@@ -68,10 +66,10 @@ main (argc, argv)
/* defaults */
prompt = "readline$ ";
- fd = nch = 0;
+ fd = 0;
deftext = (char *)0;
- while ((opt = getopt(argc, argv, "p:u:d:n:")) != EOF)
+ while ((opt = getopt(argc, argv, "p:u:d:")) != EOF)
{
switch (opt)
{
@@ -89,14 +87,6 @@ main (argc, argv)
case 'd':
deftext = optarg;
break;
- case 'n':
- nch = atoi(optarg);
- if (nch < 0)
- {
- fprintf (stderr, "%s: bad value for -n: `%s'\n", progname, optarg);
- exit (2);
- }
- break;
default:
usage ();
exit (2);
@@ -117,9 +107,6 @@ main (argc, argv)
if (deftext && *deftext)
rl_startup_hook = set_deftext;
- if (nch > 0)
- rl_num_chars_to_read = nch;
-
temp = readline (prompt);
/* Test for EOF. */
diff --git a/readline/examples/rltest.c b/readline/examples/rltest.c
index 6250f90..453f8ec 100644
--- a/readline/examples/rltest.c
+++ b/readline/examples/rltest.c
@@ -4,20 +4,20 @@
/* */
/* **************************************************************** */
+/*
+ * Remove the next line if you're compiling this against an installed
+ * libreadline.a
+ */
+#define READLINE_LIBRARY
+
#if defined (HAVE_CONFIG_H)
#include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
-
-#ifdef READLINE_LIBRARY
-# include "readline.h"
-# include "history.h"
-#else
-# include <readline/readline.h>
-# include <readline/history.h>
-#endif
+#include "readline.h"
+#include "history.h"
extern HIST_ENTRY **history_list ();
diff --git a/readline/examples/rlversion.c b/readline/examples/rlversion.c
index 652d37c..2d73a96 100644
--- a/readline/examples/rlversion.c
+++ b/readline/examples/rlversion.c
@@ -2,6 +2,8 @@
* rlversion -- print out readline's version number
*/
+#define READLINE_LIBRARY
+
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
@@ -10,11 +12,7 @@
#include <sys/types.h>
#include "posixstat.h"
-#ifdef READLINE_LIBRARY
-# include "readline.h"
-#else
-# include <readline/readline.h>
-#endif
+#include "readline.h"
main()
{
diff --git a/readline/funmap.c b/readline/funmap.c
index 1f7ba87..f6b8628 100644
--- a/readline/funmap.c
+++ b/readline/funmap.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,13 +18,15 @@
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,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
+extern char *xmalloc (), *xrealloc ();
+
#if !defined (BUFSIZ)
#include <stdio.h>
#endif /* BUFSIZ */
@@ -38,14 +40,6 @@
#include "rlconf.h"
#include "readline.h"
-#include "xmalloc.h"
-
-#ifdef __STDC__
-typedef int QSFUNC (const void *, const void *);
-#else
-typedef int QSFUNC ();
-#endif
-
extern int _rl_qsort_string_compare ();
FUNMAP **funmap;
@@ -246,7 +240,7 @@ rl_funmap_names ()
result[result_index + 1] = (char *)NULL;
}
- qsort (result, result_index, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
+ qsort (result, result_index, sizeof (char *), _rl_qsort_string_compare);
return (result);
}
diff --git a/readline/histexpand.c b/readline/histexpand.c
index 78da3e5..392e6d3 100644
--- a/readline/histexpand.c
+++ b/readline/histexpand.c
@@ -7,7 +7,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
@@ -50,9 +50,6 @@
#include "history.h"
#include "histlib.h"
-#include "rlshell.h"
-#include "xmalloc.h"
-
#define HISTORY_WORD_DELIMITERS " \t\n;&()|<>"
#define HISTORY_QUOTE_CHARACTERS "\"'`"
@@ -63,10 +60,15 @@ static char *subst_rhs;
static int subst_lhs_len;
static int subst_rhs_len;
-static char *get_history_word_specifier __P((char *, char *, int *));
-static char *history_find_word __P((char *, int));
+static char *get_history_word_specifier ();
+static char *history_find_word ();
+
+extern int history_offset;
+
+extern char *single_quote ();
+static char *quote_breaks ();
-static char *quote_breaks __P((char *));
+extern char *xmalloc (), *xrealloc ();
/* Variables exported by this file. */
/* The character that represents the start of a history expansion
diff --git a/readline/histfile.c b/readline/histfile.c
index b908e22..9437e99 100644
--- a/readline/histfile.c
+++ b/readline/histfile.c
@@ -7,7 +7,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
/* The goal is to make the implementation transparent, so that you
don't have to know what data types are used, just what functions
@@ -35,7 +35,7 @@
#ifndef _MINIX
# include <sys/file.h>
#endif
-#include "posixstat.h"
+#include <sys/stat.h>
#include <fcntl.h>
#if defined (HAVE_STDLIB_H)
@@ -54,19 +54,15 @@
# include <strings.h>
#endif /* !HAVE_STRING_H */
-
-/* If we're compiling for __EMX__ (OS/2) or __CYGWIN__ (cygwin32 environment
- on win 95/98/nt), we want to open files with O_BINARY mode so that there
- is no \n -> \r\n conversion performed. On other systems, we don't want to
- mess around with O_BINARY at all, so we ensure that it's defined to 0. */
-#if defined (__EMX__) || defined (__CYGWIN__)
+#if defined (__EMX__)
# ifndef O_BINARY
# define O_BINARY 0
# endif
-#else /* !__EMX__ && !__CYGWIN__ */
+#else /* !__EMX__ */
+ /* If we're not compiling for __EMX__, we don't want this at all. Ever. */
# undef O_BINARY
# define O_BINARY 0
-#endif /* !__EMX__ && !__CYGWIN__ */
+#endif /* !__EMX__ */
#include <errno.h>
#if !defined (errno)
@@ -76,8 +72,10 @@ extern int errno;
#include "history.h"
#include "histlib.h"
-#include "rlshell.h"
-#include "xmalloc.h"
+/* Functions imported from shell.c */
+extern char *get_env_value ();
+
+extern char *xmalloc (), *xrealloc ();
/* Return the string that should be used in the place of this
filename. This only matters when you don't specify the
@@ -107,11 +105,7 @@ history_filename (filename)
return_val = xmalloc (2 + home_len + 8); /* strlen(".history") == 8 */
strcpy (return_val, home);
return_val[home_len] = '/';
-#if defined (__MSDOS__)
- strcpy (return_val + home_len + 1, "_history");
-#else
strcpy (return_val + home_len + 1, ".history");
-#endif
return (return_val);
}
@@ -138,7 +132,7 @@ read_history_range (filename, from, to)
{
register int line_start, line_end;
char *input, *buffer;
- int file, current_line, chars_read;
+ int file, current_line;
struct stat finfo;
size_t file_size;
@@ -146,6 +140,16 @@ read_history_range (filename, from, to)
input = history_filename (filename);
file = open (input, O_RDONLY|O_BINARY, 0666);
+
+#ifdef __MSDOS__
+ /* MSDOS doesn't allow leading dots in file names. Try again
+ with the dot replaced by an underscore. */
+ if (file < 0 && !filename)
+ {
+ input[strlen (input) - 8] = '_';
+ file = open (input, O_RDONLY|O_BINARY, 0666);
+ }
+#endif
if ((file < 0) || (fstat (file, &finfo) == -1))
goto error_and_exit;
@@ -161,9 +165,11 @@ read_history_range (filename, from, to)
}
buffer = xmalloc (file_size + 1);
-
- chars_read = read (file, buffer, file_size);
- if (chars_read < 0)
+#if 0
+ if (read (file, buffer, file_size) != file_size)
+#else
+ if (read (file, buffer, file_size) < 0)
+#endif
{
error_and_exit:
if (file >= 0)
@@ -179,15 +185,15 @@ read_history_range (filename, from, to)
/* Set TO to larger than end of file if negative. */
if (to < 0)
- to = chars_read;
+ to = file_size;
/* Start at beginning of file, work to end. */
line_start = line_end = current_line = 0;
/* Skip lines until we are at FROM. */
- while (line_start < chars_read && current_line < from)
+ while (line_start < file_size && current_line < from)
{
- for (line_end = line_start; line_end < chars_read; line_end++)
+ for (line_end = line_start; line_end < file_size; line_end++)
if (buffer[line_end] == '\n')
{
current_line++;
@@ -198,7 +204,7 @@ read_history_range (filename, from, to)
}
/* If there are lines left to gobble, then gobble them now. */
- for (line_end = line_start; line_end < chars_read; line_end++)
+ for (line_end = line_start; line_end < file_size; line_end++)
if (buffer[line_end] == '\n')
{
buffer[line_end] = '\0';
@@ -237,11 +243,17 @@ history_truncate_file (fname, lines)
filename = history_filename (fname);
file = open (filename, O_RDONLY|O_BINARY, 0666);
- if (file == -1 || fstat (file, &finfo) == -1)
- goto truncate_exit;
+#ifdef __MSDOS__
+ /* MSDOS doesn't allow leading dots in file names. Try again
+ with the dot replaced by an underscore. */
+ if (file < 0 && !fname)
+ {
+ filename[strlen (filename) - 8] = '_';
+ file = open (filename, O_RDONLY|O_BINARY, 0666);
+ }
+#endif
- /* Don't try to truncate non-regular files. */
- if (S_ISREG(finfo.st_mode) == 0)
+ if (file == -1 || fstat (file, &finfo) == -1)
goto truncate_exit;
file_size = (size_t)finfo.st_size;
@@ -287,11 +299,11 @@ history_truncate_file (fname, lines)
truncate to. */
if (i && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
{
- write (file, buffer + i, chars_read - i);
+ write (file, buffer + i, file_size - i);
#if defined (__BEOS__)
/* BeOS ignores O_TRUNC. */
- ftruncate (file, chars_read - i);
+ ftruncate (file, file_size - i);
#endif
close (file);
@@ -322,8 +334,23 @@ history_do_write (filename, nelements, overwrite)
if ((file = open (output, mode, 0600)) == -1)
{
+#ifdef __MSDOS__
+ /* MSDOS doesn't allow leading dots in file names. If this is
+ the default file name, try again with the dot replaced by an
+ underscore. */
+ if (!filename)
+ {
+ output[strlen (output) - 8] = '_';
+ if ((file = open (output, mode, 0600)) == -1)
+ {
+ FREE (output);
+ return (errno);
+ }
+ }
+#else
FREE (output);
return (errno);
+#endif
}
if (nelements > history_length)
diff --git a/readline/histlib.h b/readline/histlib.h
index 88a34d1..422cf59 100644
--- a/readline/histlib.h
+++ b/readline/histlib.h
@@ -6,7 +6,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -17,7 +17,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_HISTLIB_H_)
#define _HISTLIB_H_
@@ -31,11 +31,8 @@ typedef char *CPFunction ();
typedef char **CPPFunction ();
#endif /* _FUNCTION_DEF */
-#if !defined (STREQ)
#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
-#define STREQN(a, b, n) (((n) == 0) ? (1) \
- : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
-#endif
+#define STREQN(a, b, n) (((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
#ifndef savestring
# ifndef strcpy
@@ -82,7 +79,4 @@ extern char *strchr ();
#define HISTORY_APPEND 0
#define HISTORY_OVERWRITE 1
-/* Some variable definitions shared across history source files. */
-extern int history_offset;
-
#endif /* !_HISTLIB_H_ */
diff --git a/readline/history.c b/readline/history.c
index 400f18b..d56ffac 100644
--- a/readline/history.c
+++ b/readline/history.c
@@ -7,7 +7,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
/* The goal is to make the implementation transparent, so that you
don't have to know what data types are used, just what functions
@@ -53,7 +53,7 @@
#include "history.h"
#include "histlib.h"
-#include "xmalloc.h"
+extern char *xmalloc (), *xrealloc ();
/* The number of slots to increase the_history by. */
#define DEFAULT_HISTORY_GROW_SIZE 50
diff --git a/readline/history.h b/readline/history.h
index 5210deb..8ecce72 100644
--- a/readline/history.h
+++ b/readline/history.h
@@ -6,7 +6,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -17,7 +17,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _HISTORY_H_
#define _HISTORY_H_
@@ -119,7 +119,7 @@ extern int where_history __P((void));
/* Return the history entry at the current position, as determined by
history_offset. If there is no entry there, return a NULL pointer. */
-extern HIST_ENTRY *current_history __P((void));
+HIST_ENTRY *current_history __P((void));
/* Return the history entry which is logically at OFFSET in the history
array. OFFSET is relative to history_base. */
@@ -132,7 +132,7 @@ extern int history_total_bytes __P((void));
/* Moving around the history list. */
/* Set the position in the history list to POS. */
-extern int history_set_pos __P((int));
+int history_set_pos __P((int));
/* Back up history_offset to the previous history entry, and return
a pointer to that entry. If there is no previous entry, return
@@ -187,7 +187,7 @@ extern int write_history __P((char *));
/* Append NELEMENT entries to FILENAME. The entries appended are from
the end of the list minus NELEMENTs up to the end of the list. */
-extern int append_history __P((int, char *));
+int append_history __P((int, char *));
/* Truncate the history file, leaving only the last NLINES lines. */
extern int history_truncate_file __P((char *, int));
diff --git a/readline/histsearch.c b/readline/histsearch.c
index 8d153b6..7e98e95 100644
--- a/readline/histsearch.c
+++ b/readline/histsearch.c
@@ -7,7 +7,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
@@ -47,6 +47,9 @@
#include "history.h"
#include "histlib.h"
+/* Variables imported from other history library files. */
+extern int history_offset;
+
/* The list of alternate characters that can delimit a history search
string. */
char *history_search_delimiter_chars = (char *)NULL;
diff --git a/readline/input.c b/readline/input.c
index 64a55c6..a8ba23c 100644
--- a/readline/input.c
+++ b/readline/input.c
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -67,15 +67,39 @@ extern int errno;
/* Some standard library routines. */
#include "readline.h"
-#include "rlprivate.h"
-#include "rlshell.h"
-#include "xmalloc.h"
-
/* What kind of non-blocking I/O do we have? */
#if !defined (O_NDELAY) && defined (O_NONBLOCK)
# define O_NDELAY O_NONBLOCK /* Posix style */
#endif
+/* Functions imported from other files in the library. */
+extern char *xmalloc (), *xrealloc ();
+
+/* Variables and functions from macro.c. */
+extern void _rl_add_macro_char ();
+extern void _rl_with_macro_input ();
+extern int _rl_next_macro_key ();
+extern int _rl_defining_kbd_macro;
+
+#if defined (VI_MODE)
+extern void _rl_vi_set_last ();
+extern int _rl_vi_textmod_command ();
+#endif /* VI_MODE */
+
+extern FILE *rl_instream, *rl_outstream;
+extern Function *rl_last_func;
+extern int rl_key_sequence_length;
+extern int rl_pending_input;
+extern int rl_editing_mode;
+
+extern Keymap _rl_keymap;
+
+extern int _rl_convert_meta_chars_to_ascii;
+
+#if defined (__GO32__) && !defined (HAVE_SELECT)
+# include <pc.h>
+#endif /* __GO32__ */
+
/* Non-null means it is a pointer to a function to run while waiting for
character input. */
Function *rl_event_hook = (Function *)NULL;
@@ -152,6 +176,17 @@ rl_unget_char (key)
static void
rl_gather_tyi ()
{
+#if defined (__GO32__) && !defined (HAVE_SELECT)
+ char input;
+
+ if (isatty (0) && kbhit () && ibuffer_space ())
+ {
+ int i;
+ i = (*rl_getc_function) (rl_instream);
+ rl_stuff_char (i);
+ }
+#else /* !__GO32__ */
+
int tty;
register int tem, result;
int chars_avail;
@@ -220,6 +255,7 @@ rl_gather_tyi ()
if (chars_avail)
rl_stuff_char (input);
}
+#endif /* !__GO32__ */
}
/* Is there input available to be read on the readline input file
@@ -358,9 +394,14 @@ int
rl_getc (stream)
FILE *stream;
{
- int result;
+ int result, flags;
unsigned char c;
+#if defined (__GO32__) && !defined (HAVE_TERMIOS_H)
+ if (isatty (0))
+ return (getkey () & 0x7F);
+#endif /* __GO32__ */
+
while (1)
{
result = read (fileno (stream), &c, sizeof (unsigned char));
@@ -379,31 +420,40 @@ rl_getc (stream)
#endif
#if defined (EWOULDBLOCK)
-# define X_EWOULDBLOCK EWOULDBLOCK
-#else
-# define X_EWOULDBLOCK -99
-#endif
-
-#if defined (EAGAIN)
-# define X_EAGAIN EAGAIN
-#else
-# define X_EAGAIN -99
-#endif
-
- if (errno == X_EWOULDBLOCK || errno == X_EAGAIN)
+ if (errno == EWOULDBLOCK)
{
- if (unset_nodelay_mode (fileno (stream)) < 0)
+ if ((flags = fcntl (fileno (stream), F_GETFL, 0)) < 0)
return (EOF);
+ if (flags & O_NDELAY)
+ {
+ flags &= ~O_NDELAY;
+ fcntl (fileno (stream), F_SETFL, flags);
+ continue;
+ }
continue;
}
+#endif /* EWOULDBLOCK */
-#undef X_EWOULDBLOCK
-#undef X_EAGAIN
+#if defined (_POSIX_VERSION) && defined (EAGAIN) && defined (O_NONBLOCK)
+ if (errno == EAGAIN)
+ {
+ if ((flags = fcntl (fileno (stream), F_GETFL, 0)) < 0)
+ return (EOF);
+ if (flags & O_NONBLOCK)
+ {
+ flags &= ~O_NONBLOCK;
+ fcntl (fileno (stream), F_SETFL, flags);
+ continue;
+ }
+ }
+#endif /* _POSIX_VERSION && EAGAIN && O_NONBLOCK */
+#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
/* If the error that we received was SIGINT, then try again,
this is simply an interrupted system call to read ().
Otherwise, some error ocurred, also signifying EOF. */
if (errno != EINTR)
return (EOF);
+#endif /* !__GO32__ */
}
}
diff --git a/readline/isearch.c b/readline/isearch.c
index 952c10d..67279e1 100644
--- a/readline/isearch.c
+++ b/readline/isearch.c
@@ -12,7 +12,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -23,7 +23,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -48,17 +48,24 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "xmalloc.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. */
+extern Keymap _rl_keymap;
extern HIST_ENTRY *saved_line_for_history;
+extern int rl_line_buffer_len;
+extern int rl_point, rl_end;
+extern char *rl_line_buffer;
+
+extern int rl_execute_next ();
+extern void rl_extend_line_buffer ();
+
+extern int _rl_input_available ();
+
+extern char *xmalloc (), *xrealloc ();
-/* Forward declarations */
-static int rl_search_history __P((int, int));
+static int rl_search_history ();
/* Last line found by the current incremental search, so we don't `find'
identical lines many times in a row. */
diff --git a/readline/keymaps.c b/readline/keymaps.c
index 8fb7de3..c73666b 100644
--- a/readline/keymaps.c
+++ b/readline/keymaps.c
@@ -7,7 +7,7 @@
Readline 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
+ Free Software Foundation; either version 1, or (at your option) any
later version.
Readline is distributed in the hope that it will be useful, but
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with Readline; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -30,18 +30,18 @@
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
-#include <stdio.h> /* for FILE * definition for readline.h */
-
-#include "readline.h"
#include "rlconf.h"
-
+#include "keymaps.h"
#include "emacs_keymap.c"
#if defined (VI_MODE)
#include "vi_keymap.c"
#endif
-#include "xmalloc.h"
+extern int rl_do_lowercase_version ();
+extern int rl_rubout (), rl_insert ();
+
+extern char *xmalloc (), *xrealloc ();
/* **************************************************************** */
/* */
diff --git a/readline/keymaps.h b/readline/keymaps.h
index 3a504fb..5dff46f 100644
--- a/readline/keymaps.h
+++ b/readline/keymaps.h
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,15 +18,11 @@
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,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _KEYMAPS_H_
#define _KEYMAPS_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#if defined (READLINE_LIBRARY)
# include "rlstdc.h"
# include "chardefs.h"
@@ -101,8 +97,4 @@ extern Keymap rl_get_keymap __P((void));
/* Set the current keymap to MAP. */
extern void rl_set_keymap __P((Keymap));
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _KEYMAPS_H_ */
diff --git a/readline/kill.c b/readline/kill.c
index c3241bd..0b4714f 100644
--- a/readline/kill.c
+++ b/readline/kill.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -46,8 +46,17 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "xmalloc.h"
+extern int _rl_last_command_was_kill;
+extern int rl_editing_mode;
+extern int rl_explicit_arg;
+extern Function *rl_last_func;
+
+extern void _rl_init_argument ();
+extern int _rl_set_mark_at_pos ();
+extern void _rl_fix_point ();
+extern void _rl_abort_internal ();
+
+extern char *xmalloc (), *xrealloc ();
/* **************************************************************** */
/* */
@@ -376,12 +385,10 @@ int
rl_kill_region (count, ignore)
int count, ignore;
{
- int r, npoint;
+ int r;
- npoint = (rl_point < rl_mark) ? rl_point : rl_mark;
r = region_kill_internal (1);
_rl_fix_point (1);
- rl_point = npoint;
return r;
}
@@ -496,9 +503,7 @@ rl_yank_nth_arg_internal (count, ignore, history_skip)
{
register HIST_ENTRY *entry;
char *arg;
- int i, pos;
-
- pos = where_history ();
+ int i;
if (history_skip)
{
@@ -507,10 +512,16 @@ rl_yank_nth_arg_internal (count, ignore, history_skip)
}
entry = previous_history ();
-
- history_set_pos (pos);
-
- if (entry == 0)
+ if (entry)
+ {
+ if (history_skip)
+ {
+ for (i = 0; i < history_skip; i++)
+ next_history ();
+ }
+ next_history ();
+ }
+ else
{
ding ();
return -1;
diff --git a/readline/macro.c b/readline/macro.c
index 5a44852..f3c442b 100644
--- a/readline/macro.c
+++ b/readline/macro.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -46,11 +46,20 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "xmalloc.h"
-
#define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0)
+/* Forward definitions. */
+void _rl_push_executing_macro (), _rl_pop_executing_macro ();
+void _rl_add_macro_char ();
+
+/* Extern declarations. */
+extern int rl_explicit_arg;
+extern int rl_key_sequence_length;
+
+extern void _rl_abort_internal ();
+
+extern char *xmalloc (), *xrealloc ();
+
/* **************************************************************** */
/* */
/* Hacking Keyboard Macros */
diff --git a/readline/nls.c b/readline/nls.c
index 67bed8a..f2d413d 100644
--- a/readline/nls.c
+++ b/readline/nls.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -27,8 +27,6 @@
#include <sys/types.h>
-#include <stdio.h>
-
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -46,9 +44,13 @@
#include <ctype.h>
#include "rldefs.h"
-#include "readline.h"
-#include "rlshell.h"
-#include "rlprivate.h"
+
+extern int _rl_convert_meta_chars_to_ascii;
+extern int _rl_output_meta_chars;
+extern int _rl_meta_flag;
+
+/* Functions imported from shell.c */
+extern char *get_env_value ();
#if !defined (HAVE_SETLOCALE)
/* A list of legal values for the LANG or LC_CTYPE environment variables.
@@ -68,11 +70,12 @@ static char *legal_lang_values[] =
"iso88599",
"iso885910",
"koi8r",
+ "koi8-r",
0
};
-static char *normalize_codeset __P((char *));
-static char *find_codeset __P((char *, size_t *));
+static char *normalize_codeset ();
+static char *find_codeset ();
#endif /* !HAVE_SETLOCALE */
/* Check for LC_ALL, LC_CTYPE, and LANG and use the first with a value
diff --git a/readline/parens.c b/readline/parens.c
index b6de529..a500c0a 100644
--- a/readline/parens.c
+++ b/readline/parens.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,11 +18,23 @@
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,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#include "rlconf.h"
+#if !defined (PAREN_MATCHING)
+extern int rl_insert ();
+
+int
+rl_insert_close (count, invoking_key)
+ int count, invoking_key;
+{
+ return (rl_insert (count, invoking_key));
+}
+
+#else /* PAREN_MATCHING */
+
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
@@ -52,9 +64,8 @@ extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
#include "readline.h"
-#include "rlprivate.h"
-static int find_matching_open __P((char *, int, int));
+extern int rl_explicit_arg;
/* Non-zero means try to blink the matching open parenthesis when the
close parenthesis is inserted. */
@@ -64,25 +75,7 @@ int rl_blink_matching_paren = 1;
int rl_blink_matching_paren = 0;
#endif /* !HAVE_SELECT */
-/* Change emacs_standard_keymap to have bindings for paren matching when
- ON_OR_OFF is 1, change them back to self_insert when ON_OR_OFF == 0. */
-void
-_rl_enable_paren_matching (on_or_off)
- int on_or_off;
-{
- if (on_or_off)
- { /* ([{ */
- rl_bind_key_in_map (')', rl_insert_close, emacs_standard_keymap);
- rl_bind_key_in_map (']', rl_insert_close, emacs_standard_keymap);
- rl_bind_key_in_map ('}', rl_insert_close, emacs_standard_keymap);
- }
- else
- { /* ([{ */
- rl_bind_key_in_map (')', rl_insert, emacs_standard_keymap);
- rl_bind_key_in_map (']', rl_insert, emacs_standard_keymap);
- rl_bind_key_in_map ('}', rl_insert, emacs_standard_keymap);
- }
-}
+static int find_matching_open ();
int
rl_insert_close (count, invoking_key)
@@ -159,3 +152,5 @@ find_matching_open (string, from, closer)
}
return (i);
}
+
+#endif /* PAREN_MATCHING */
diff --git a/readline/posixdir.h b/readline/posixdir.h
index 98ced75..7480a93 100644
--- a/readline/posixdir.h
+++ b/readline/posixdir.h
@@ -6,7 +6,7 @@
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 2, or (at your option)
+ 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
@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This file should be included instead of <dirent.h> or <sys/dir.h>. */
diff --git a/readline/posixjmp.h b/readline/posixjmp.h
index b52aa00..1347cc0 100644
--- a/readline/posixjmp.h
+++ b/readline/posixjmp.h
@@ -1,23 +1,5 @@
/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */
-/* Copyright (C) 1987,1991 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 2, 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
-
#ifndef _POSIXJMP_H_
#define _POSIXJMP_H_
diff --git a/readline/posixstat.h b/readline/posixstat.h
index c93b528..bfce8c0 100644
--- a/readline/posixstat.h
+++ b/readline/posixstat.h
@@ -7,7 +7,7 @@
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 2, or (at your option)
+ 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
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This file should be included instead of <sys/stat.h>.
It relies on the local sys/stat.h to work though. */
diff --git a/readline/readline.c b/readline/readline.c
index 2c6aef6..6bd25f7 100644
--- a/readline/readline.c
+++ b/readline/readline.c
@@ -8,7 +8,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -47,6 +47,7 @@
# include <locale.h>
#endif
+#include <signal.h>
#include <stdio.h>
#include "posixjmp.h"
@@ -62,27 +63,119 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "rlshell.h"
-#include "xmalloc.h"
-
#ifndef RL_LIBRARY_VERSION
-# define RL_LIBRARY_VERSION "4.1"
+# define RL_LIBRARY_VERSION "4.0"
#endif
/* Evaluates its arguments multiple times. */
#define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0)
+/* NOTE: Functions and variables prefixed with `_rl_' are
+ pseudo-global: they are global so they can be shared
+ between files in the readline library, but are not intended
+ to be visible to readline callers. */
+
+/* Variables and functions imported from terminal.c */
+extern int _rl_init_terminal_io ();
+extern void _rl_enable_meta_key ();
+#ifdef _MINIX
+extern void _rl_output_character_function ();
+#else
+extern int _rl_output_character_function ();
+#endif
+
+extern int _rl_enable_meta;
+extern int _rl_term_autowrap;
+extern int screenwidth, screenheight, screenchars;
+
+/* Variables and functions imported from rltty.c. */
+extern void rl_prep_terminal (), rl_deprep_terminal ();
+extern void rltty_set_default_bindings ();
+
+/* Functions imported from util.c. */
+extern void _rl_abort_internal ();
+extern void rl_extend_line_buffer ();
+extern int alphabetic ();
+
+/* Functions imported from bind.c. */
+extern void _rl_bind_if_unbound ();
+
+/* Functions imported from input.c. */
+extern int _rl_any_typein ();
+extern void _rl_insert_typein ();
+extern int rl_read_key ();
+
+/* Functions imported from nls.c */
+extern int _rl_init_eightbit ();
+
+/* Functions imported from shell.c */
+extern char *get_env_value ();
+
+/* External redisplay functions and variables from display.c */
+extern void _rl_move_vert ();
+extern void _rl_update_final ();
+extern void _rl_clear_to_eol ();
+extern void _rl_clear_screen ();
+extern void _rl_erase_entire_line ();
+
+extern void _rl_erase_at_end_of_line ();
+extern void _rl_move_cursor_relative ();
+
+extern int _rl_vis_botlin;
+extern int _rl_last_c_pos;
+extern int _rl_horizontal_scroll_mode;
+extern int rl_display_fixed;
+extern int _rl_suppress_redisplay;
+extern char *rl_display_prompt;
+
+/* Variables imported from complete.c. */
+extern char *rl_completer_word_break_characters;
+extern char *rl_basic_word_break_characters;
+extern int rl_completion_query_items;
+extern int rl_complete_with_tilde_expansion;
+
+/* Variables and functions from macro.c. */
+extern void _rl_add_macro_char ();
+extern void _rl_with_macro_input ();
+extern int _rl_next_macro_key ();
+extern int _rl_defining_kbd_macro;
+
+#if defined (VI_MODE)
+/* Functions imported from vi_mode.c. */
+extern void _rl_vi_set_last ();
+extern void _rl_vi_reset_last ();
+extern void _rl_vi_done_inserting ();
+extern int _rl_vi_textmod_command ();
+extern void _rl_vi_initialize_line ();
+#endif /* VI_MODE */
+
+extern UNDO_LIST *rl_undo_list;
+extern int _rl_doing_an_undo;
+
/* Forward declarations used in this file. */
-void _rl_free_history_entry __P((HIST_ENTRY *));
+void _rl_free_history_entry ();
-static char *readline_internal __P((void));
-static void readline_initialize_everything __P((void));
-static void start_using_history __P((void));
-static void bind_arrow_keys __P((void));
-static int rl_change_case __P((int, int));
+int _rl_dispatch ();
+int _rl_init_argument ();
-static void readline_default_bindings __P((void));
+static char *readline_internal ();
+static void readline_initialize_everything ();
+static void start_using_history ();
+static void bind_arrow_keys ();
+
+#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
+static void readline_default_bindings ();
+#endif /* !__GO32__ */
+
+#if defined (__GO32__)
+# include <go32.h>
+# include <pc.h>
+# if !defined (__DJGPP__)
+# undef HANDLE_SIGNALS
+# endif /* !__DJGPP__ */
+#endif /* __GO32__ */
+
+extern char *xmalloc (), *xrealloc ();
/* **************************************************************** */
/* */
@@ -92,8 +185,6 @@ static void readline_default_bindings __P((void));
char *rl_library_version = RL_LIBRARY_VERSION;
-int rl_gnu_readline_p = 1;
-
/* A pointer to the keymap that is currently in use.
By default, it is the standard emacs keymap. */
Keymap _rl_keymap = emacs_standard_keymap;
@@ -156,10 +247,6 @@ int readline_echoing_p = 1;
char *rl_prompt;
int rl_visible_prompt_length = 0;
-/* Set to non-zero by calling application if it has already printed rl_prompt
- and does not want readline to do it the first time. */
-int rl_already_prompted = 0;
-
/* The number of characters read in order to type this complete command. */
int rl_key_sequence_length = 0;
@@ -205,10 +292,6 @@ Keymap rl_executing_keymap;
/* Non-zero means to erase entire line, including prompt, on empty input lines. */
int rl_erase_empty_line = 0;
-/* Non-zero means to read only this many characters rather than up to a
- character bound to accept-line. */
-int rl_num_chars_to_read;
-
/* Line buffer and maintenence. */
char *rl_line_buffer = (char *)NULL;
int rl_line_buffer_len = 0;
@@ -288,8 +371,6 @@ readline (prompt)
STATIC_CALLBACK void
readline_internal_setup ()
{
- char *nprompt;
-
_rl_in_stream = rl_instream;
_rl_out_stream = rl_outstream;
@@ -298,20 +379,15 @@ readline_internal_setup ()
if (readline_echoing_p == 0)
{
- if (rl_prompt && rl_already_prompted == 0)
+ if (rl_prompt)
{
- nprompt = _rl_strip_prompt (rl_prompt);
- fprintf (_rl_out_stream, "%s", nprompt);
+ fprintf (_rl_out_stream, "%s", rl_prompt);
fflush (_rl_out_stream);
- free (nprompt);
}
}
else
{
- if (rl_prompt && rl_already_prompted)
- rl_on_new_line_with_prompt ();
- else
- rl_on_new_line ();
+ rl_on_new_line ();
(*rl_redisplay_function) ();
#if defined (VI_MODE)
if (rl_editing_mode == vi_mode)
@@ -403,7 +479,7 @@ readline_internal_charloop ()
}
lastc = c;
- _rl_dispatch ((unsigned char)c, _rl_keymap);
+ _rl_dispatch (c, _rl_keymap);
/* If there was no change in _rl_last_command_was_kill, then no kill
has taken place. Note that if input is pending we are reading
@@ -418,12 +494,6 @@ readline_internal_charloop ()
rl_vi_check ();
#endif /* VI_MODE */
- if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read)
- {
- (*rl_redisplay_function) ();
- rl_newline (1, '\n');
- }
-
if (rl_done == 0)
(*rl_redisplay_function) ();
@@ -621,7 +691,6 @@ rl_initialize ()
return 0;
}
-#if 0
#if defined (__EMX__)
static void
_emx_build_environ ()
@@ -645,18 +714,15 @@ _emx_build_environ ()
*tp = 0;
}
#endif /* __EMX__ */
-#endif
/* Initialize the entire state of the world. */
static void
readline_initialize_everything ()
{
-#if 0
#if defined (__EMX__)
if (environ == 0)
_emx_build_environ ();
#endif
-#endif
/* Find out if we are running in Emacs. */
running_in_emacs = get_env_value ("EMACS") != (char *)0;
@@ -681,8 +747,10 @@ readline_initialize_everything ()
/* Initialize the terminal interface. */
_rl_init_terminal_io ((char *)NULL);
+#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
/* Bind tty characters to readline functions. */
readline_default_bindings ();
+#endif /* !__GO32__ || HAVE_TERMIOS_H */
/* Initialize the function names. */
rl_initialize_funmap ();
@@ -731,17 +799,6 @@ bind_arrow_keys_internal ()
{
Function *f;
-#if defined (__MSDOS__)
- f = rl_function_of_keyseq ("\033[0A", _rl_keymap, (int *)NULL);
- if (!f || f == rl_do_lowercase_version)
- {
- _rl_bind_if_unbound ("\033[0A", rl_get_previous_history);
- _rl_bind_if_unbound ("\033[0B", rl_backward);
- _rl_bind_if_unbound ("\033[0C", rl_forward);
- _rl_bind_if_unbound ("\033[0D", rl_get_next_history);
- }
-#endif
-
f = rl_function_of_keyseq ("\033[A", _rl_keymap, (int *)NULL);
if (!f || f == rl_do_lowercase_version)
{
@@ -1066,10 +1123,6 @@ rl_forward (count, key)
else
rl_point = end;
}
-
- if (rl_end < 0)
- rl_end = 0;
-
return 0;
}
@@ -1204,14 +1257,35 @@ int
rl_refresh_line (ignore1, ignore2)
int ignore1, ignore2;
{
- int curr_line;
+ int curr_line, nleft;
- curr_line = _rl_current_display_line ();
+ /* Find out whether or not there might be invisible characters in the
+ editing buffer. */
+ if (rl_display_prompt == rl_prompt)
+ nleft = _rl_last_c_pos - screenwidth - rl_visible_prompt_length;
+ else
+ nleft = _rl_last_c_pos - screenwidth;
+
+ if (nleft > 0)
+ curr_line = 1 + nleft / screenwidth;
+ else
+ curr_line = 0;
_rl_move_vert (curr_line);
_rl_move_cursor_relative (0, the_line); /* XXX is this right */
+#if defined (__GO32__) && !defined (__DJGPP__)
+ {
+ int row, col, width, row_start;
+
+ ScreenGetCursor (&row, &col);
+ width = ScreenCols ();
+ row_start = ScreenPrimary + (row * width);
+ memset (row_start + col, 0, (width - col) * 2);
+ }
+#else /* !__GO32__ || __DJGPP__ */
_rl_clear_to_eol (0); /* arg of 0 means to not use spaces */
+#endif /* !__GO32__ || __DJGPP__ */
rl_forced_update_display ();
rl_display_fixed = 1;
@@ -1349,14 +1423,7 @@ rl_quoted_insert (count, key)
{
int c;
-#if defined (HANDLE_SIGNALS)
- _rl_disable_tty_signals ();
-#endif
c = rl_read_key ();
-#if defined (HANDLE_SIGNALS)
- _rl_restore_tty_signals ();
-#endif
-
return (rl_insert (count, c));
}
@@ -1550,6 +1617,8 @@ rl_insert_comment (count, key)
#define DownCase 2
#define CapCase 3
+static int rl_change_case ();
+
/* Uppercase the word at point. */
int
rl_upcase_word (count, key)
diff --git a/readline/readline.h b/readline/readline.h
index 97c62fd..dba1a0f 100644
--- a/readline/readline.h
+++ b/readline/readline.h
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_READLINE_H_)
#define _READLINE_H_
@@ -192,7 +192,7 @@ 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));
-/* Bindable command used when inserting a matching close character. */
+/* Not available unless readline is compiled -DPAREN_MATCHING. */
extern int rl_insert_close __P((int, int));
/* Not available unless READLINE_CALLBACKS is defined. */
@@ -331,12 +331,11 @@ extern int rl_modifying __P((int, int));
/* Functions for redisplay. */
extern void rl_redisplay __P((void));
extern int rl_on_new_line __P((void));
-extern int rl_on_new_line_with_prompt __P((void));
extern int rl_forced_update_display __P((void));
extern int rl_clear_message __P((void));
extern int rl_reset_line_state __P((void));
-#if (defined (__STDC__) || defined (__cplusplus)) && defined (USE_VARARGS) && defined (PREFER_STDARG)
+#if defined (__STDC__) && defined (USE_VARARGS) && defined (PREFER_STDARG)
extern int rl_message (const char *, ...);
#else
extern int rl_message ();
@@ -406,9 +405,6 @@ extern char *filename_completion_function __P((char *, int));
/* The version of this incarnation of the readline library. */
extern char *rl_library_version;
-/* True if this is real GNU readline. */
-extern int rl_gnu_readline_p;
-
/* The name of the calling program. You should initialize this to
whatever was in argv[0]. It is used when parsing conditionals. */
extern char *rl_readline_name;
@@ -472,15 +468,6 @@ extern Keymap rl_binding_keymap;
rl_newline. */
extern int rl_erase_empty_line;
-/* If non-zero, the application has already printed the prompt (rl_prompt)
- before calling readline, so readline should not output it the first time
- redisplay is done. */
-extern int rl_already_prompted;
-
-/* A non-zero value means to read only this many characters rather than
- up to a character bound to accept-line. */
-extern int rl_num_chars_to_read;
-
/* 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. */
@@ -624,7 +611,7 @@ extern int rl_inhibit_completion;
#define MULT_MATCH 2
#if !defined (savestring)
-extern char *savestring __P((char *)); /* XXX backwards compatibility */
+extern char *savestring (); /* XXX backwards compatibility */
#endif
#ifdef __cplusplus
diff --git a/readline/rlconf.h b/readline/rlconf.h
index d2ab704..1356fd8 100644
--- a/readline/rlconf.h
+++ b/readline/rlconf.h
@@ -8,7 +8,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_RLCONF_H_)
#define _RLCONF_H_
@@ -30,6 +30,10 @@
/* Define this to get an indication of file type when listing completions. */
#define VISIBLE_STATS
+/* If defined, readline shows opening parens and braces when closing
+ paren or brace entered. */
+/* #define PAREN_MATCHING */
+
/* This definition is needed by readline.c, rltty.c, and signals.c. */
/* If on, then readline handles signals in a way that doesn't screw. */
#define HANDLE_SIGNALS
diff --git a/readline/rldefs.h b/readline/rldefs.h
index e504d9b..d4aced4 100644
--- a/readline/rldefs.h
+++ b/readline/rldefs.h
@@ -10,7 +10,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -21,7 +21,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_RLDEFS_H_)
#define _RLDEFS_H_
@@ -122,8 +122,7 @@ extern char *xmalloc ();
#if !defined (STREQ)
#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
-#define STREQN(a, b, n) (((n) == 0) ? (1) \
- : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
+#define STREQN(a, b, n) (((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
#endif
#if !defined (FREE)
diff --git a/readline/rlstdc.h b/readline/rlstdc.h
index dac8e98..08b0f89 100644
--- a/readline/rlstdc.h
+++ b/readline/rlstdc.h
@@ -7,7 +7,7 @@
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 2, or (at your option)
+ 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
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_RL_STDC_H_)
#define _RL_STDC_H_
@@ -28,12 +28,52 @@
and traditional C compilers with something like this:
extern char *func __P((char *, char *, int)); */
-#if !defined (__P)
-# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
+#if defined (__STDC__)
+
+# if !defined (__P)
# define __P(protos) protos
-# else
+# endif
+# define __STRING(x) #x
+
+# if !defined (__GNUC__)
+# define inline
+# endif
+
+#else /* !__STDC__ */
+
+# if !defined (__P)
# define __P(protos) ()
# endif
-#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_ */
diff --git a/readline/rltty.c b/readline/rltty.c
index b868b69..08cd85b 100644
--- a/readline/rltty.c
+++ b/readline/rltty.c
@@ -8,7 +8,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -43,12 +43,28 @@
#include "rltty.h"
#include "readline.h"
-#include "rlprivate.h"
#if !defined (errno)
extern int errno;
#endif /* !errno */
+extern int readline_echoing_p;
+extern int _rl_eof_char;
+
+extern int _rl_enable_keypad, _rl_enable_meta;
+
+extern void _rl_control_keypad ();
+
+#if defined (__GO32__)
+# include <pc.h>
+# if !defined (__DJGPP__)
+# undef HANDLE_SIGNALS
+# endif /* !__DJGPP__ */
+#endif /* __GO32__ */
+
+/* Indirect functions to allow apps control over terminal management. */
+extern void rl_prep_terminal (), rl_deprep_terminal ();
+
VFunction *rl_prep_term_function = rl_prep_terminal;
VFunction *rl_deprep_term_function = rl_deprep_terminal;
@@ -90,7 +106,6 @@ block_sigint ()
# endif /* HAVE_USG_SIGHOLD */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
-
sigint_blocked = 1;
}
@@ -98,7 +113,7 @@ block_sigint ()
static void
release_sigint ()
{
- if (sigint_blocked == 0)
+ if (!sigint_blocked)
return;
#if defined (HAVE_POSIX_SIGNALS)
@@ -125,27 +140,25 @@ release_sigint ()
/* Non-zero means that the terminal is in a prepped state. */
static int terminal_prepped;
-static _RL_TTY_CHARS _rl_tty_chars, _rl_last_tty_chars;
-
/* If non-zero, means that this process has called tcflow(fd, TCOOFF)
and output is suspended. */
#if defined (__ksr1__)
static int ksrflow;
#endif
+#if defined (TIOCGWINSZ)
/* Dummy call to force a backgrounded readline to stop before it tries
to get the tty settings. */
static void
set_winsize (tty)
int tty;
{
-#if defined (TIOCGWINSZ)
struct winsize w;
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
(void) ioctl (tty, TIOCSWINSZ, &w);
-#endif /* TIOCGWINSZ */
}
+#endif /* TIOCGWINSZ */
#if defined (NEW_TTY_DRIVER)
@@ -173,48 +186,14 @@ struct bsdtty {
static TIOTYPE otio;
-static void
-save_tty_chars (tiop)
- TIOTYPE *tiop;
-{
- _rl_last_tty_chars = _rl_tty_chars;
-
- if (tiop->flags & SGTTY_SET)
- {
- _rl_tty_chars.t_erase = tiop->sgttyb.sg_erase;
- _rl_tty_chars.t_kill = tiop->sgttyb.sg_kill;
- }
-
- if (tiop->flags & TCHARS_SET)
- {
- _rl_tty_chars.t_intr = tiop->tchars.t_intrc;
- _rl_tty_chars.t_quit = tiop->tchars.t_quitc;
- _rl_tty_chars.t_start = tiop->tchars.t_startc;
- _rl_tty_chars.t_stop = tiop->tchars.t_stopc
- _rl_tty_chars.t_eof = tiop->tchars.t_eofc;
- _rl_tty_chars.t_eol = '\n';
- _rl_tty_chars.t_eol2 = tiop->tchars.t_brkc;
- }
-
- if (tiop->flags & LTCHARS_SET)
- {
- _rl_tty_chars.t_susp = tiop->ltchars.t_suspc;
- _rl_tty_chars.t_dsusp = tiop->ltchars.t_dsuspc;
- _rl_tty_chars.t_reprint = tiop->ltchars.t_rprntc;
- _rl_tty_chars.t_flush = tiop->ltchars.t_flushc;
- _rl_tty_chars.t_werase = tiop->ltchars.t_werasc;
- _rl_tty_chars.t_lnext = tiop->ltchars.t_lnextc;
- }
-
- _rl_tty_chars.t_status = -1;
-}
-
static int
get_tty_settings (tty, tiop)
int tty;
TIOTYPE *tiop;
{
+#if defined (TIOCGWINSZ)
set_winsize (tty);
+#endif
tiop->flags = tiop->lflag = 0;
@@ -283,6 +262,7 @@ prepare_terminal_settings (meta_flag, otio, tiop)
int meta_flag;
TIOTYPE otio, *tiop;
{
+#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
readline_echoing_p = (otio.sgttyb.sg_flags & ECHO);
/* Copy the original settings to the structure we're going to use for
@@ -348,6 +328,7 @@ prepare_terminal_settings (meta_flag, otio, tiop)
tiop->ltchars.t_dsuspc = -1; /* C-y */
tiop->ltchars.t_lnextc = -1; /* C-v */
#endif /* TIOCGLTC */
+#endif /* !__GO32__ || HAVE_TERMIOS_H */
}
#else /* !defined (NEW_TTY_DRIVER) */
@@ -385,58 +366,11 @@ static TIOTYPE otio;
#endif
static void
-save_tty_chars (tiop)
- TIOTYPE *tiop;
-{
- _rl_last_tty_chars = _rl_tty_chars;
-
- _rl_tty_chars.t_eof = tiop->c_cc[VEOF];
- _rl_tty_chars.t_eol = tiop->c_cc[VEOL];
-#ifdef VEOL2
- _rl_tty_chars.t_eol2 = tiop->c_cc[VEOL2];
-#endif
- _rl_tty_chars.t_erase = tiop->c_cc[VERASE];
-#ifdef VWERASE
- _rl_tty_chars.t_werase = tiop->c_cc[VWERASE];
-#endif
- _rl_tty_chars.t_kill = tiop->c_cc[VKILL];
-#ifdef VREPRINT
- _rl_tty_chars.t_reprint = tiop->c_cc[VREPRINT];
-#endif
- _rl_tty_chars.t_intr = tiop->c_cc[VINTR];
- _rl_tty_chars.t_quit = tiop->c_cc[VQUIT];
-#ifdef VSUSP
- _rl_tty_chars.t_susp = tiop->c_cc[VSUSP];
-#endif
-#ifdef VDSUSP
- _rl_tty_chars.t_dsusp = tiop->c_cc[VDSUSP];
-#endif
-#ifdef VSTART
- _rl_tty_chars.t_start = tiop->c_cc[VSTART];
-#endif
-#ifdef VSTOP
- _rl_tty_chars.t_stop = tiop->c_cc[VSTOP];
-#endif
-#ifdef VLNEXT
- _rl_tty_chars.t_lnext = tiop->c_cc[VLNEXT];
-#endif
-#ifdef VDISCARD
- _rl_tty_chars.t_flush = tiop->c_cc[VDISCARD];
-#endif
-#ifdef VSTATUS
- _rl_tty_chars.t_status = tiop->c_cc[VSTATUS];
-#endif
-}
-
-#if defined (_AIX) || defined (_AIX41)
-/* Currently this is only used on AIX */
-static void
rltty_warning (msg)
char *msg;
{
fprintf (stderr, "readline: warning: %s\n", msg);
}
-#endif
#if defined (_AIX)
void
@@ -452,12 +386,16 @@ TIOTYPE *tp;
#endif
static int
-_get_tty_settings (tty, tiop)
+get_tty_settings (tty, tiop)
int tty;
TIOTYPE *tiop;
{
int ioctl_ret;
+#if defined (TIOCGWINSZ)
+ set_winsize (tty);
+#endif
+
while (1)
{
ioctl_ret = GETATTR (tty, tiop);
@@ -481,19 +419,6 @@ _get_tty_settings (tty, tiop)
break;
}
- return 0;
-}
-
-static int
-get_tty_settings (tty, tiop)
- int tty;
- TIOTYPE *tiop;
-{
- set_winsize (tty);
-
- if (_get_tty_settings (tty, tiop) < 0)
- return -1;
-
#if defined (_AIX)
setopost(tiop);
#endif
@@ -502,7 +427,7 @@ get_tty_settings (tty, tiop)
}
static int
-_set_tty_settings (tty, tiop)
+set_tty_settings (tty, tiop)
int tty;
TIOTYPE *tiop;
{
@@ -512,17 +437,7 @@ _set_tty_settings (tty, tiop)
return -1;
errno = 0;
}
- return 0;
-}
-static int
-set_tty_settings (tty, tiop)
- int tty;
- TIOTYPE *tiop;
-{
- if (_set_tty_settings (tty, tiop) < 0)
- return -1;
-
#if 0
#if defined (TERMIOS_TTY_DRIVER)
@@ -539,7 +454,7 @@ set_tty_settings (tty, tiop)
ioctl (tty, TCXONC, 1); /* Simulate a ^Q. */
#endif /* !TERMIOS_TTY_DRIVER */
-#endif /* 0 */
+#endif
return 0;
}
@@ -611,6 +526,7 @@ void
rl_prep_terminal (meta_flag)
int meta_flag;
{
+#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
int tty;
TIOTYPE tio;
@@ -630,8 +546,6 @@ rl_prep_terminal (meta_flag)
otio = tio;
- save_tty_chars (&otio);
-
prepare_terminal_settings (meta_flag, otio, &tio);
if (set_tty_settings (tty, &tio) < 0)
@@ -647,12 +561,14 @@ rl_prep_terminal (meta_flag)
terminal_prepped = 1;
release_sigint ();
+#endif /* !__GO32__ || HAVE_TERMIOS_H */
}
/* Restore the terminal's normal settings and modes. */
void
rl_deprep_terminal ()
{
+#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
int tty;
if (!terminal_prepped)
@@ -677,6 +593,7 @@ rl_deprep_terminal ()
terminal_prepped = 0;
release_sigint ();
+#endif /* !__GO32__ || HAVE_TERMIOS_H */
}
/* **************************************************************** */
@@ -814,54 +731,3 @@ rltty_set_default_bindings (kmap)
}
#endif /* !NEW_TTY_DRIVER */
}
-
-#if defined (HANDLE_SIGNALS)
-
-#if defined (NEW_TTY_DRIVER)
-int
-_rl_disable_tty_signals ()
-{
- return 0;
-}
-
-int
-_rl_restore_tty_signals ()
-{
- return 0;
-}
-#else
-
-static TIOTYPE sigstty, nosigstty;
-static int tty_sigs_disabled = 0;
-
-int
-_rl_disable_tty_signals ()
-{
- if (tty_sigs_disabled)
- return 0;
-
- if (_get_tty_settings (fileno (rl_instream), &sigstty) < 0)
- return -1;
-
- nosigstty = sigstty;
-
- nosigstty.c_lflag &= ~ISIG;
-
- if (_set_tty_settings (fileno (rl_instream), &nosigstty) < 0)
- return (_set_tty_settings (fileno (rl_instream), &sigstty));
-
- tty_sigs_disabled = 1;
- return 0;
-}
-
-int
-_rl_restore_tty_signals ()
-{
- if (tty_sigs_disabled == 0)
- return 0;
-
- return (_set_tty_settings (fileno (rl_instream), &sigstty));
-}
-#endif /* !NEW_TTY_DRIVER */
-
-#endif /* HANDLE_SIGNALS */
diff --git a/readline/rltty.h b/readline/rltty.h
index 029a3fb..fe78346 100644
--- a/readline/rltty.h
+++ b/readline/rltty.h
@@ -8,7 +8,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -19,10 +19,10 @@
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,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_RLTTY_H_)
-#define _RLTTY_H_
+#define _RLTTY_H
/* Posix systems use termios and the Posix signal functions. */
#if defined (TERMIOS_TTY_DRIVER)
@@ -60,23 +60,4 @@
# endif /* !_SVR4_DISABLE */
#endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */
-typedef struct _rl_tty_chars {
- char t_eof;
- char t_eol;
- char t_eol2;
- char t_erase;
- char t_werase;
- char t_kill;
- char t_reprint;
- char t_intr;
- char t_quit;
- char t_susp;
- char t_dsusp;
- char t_start;
- char t_stop;
- char t_lnext;
- char t_flush;
- char t_status;
-} _RL_TTY_CHARS;
-
#endif /* _RLTTY_H_ */
diff --git a/readline/rlwinsize.h b/readline/rlwinsize.h
index 7838154..92b3de1 100644
--- a/readline/rlwinsize.h
+++ b/readline/rlwinsize.h
@@ -9,7 +9,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -20,7 +20,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_RLWINSIZE_H_)
#define _RLWINSIZE_H_
@@ -55,3 +55,4 @@
#endif /* _RL_WINSIZE_H */
+
diff --git a/readline/savestring.c b/readline/savestring.c
index 485890e..3f53a87 100644
--- a/readline/savestring.c
+++ b/readline/savestring.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
extern char *strcpy ();
extern char *xmalloc ();
diff --git a/readline/search.c b/readline/search.c
index 112f807..6c76e1a 100644
--- a/readline/search.c
+++ b/readline/search.c
@@ -8,7 +8,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -43,51 +43,30 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "xmalloc.h"
-
#ifdef abs
# undef abs
#endif
#define abs(x) (((x) >= 0) ? (x) : -(x))
+extern char *xmalloc (), *xrealloc ();
+
+/* Variables imported from readline.c */
+extern int rl_point, rl_end, rl_line_buffer_len;
+extern int rl_editing_mode;
+extern char *rl_prompt;
+extern char *rl_line_buffer;
extern HIST_ENTRY *saved_line_for_history;
+extern Function *rl_last_func;
/* Functions imported from the rest of the library. */
-extern int _rl_free_history_entry __P((HIST_ENTRY *));
+extern int _rl_free_history_entry ();
+extern char *_rl_make_prompt_for_search ();
+extern void rl_extend_line_buffer ();
static char *noninc_search_string = (char *) NULL;
static int noninc_history_pos;
-
static char *prev_line_found = (char *) NULL;
-static int rl_history_search_len;
-static int rl_history_search_pos;
-static char *history_search_string;
-static int history_string_size;
-
-/* Make the data from the history entry ENTRY be the contents of the
- current line. This doesn't do anything with rl_point; the caller
- must set it. */
-static void
-make_history_line_current (entry)
- HIST_ENTRY *entry;
-{
- int line_len;
-
- line_len = strlen (entry->line);
- if (line_len >= rl_line_buffer_len)
- rl_extend_line_buffer (line_len);
- strcpy (rl_line_buffer, entry->line);
-
- rl_undo_list = (UNDO_LIST *)entry->data;
- rl_end = line_len;
-
- if (saved_line_for_history)
- _rl_free_history_entry (saved_line_for_history);
- saved_line_for_history = (HIST_ENTRY *)NULL;
-}
-
/* Search the history list for STRING starting at absolute history position
POS. If STRING begins with `^', the search must match STRING at the
beginning of a history line, otherwise a full substring match is performed
@@ -123,7 +102,7 @@ noninc_dosearch (string, dir)
char *string;
int dir;
{
- int oldpos, pos;
+ int oldpos, pos, line_len;
HIST_ENTRY *entry;
if (string == 0 || *string == '\0' || noninc_history_pos < 0)
@@ -153,10 +132,19 @@ noninc_dosearch (string, dir)
#endif
history_set_pos (oldpos);
- make_history_line_current (entry);
+ line_len = strlen (entry->line);
+ if (line_len >= rl_line_buffer_len)
+ rl_extend_line_buffer (line_len);
+ strcpy (rl_line_buffer, entry->line);
+ rl_undo_list = (UNDO_LIST *)entry->data;
+ rl_end = strlen (rl_line_buffer);
rl_point = 0;
rl_clear_message ();
+
+ if (saved_line_for_history)
+ _rl_free_history_entry (saved_line_for_history);
+ saved_line_for_history = (HIST_ENTRY *)NULL;
}
/* Search non-interactively through the history list. DIR < 0 means to
@@ -247,7 +235,8 @@ noninc_search (dir, pchar)
{
/* We want to start the search from the current history position. */
noninc_history_pos = where_history ();
- FREE (noninc_search_string);
+ if (noninc_search_string)
+ free (noninc_search_string);
noninc_search_string = savestring (rl_line_buffer);
}
@@ -306,82 +295,57 @@ rl_noninc_reverse_search_again (count, key)
}
static int
-rl_history_search_internal (count, dir)
- int count, dir;
+rl_history_search_internal (count, direction)
+ int count, direction;
{
- HIST_ENTRY *temp;
- int ret, oldpos;
+ HIST_ENTRY *temp, *old_temp;
+ int line_len;
maybe_save_line ();
- temp = (HIST_ENTRY *)NULL;
- /* Search COUNT times through the history for a line whose prefix
- matches history_search_string. When this loop finishes, TEMP,
- if non-null, is the history line to copy into the line buffer. */
+ temp = old_temp = (HIST_ENTRY *)NULL;
while (count)
{
- ret = noninc_search_from_pos (history_search_string, rl_history_search_pos + dir, dir);
- if (ret == -1)
- break;
-
- /* Get the history entry we found. */
- rl_history_search_pos = ret;
- oldpos = where_history ();
- history_set_pos (rl_history_search_pos);
- temp = current_history ();
- history_set_pos (oldpos);
-
- /* Don't find multiple instances of the same line. */
- if (prev_line_found && STREQ (prev_line_found, temp->line))
- continue;
- prev_line_found = temp->line;
- count--;
+ temp = (direction < 0) ? previous_history () : next_history ();
+ if (temp == 0)
+ break;
+ /* On an empty prefix, make this the same as previous-history. */
+ if (rl_point == 0)
+ {
+ count--;
+ continue;
+ }
+ if (STREQN (rl_line_buffer, temp->line, rl_point))
+ {
+ /* Don't find multiple instances of the same line. */
+ if (prev_line_found && STREQ (prev_line_found, temp->line))
+ continue;
+ if (direction < 0)
+ old_temp = temp;
+ prev_line_found = temp->line;
+ count--;
+ }
}
- /* If we didn't find anything at all, return. */
if (temp == 0)
{
- maybe_unsave_line ();
- ding ();
- /* If you don't want the saved history line (last match) to show up
- in the line buffer after the search fails, change the #if 0 to
- #if 1 */
-#if 0
- if (rl_point > rl_history_search_len)
- {
- rl_point = rl_end = rl_history_search_len;
- rl_line_buffer[rl_end] = '\0';
- }
-#else
- rl_point = rl_history_search_len; /* maybe_unsave_line changes it */
-#endif
- return 1;
- }
-
- /* Copy the line we found into the current line buffer. */
- make_history_line_current (temp);
-
- rl_point = rl_history_search_len;
- return 0;
-}
-
-static void
-rl_history_search_reinit ()
-{
- rl_history_search_pos = where_history ();
- rl_history_search_len = rl_point;
- prev_line_found = (char *)NULL;
- if (rl_point)
- {
- if (rl_history_search_len >= history_string_size - 2)
+ if (direction < 0 && old_temp)
+ temp = old_temp;
+ else
{
- history_string_size = rl_history_search_len + 2;
- history_search_string = xrealloc (history_search_string, history_string_size);
+ maybe_unsave_line ();
+ ding ();
+ return 1;
}
- history_search_string[0] = '^';
- strncpy (history_search_string + 1, rl_line_buffer, rl_point);
- history_search_string[rl_point + 1] = '\0';
}
+
+ line_len = strlen (temp->line);
+ if (line_len >= rl_line_buffer_len)
+ rl_extend_line_buffer (line_len);
+ strcpy (rl_line_buffer, temp->line);
+ rl_undo_list = (UNDO_LIST *)temp->data;
+ rl_end = line_len;
+ return 0;
}
/* Search forward in the history for the string of characters
@@ -393,13 +357,8 @@ rl_history_search_forward (count, ignore)
{
if (count == 0)
return (0);
-
- if (rl_last_func != rl_history_search_forward &&
- rl_last_func != rl_history_search_backward)
- rl_history_search_reinit ();
-
- if (rl_history_search_len == 0)
- return (rl_get_next_history (count, ignore));
+ if (rl_last_func != rl_history_search_forward)
+ prev_line_found = (char *)NULL;
return (rl_history_search_internal (abs (count), (count > 0) ? 1 : -1));
}
@@ -412,12 +371,7 @@ rl_history_search_backward (count, ignore)
{
if (count == 0)
return (0);
-
- if (rl_last_func != rl_history_search_forward &&
- rl_last_func != rl_history_search_backward)
- rl_history_search_reinit ();
-
- if (rl_history_search_len == 0)
- return (rl_get_previous_history (count, ignore));
+ if (rl_last_func != rl_history_search_backward)
+ prev_line_found = (char *)NULL;
return (rl_history_search_internal (abs (count), (count > 0) ? -1 : 1));
}
diff --git a/readline/shell.c b/readline/shell.c
index 3daef69..f0ddc89 100644
--- a/readline/shell.c
+++ b/readline/shell.c
@@ -8,7 +8,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -27,6 +27,7 @@
#endif
#include <sys/types.h>
+#include <stdio.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
@@ -44,21 +45,13 @@
# include <strings.h>
#endif /* !HAVE_STRING_H */
-#include <fcntl.h>
#include <pwd.h>
-#include <stdio.h>
-
-#include "rlshell.h"
-#include "xmalloc.h"
-
#if !defined (HAVE_GETPW_DECLS)
extern struct passwd *getpwuid ();
#endif /* !HAVE_GETPW_DECLS */
-#ifndef NULL
-# define NULL 0
-#endif
+extern char *xmalloc ();
/* All of these functions are resolved from bash if we are linking readline
as part of bash. */
@@ -71,7 +64,7 @@ single_quote (string)
register int c;
char *result, *r, *s;
- result = (char *)xmalloc (3 + (4 * strlen (string)));
+ result = (char *)xmalloc (3 + (3 * strlen (string)));
r = result;
*r++ = '\'';
@@ -139,37 +132,3 @@ get_home_dir ()
home_dir = entry->pw_dir;
return (home_dir);
}
-
-#if !defined (O_NDELAY)
-# if defined (FNDELAY)
-# define O_NDELAY FNDELAY
-# endif
-#endif
-
-int
-unset_nodelay_mode (fd)
- int fd;
-{
- int flags, bflags;
-
- if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
- return -1;
-
- bflags = 0;
-
-#ifdef O_NONBLOCK
- bflags |= O_NONBLOCK;
-#endif
-
-#ifdef O_NDELAY
- bflags |= O_NDELAY;
-#endif
-
- if (flags & bflags)
- {
- flags &= ~bflags;
- return (fcntl (fd, F_SETFL, flags));
- }
-
- return 0;
-}
diff --git a/readline/shlib/Makefile.in b/readline/shlib/Makefile.in
index b1f70de..bff52f7 100644
--- a/readline/shlib/Makefile.in
+++ b/readline/shlib/Makefile.in
@@ -15,8 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
-
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
RL_LIBRARY_VERSION = @LIBVERSION@
RL_LIBRARY_NAME = readline
@@ -76,9 +75,9 @@ SHLIB_LIBVERSION = @SHLIB_LIBVERSION@
SHLIB_STATUS = @SHLIB_STATUS@
# shared library versioning
-SHLIB_MAJOR= @SHLIB_MAJOR@
+SHLIB_MAJOR= 4
# shared library systems like SVR4's do not use minor versions
-SHLIB_MINOR= .@SHLIB_MINOR@
+SHLIB_MINOR= .0
# For libraries which include headers from other libraries.
INCLUDES = -I. -I.. -I$(topdir) -I$(includedir)
@@ -113,7 +112,7 @@ CSOURCES = $(topdir)/readline.c $(topdir)/funmap.c $(topdir)/keymaps.c \
# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
- ansi_stdlib.h tcap.h xmalloc.h rlprivate.h rlshell.h
+ ansi_stdlib.h tcap.h
SHARED_HISTOBJ = history.so histexpand.so histfile.so histsearch.so shell.so
SHARED_TILDEOBJ = tilde.so
@@ -132,7 +131,7 @@ 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 "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."
@@ -223,8 +222,6 @@ 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
-nls.o: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
-nls.o: $(topdir)/tilde.h $(topdir)/history.h $(topdir)/rlstdc.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
@@ -260,54 +257,6 @@ 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
-bind.so: $(topdir)/rlshell.h
-histfile.so: $(topdir)/rlshell.h
-nls.so: $(topdir)/rlshell.h
-readline.so: $(topdir)/rlshell.h
-shell.so: $(topdir)/rlshell.h
-terminal.so: $(topdir)/rlshell.h
-histexpand.so: $(topdir)/rlshell.h
-
-bind.so: $(topdir)/rlprivate.h
-callback.so: $(topdir)/rlprivate.h
-complete.so: $(topdir)/rlprivate.h
-display.so: $(topdir)/rlprivate.h
-input.so: $(topdir)/rlprivate.h
-isearch.so: $(topdir)/rlprivate.h
-kill.so: $(topdir)/rlprivate.h
-macro.so: $(topdir)/rlprivate.h
-nls.so: $(topdir)/rlprivate.h
-parens.so: $(topdir)/rlprivate.h
-readline.so: $(topdir)/rlprivate.h
-rltty.so: $(topdir)/rlprivate.h
-search.so: $(topdir)/rlprivate.h
-signals.so: $(topdir)/rlprivate.h
-terminal.so: $(topdir)/rlprivate.h
-undo.so: $(topdir)/rlprivate.h
-util.so: $(topdir)/rlprivate.h
-vi_mode.so: $(topdir)/rlprivate.h
-
-bind.so: $(topdir)/xmalloc.h
-complete.so: $(topdir)/xmalloc.h
-display.so: $(topdir)/xmalloc.h
-funmap.so: $(topdir)/xmalloc.h
-histexpand.so: $(topdir)/xmalloc.h
-histfile.so: $(topdir)/xmalloc.h
-history.so: $(topdir)/xmalloc.h
-input.so: $(topdir)/xmalloc.h
-isearch.so: $(topdir)/xmalloc.h
-keymaps.so: $(topdir)/xmalloc.h
-kill.so: $(topdir)/xmalloc.h
-macro.so: $(topdir)/xmalloc.h
-readline.so: $(topdir)/xmalloc.h
-savestring.so: $(topdir)/xmalloc.h
-search.so: $(topdir)/xmalloc.h
-shell.so: $(topdir)/xmalloc.h
-tilde.so: $(topdir)/xmalloc.h
-tilde.so: $(topdir)/xmalloc.h
-util.so: $(topdir)/xmalloc.h
-vi_mode.so: $(topdir)/xmalloc.h
-
readline.so: $(topdir)/readline.c
vi_mode.so: $(topdir)/vi_mode.c
funmap.so: $(topdir)/funmap.c
diff --git a/readline/signals.c b/readline/signals.c
index 861019d..40e0912 100644
--- a/readline/signals.c
+++ b/readline/signals.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -40,13 +40,15 @@
# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL */
+#if defined (__GO32__) && !defined(__DJGPP__)
+# undef HANDLE_SIGNALS
+#endif /* __GO32__ && !__DJGPP__ */
+
#if defined (HANDLE_SIGNALS)
/* Some standard library routines. */
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-
#if !defined (RETSIGTYPE)
# if defined (VOID_SIGHANDLER)
# define RETSIGTYPE void
@@ -65,15 +67,19 @@
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
typedef RETSIGTYPE SigHandler ();
-#if defined (HAVE_POSIX_SIGNALS)
-typedef struct sigaction sighandler_cxt;
-# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh)
-#else
-typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt;
-# define sigemptyset(m)
-#endif /* !HAVE_POSIX_SIGNALS */
+extern int readline_echoing_p;
+extern int rl_pending_input;
+extern int _rl_meta_flag;
-static SigHandler *rl_set_sighandler __P((int, SigHandler *, sighandler_cxt *));
+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 ();
/* Exported variables for use by applications. */
@@ -87,7 +93,9 @@ int rl_catch_sigwinch = 1;
#endif
static int signals_set_flag;
+#ifdef SIGWINCH
static int sigwinch_set_flag;
+#endif
/* **************************************************************** */
/* */
@@ -95,6 +103,14 @@ static int sigwinch_set_flag;
/* */
/* **************************************************************** */
+#if defined (HAVE_POSIX_SIGNALS)
+typedef struct sigaction sighandler_cxt;
+# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh)
+#else
+typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt;
+# define sigemptyset(m)
+#endif /* !HAVE_POSIX_SIGNALS */
+
static sighandler_cxt old_int, old_term, old_alrm, old_quit;
#if defined (SIGTSTP)
static sighandler_cxt old_tstp, old_ttou, old_ttin;
@@ -151,10 +167,6 @@ rl_signal_handler (sig)
# endif /* HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
-#if defined (__EMX__)
- signal (sig, SIG_ACK);
-#endif
-
kill (getpid (), sig);
/* Let the signal that we just sent through. */
@@ -222,7 +234,6 @@ rl_set_sighandler (sig, handler, ohandler)
SigHandler *handler;
sighandler_cxt *ohandler;
{
- sighandler_cxt old_handler;
#if defined (HAVE_POSIX_SIGNALS)
struct sigaction act;
@@ -230,17 +241,10 @@ rl_set_sighandler (sig, handler, ohandler)
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
sigemptyset (&ohandler->sa_mask);
- sigaction (sig, &act, &old_handler);
+ sigaction (sig, &act, ohandler);
#else
- old_handler.sa_handler = (SigHandler *)signal (sig, handler);
+ ohandler->sa_handler = (SigHandler *)signal (sig, handler);
#endif /* !HAVE_POSIX_SIGNALS */
-
- /* XXX -- assume we have memcpy */
- /* If rl_set_signals is called twice in a row, don't set the old handler to
- rl_signal_handler, because that would cause infinite recursion. */
- if (handler != rl_signal_handler || old_handler.sa_handler != rl_signal_handler)
- memcpy (ohandler, &old_handler, sizeof (sighandler_cxt));
-
return (ohandler->sa_handler);
}
diff --git a/readline/support/config.guess b/readline/support/config.guess
index ad5983e..66a2428 100755
--- a/readline/support/config.guess
+++ b/readline/support/config.guess
@@ -35,19 +35,6 @@
# (but try to keep the structure clean).
#
-# Use $HOST_CC if defined. $CC may point to a cross-compiler
-if test x"$CC_FOR_BUILD" = x; then
- if test x"$HOST_CC" != x; then
- CC_FOR_BUILD="$HOST_CC"
- else
- if test x"$CC" != x; then
- CC_FOR_BUILD="$CC"
- else
- CC_FOR_BUILD=cc
- fi
- fi
-fi
-
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -70,8 +57,7 @@ esac
REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'` # 1
REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
+trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
# is contrary to all other versions of uname
@@ -95,6 +81,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
i?86:OpenBSD:*:*)
echo ${UNAME_MACHINE}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
+ i?86:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-pc-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
sparc:NetBSD:*:*)
echo sparc-unknown-netbsd${UNAME_RELEASE}
exit 0 ;;
@@ -162,11 +151,17 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:QNX:*:42*)
echo i386-qssl-qnx`echo ${UNAME_VERSION}`
exit 0 ;;
- Alpha*:Windows:NT:*:SP*)
- echo alpha-pc-opennt
+ BeBox:BeOS:*:*)
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*)
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*)
+ echo i586-pc-beos
exit 0 ;;
- *:Windows:NT:*:SP*)
- echo intel-pc-opennt
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
# end cases added for Bash
alpha:OSF1:*:*)
@@ -177,7 +172,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- cat <<EOF >$dummy.s
+ cat <<EOF >dummy.s
.globl main
.ent main
main:
@@ -194,9 +189,9 @@ main:
ret \$31,(\$26),1
.end main
EOF
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
- ./$dummy
+ ./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
@@ -215,15 +210,9 @@ EOF
;;
esac
fi
- rm -f $dummy.s $dummy
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+ exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
@@ -266,7 +255,7 @@ EOF
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@@ -274,12 +263,9 @@ EOF
echo pyramid-pyramid-bsd
fi
exit 0 ;;
- NILE:*:*:*:dcosx)
+ NILE:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
@@ -301,7 +287,7 @@ EOF
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
- sun3*:SunOS:*:*)
+ sun3*:SunOS:*:*|sun:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
@@ -323,45 +309,19 @@ EOF
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
+ echo m68k-atari-openbsd${UNAME_RELEASE}
exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
+ echo m68k-sun-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
+ echo m68k-apple-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
@@ -369,15 +329,15 @@ EOF
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- *:"Mac OS":*:*)
- echo `uname -p`-apple-macos${UNAME_RELEASE}
- exit 0 ;;
+ Power?Macintosh:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-unknown-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
- macppc:NetBSD:*:*)
- echo powerpc-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
@@ -387,16 +347,12 @@ EOF
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
+ 2020:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
+ sed 's/^ //' << EOF >dummy.c
+ int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -411,10 +367,10 @@ EOF
exit (-1);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy \
- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ ${CC-cc} dummy.c -o dummy \
+ && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
@@ -433,14 +389,13 @@ EOF
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
@@ -467,7 +422,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
@@ -478,8 +433,8 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -488,8 +443,7 @@ EOF
fi
exit 0 ;;
*:AIX:*:4)
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
- if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -530,46 +484,17 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- sed 's/^ //' << EOF >$dummy.c
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
- rm -f $dummy.c $dummy
+ 9000/78? | 9000/80[24] | 9000/8[67]1 | 9000/8[78]9 | 9000/893 )
+ HP_ARCH=hppa2.0 ;;
+ 9000/7?? | 9000/8?[13679] | 9000/892 )
+ HP_ARCH=hppa1.1 ;;
+ 9000/[68]?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
@@ -594,8 +519,8 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -604,9 +529,6 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
- *9??*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
@@ -615,17 +537,14 @@ EOF
exit 0 ;;
i?86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ echo ${UNAME_MACHINE}-pc-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo ${UNAME_MACHINE}-pc-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
- hppa*:OpenBSD:*:*)
- echo hppa-unknown-openbsd
- exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@@ -658,14 +577,11 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alpha-cray-unicosmk${UNAME_RELEASE}
- exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
@@ -675,26 +591,14 @@ EOF
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
+ hp3[0-9][05]:OpenBSD:*:*)
+ echo m68k-hp-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
*:FreeBSD:*:*)
- if test -x /usr/bin/objformat; then
- if test "elf" = "`/usr/bin/objformat`"; then
- echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
- exit 0
- fi
- fi
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=(].*//'`
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
@@ -703,23 +607,14 @@ EOF
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin32
+ echo i386-pc-cygwin32
exit 0 ;;
i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
+ echo i386-pc-mingw32
exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i386-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
+ echo powerpcle-unknown-cygwin32
+ exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
@@ -727,17 +622,9 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
- # uname on the ARM produces all sorts of strangeness, and we need to
- # filter it out.
- case "$UNAME_MACHINE" in
- armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
- arm* | sa110*) UNAME_MACHINE="arm" ;;
- esac
-
# The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- ld_help_string=`cd /; ld --help 2>&1`
+ # first see if it will tell us.
+ ld_help_string=`ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
@@ -745,46 +632,15 @@ EOF
s/ .*//
p'`
case "$ld_supported_emulations" in
- *ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc | elf32ppclinux)
- # Determine Lib Version
- cat >$dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#if defined(__GLIBC__)
- printf("%s %s\n", __libc_version, __libc_release);
-#else
- printf("unkown\n");
-#endif
- return 0;
-}
-EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./$dummy | grep 1\.99 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f $dummy.c $dummy
- echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
- esac
+ elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
+ esac
if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <<EOF >$dummy.s
+ sed 's/^ //' <<EOF >dummy.s
.globl main
.ent main
main:
@@ -802,9 +658,9 @@ EOF
.end main
EOF
LIBC=""
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
- ./$dummy
+ ./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
@@ -823,21 +679,20 @@ EOF
;;
esac
- objdump --private-headers $dummy | \
+ objdump --private-headers dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
- rm -f $dummy.s $dummy
+ rm -f dummy.s dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >$dummy.c <<EOF
-#ifdef __cplusplus
-int main (int argc, char *argv[]) {
-#else
-int main (argc, argv) int argc; char *argv[]; {
-#endif
+ cat >dummy.c <<EOF
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
@@ -847,8 +702,8 @@ int main (argc, argv) int argc; char *argv[]; {
return 0;
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
@@ -867,13 +722,12 @@ EOF
;;
esac
# Determine whether the default compiler is a.out or elf
- cat >$dummy.c <<EOF
+ cat >dummy.c <<EOF
#include <features.h>
-#ifdef __cplusplus
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
@@ -890,8 +744,8 @@ EOF
return 0;
}
EOF
- ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
@@ -900,9 +754,9 @@ EOF
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:UnixWare:5*:*)
+ echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
+ exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -918,14 +772,6 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
- i?86:*:5:7*)
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
- exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -935,10 +781,6 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
@@ -985,7 +827,7 @@ EOF
m68*:LynxOS:2.*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
- i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
+ i?86:LynxOS:2.*:*)
echo i386-pc-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
@@ -1030,40 +872,23 @@ EOF
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-apple-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 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-cat >$dummy.c <<EOF
+cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
@@ -1105,10 +930,7 @@ main ()
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
@@ -1275,8 +1097,8 @@ main ()
}
EOF
-${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+rm -f dummy.c dummy
# Apollos put the system type in the environment.
diff --git a/readline/support/config.sub b/readline/support/config.sub
index 7d0c026..c1ec2df 100755
--- a/readline/support/config.sub
+++ b/readline/support/config.sub
@@ -98,16 +98,6 @@ case $os in
os=
basic_machine=$1
;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=vxworks
- basic_machine=$1
- ;;
-hiux*)
os=-hiuxwe2
;;
@@ -131,9 +121,6 @@ case $os in
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -162,27 +149,19 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
- | 580 | i960 | h8300 \
- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
- | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
- | mips64orion | mips64orionel | mipstx39 | mipstx39el \
- | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
- | mips64vr5000 | miprs64vr5000el | mcore \
- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
- | thumb | d10v)
+ tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
+ | arme[lb] | pyramid \
+ | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+ | hppa2.0 | alpha | we32k | ns16k | clipper | i370 | sh \
+ | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
+ | pdp11 | mips64el | mips64orion | mips64orionel \
+ | sparc | sparclet | sparclite | sparc64)
basic_machine=$basic_machine-unknown
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
- ;;
-
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
- i[34567]86)
+ i[3456]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -191,53 +170,30 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
- # FIXME: clean up the formatting here.
- vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
- | xmp-* | ymp-* \
- | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
- | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
- | clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
- | mipstx39-* | mipstx39el-* | mcore-* \
- | f301-* | armv*-* | t3e-* \
- | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
- | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
- ;;
- # BEGIN cases added for Bash
- butterfly-bbn* | cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
+ vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
+ | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
+ | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
+ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
+ | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* | alphaev6-* \
+ | we32k-* | cydra-* | ns16k-* \
+ | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
+ | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-* | f301-* \
+ | butterfly-bbn* \
+ | cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
| tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \
| concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \
- | *-convex | sx[45]*-nec )
+ | *-convex | sx4*-nec)
;;
- # END cases added for Bash
-
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
alliant | fx80)
basic_machine=fx80-alliant
;;
@@ -256,10 +212,14 @@ case $basic_machine in
# basic_machine=m68k-cbm
basic_machine=m68k-unknown
;;
- amigaos | amigados)
- basic_machine=m68k-cbm
+ amigaos)
+ basic_machine=m68k-unknown
os=-amigaos
;;
+ amigados)
+ basic_machine=m68k-cbm
+ os=-amigados
+ ;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
@@ -268,10 +228,6 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-sysv
;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -351,10 +307,6 @@ case $basic_machine in
encore | umax | mmax | multimax)
basic_machine=ns32k-encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
fx2800)
basic_machine=i860-alliant
;;
@@ -373,14 +325,6 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
harris)
basic_machine=m88k-harris
os=-sysv3
@@ -396,30 +340,13 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
+ hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -428,14 +355,6 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
ibm032-*)
basic_machine=ibmrt-ibm
;;
@@ -444,38 +363,22 @@ case $basic_machine in
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[34567]86v32)
+ i[3456]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
- i[34567]86v4*)
+ i[3456]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
- i[34567]86v)
+ i[3456]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
- i[34567]86sol2)
+ i[3456]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- i386-go32 | go32)
- basic_machine=i386-unknown
- os=-go32
- ;;
- i386-mingw32 | mingw32)
- basic_machine=i386-unknown
- os=-mingw32
- ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -507,17 +410,13 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
- *mint | *MiNT)
- basic_machine=m68k-atari
- os=-mint
- ;;
mipsel*-linux*)
basic_machine=mipsel-unknown
- os=-linux-gnu
+ os=-linux
;;
mips*-linux*)
basic_machine=mips-unknown
- os=-linux-gnu
+ os=-linux
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -525,26 +424,10 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- msdos)
- basic_machine=i386-unknown
- os=-msdos
- ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-corel
- os=-linux
- ;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
@@ -557,10 +440,6 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
next | m*-next )
basic_machine=m68k-next
case $os in
@@ -586,10 +465,6 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
np1)
basic_machine=np1-gould
;;
@@ -601,18 +476,6 @@ case $basic_machine in
basic_machine=i386-pc
os=-sco3.2v4
;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -627,26 +490,28 @@ case $basic_machine in
pbb)
basic_machine=m68k-tti
;;
- pc532 | pc532-*)
+ pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | k6 | nexen)
+ pentium | p5)
basic_machine=i586-intel
;;
- pentiumpro | p6 | 6x86)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2)
- basic_machine=i786-pc
+ pentiumpro | p6)
+ basic_machine=i686-intel
;;
- pentium-* | p5-* | k5-* | k6-* | nexen-*)
+ pentium-* | p5-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumpro-* | p6-* | 6x86*)
+ pentiumpro-* | p6-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumii-* | pentium2-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ k5)
+ # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+ basic_machine=i586-amd
+ ;;
+ nexen)
+ # We don't have specific support for Nexgen yet, so just call it a Pentium
+ basic_machine=i586-nexgen
;;
pn)
basic_machine=pn-gould
@@ -654,32 +519,24 @@ case $basic_machine in
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
- ;;
+ ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
- ;;
+ ;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
sequent)
basic_machine=i386-sequent
;;
@@ -687,10 +544,6 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sparclite-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
sps7)
basic_machine=m68k-bull
os=-sysv2
@@ -698,13 +551,6 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
sun2)
basic_machine=m68000-sun
;;
@@ -749,16 +595,6 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
- t3e)
- basic_machine=t3e-cray
- os=-unicos
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@@ -778,10 +614,6 @@ case $basic_machine in
basic_machine=i386-pc
os=-sysv5uw7
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
vaxv)
basic_machine=vax-dec
os=-sysv
@@ -805,25 +637,13 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
- xps | xps100)
+ xps | xps100)
basic_machine=xps100-honeywell
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
none)
basic_machine=none-none
os=-none
@@ -831,17 +651,8 @@ case $basic_machine 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.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
mips)
- if test "x$os" = "x-linux-gnu" ; then
+ if test "x$os" = "x-linux" ; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
@@ -862,10 +673,10 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sparc | sparcv9)
+ sparc)
basic_machine=sparc-sun
;;
- cydra)
+ cydra)
basic_machine=cydra-cydrome
;;
orion)
@@ -874,16 +685,6 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -916,7 +717,7 @@ case $os in
-solaris)
os=-solaris2
;;
- -svr4*)
+ svr4*)
os=-sysv4
;;
-unixware | -uw | -unixware2* | -uw2*)
@@ -925,9 +726,6 @@ case $os in
-unixware7* | -uw7*)
os=-sysv5uw7
;;
- -unixware*)
- os=-sysv4.2uw
- ;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
@@ -938,31 +736,18 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
+ | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \
+ | -superux* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
- # BEGIN CASES ADDED FOR Bash
- -qnx* | -powerux* | -superux* )
- ;;
- # END CASES ADDED FOR Bash
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
-
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -987,14 +772,11 @@ case $os in
-acis*)
os=-aos
;;
- -386bsd)
- os=-bsd
- ;;
-ctix* | -uts*)
os=-sysv
;;
-ns2 )
- os=-nextstep2
+ os=-nextstep2
;;
# Preserve the version number of sinix5.
-sinix5.*)
@@ -1024,18 +806,9 @@ case $os in
# This must come after -sysvr[45].
-sysv*)
;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
-xenix)
os=-xenix
;;
- -*mint | -*MiNT)
- os=-mint
- ;;
-none)
;;
*)
@@ -1064,7 +837,7 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- pdp11-*)
+ pdp11-*)
os=-none
;;
*-dec | vax-*)
@@ -1082,15 +855,6 @@ case $basic_machine in
# default.
# os=-sunos4
;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -1103,15 +867,6 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
*-hp)
os=-hpux
;;
@@ -1154,19 +909,19 @@ case $basic_machine in
*-next)
os=-nextstep3
;;
- *-gould)
+ *-gould)
os=-sysv
;;
- *-highlevel)
+ *-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
- *-sgi)
+ *-sgi)
os=-irix
;;
- *-siemens)
+ *-siemens)
os=-sysv4
;;
*-masscomp)
@@ -1175,18 +930,6 @@ case $basic_machine in
f301-fujitsu)
os=-uxpv
;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
*)
os=-none
;;
@@ -1211,9 +954,6 @@ case $basic_machine in
-aix*)
vendor=ibm
;;
- -beos*)
- vendor=be
- ;;
-hpux*)
vendor=hp
;;
@@ -1244,15 +984,6 @@ case $basic_machine in
-aux*)
vendor=apple
;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -*MiNT)
- vendor=atari
- ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
diff --git a/readline/support/shlib-install b/readline/support/shlib-install
index 471fec7..e43a7c0 100755
--- a/readline/support/shlib-install
+++ b/readline/support/shlib-install
@@ -49,7 +49,7 @@ LN="ln -s"
if [ -z "$uninstall" ]; then
${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
if [ -f "$INSTALLDIR/$LIBNAME" ]; then
- ${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+ ${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}${OLDSUFF}
fi
fi
@@ -63,14 +63,6 @@ fi
# post-install/uninstall
-# HP-UX requires that a shared library have execute permission
-case "$host_os" in
-hpux*) if [ -z "$uninstall" ]; then
- chmod 755 ${INSTALLDIR}/${LIBNAME}
- fi ;;
-*) ;;
-esac
-
case "$LIBNAME" in
*.*.[0-9].[0-9]) # libname.so.M.N
LINK2=`echo $LIBNAME | sed 's:\(.*\..*\.[0-9]\)\.[0-9]:\1:'` # libname.so.M
@@ -79,9 +71,6 @@ case "$LIBNAME" in
*.*.[0-9]) # libname.so.M
LINK1=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]:\1:'` # libname.so
;;
-*.[0-9]) # libname.M
- LINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]:\1:'` # libname
- ;;
esac
#
@@ -102,7 +91,7 @@ case "$host_os" in
fi
;;
-solaris2*|aix4.[2-9]*|osf*|irix[56]*)
+solaris2*|aix4.[2-9]*|hpux1*)
# libname.so -> libname.so.M
${echo} ${RM} ${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
@@ -110,38 +99,6 @@ solaris2*|aix4.[2-9]*|osf*|irix[56]*)
fi
;;
-
-# FreeBSD 3.x can have either a.out or ELF shared libraries
-freebsd3*)
- if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
- # libname.so -> libname.so.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
- if [ -z "$uninstall" ]; then
- ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
- fi
- else
- # 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
- fi
- ;;
-
-hpux1*)
- # libname.sl -> libname.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
- if [ -z "$uninstall" ]; then
- ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LINK1}.sl
- fi
- ;;
-
*) ;;
esac
diff --git a/readline/support/shobj-conf b/readline/support/shobj-conf
index 6649c70..86f8c32 100755
--- a/readline/support/shobj-conf
+++ b/readline/support/shobj-conf
@@ -62,9 +62,9 @@ sunos4*)
sunos5*-gcc*|solaris2*-gcc*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
- SHOBJ_LDFLAGS='-shared -Wl,-i -Wl,-h,$@'
+ SHOBJ_LDFLAGS='-shared -Wl,-i'
-# SHLIB_XLDFLAGS='-R $(libdir)'
+ SHLIB_XLDFLAGS='-R $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
@@ -73,7 +73,7 @@ sunos5*|solaris2*)
SHOBJ_LD=/usr/ccs/bin/ld
SHOBJ_LDFLAGS='-G -dy -z text -i -h $@'
-# SHLIB_XLDFLAGS='-R $(libdir)'
+ SHLIB_XLDFLAGS='-R $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
@@ -86,32 +86,13 @@ freebsd2* | netbsd* | openbsd*)
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
-# FreeBSD-3.x can have either a.out or ELF object files
-#freebsd3*)
-# SHOBJ_CFLAGS=-fpic
-# SHOBJ_LD='${CC}'
-# SHOBJ_LDFLAGS='-shared'
-#
-# SHLIB_XLDFLAGS='-R$(libdir)'
-# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
-# ;;
-
-# FreeBSD-3.x ELF
freebsd3*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
+ SHOBJ_LDFLAGS='-shared'
- if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
-
- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
- SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
- else
- SHOBJ_LDFLAGS='-shared'
-
- SHLIB_XLDFLAGS='-R$(libdir)'
- SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
- fi
+ SHLIB_XLDFLAGS='-R$(libdir)'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
linux*)
@@ -161,15 +142,6 @@ bsdi4*)
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
-osf*-gcc*)
- # Fix to use gcc linker driver from bfischer@TechFak.Uni-Bielefeld.DE
- SHOBJ_LD='${CC}'
- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
-
- SHLIB_XLDFLAGS='-rpath $(libdir)'
- SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
- ;;
-
osf*)
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-shared -soname $@ -expect_unresolved "*"'
@@ -215,9 +187,7 @@ irix[56]*-gcc*)
irix[56]*)
SHOBJ_CFLAGS='-K PIC'
SHOBJ_LD=ld
-# SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
-# Change from David Kaelbling <drk@sgi.com>
- SHOBJ_LDFLAGS='-shared -no_unresolved -soname $@'
+ SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
SHLIB_XLDFLAGS='-rpath $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
@@ -336,7 +306,7 @@ dgux*)
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
-msdos*)
+msdosdjgpp*)
SHOBJ_STATUS=unsupported
SHLIB_STATUS=unsupported
;;
diff --git a/readline/tcap.h b/readline/tcap.h
index 58ab894..acb2d76 100644
--- a/readline/tcap.h
+++ b/readline/tcap.h
@@ -8,7 +8,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_RLTCAP_H_)
#define _RLTCAP_H_
diff --git a/readline/terminal.c b/readline/terminal.c
index 20ad126..627a385 100644
--- a/readline/terminal.c
+++ b/readline/terminal.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -46,7 +46,9 @@
# include <locale.h>
#endif
+#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
/* System-specific feature definitions and include files. */
#include "rldefs.h"
@@ -55,6 +57,10 @@
# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
+#if defined (__GO32__)
+# include <pc.h>
+#endif
+
#include "rltty.h"
#include "tcap.h"
@@ -62,8 +68,21 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "rlshell.h"
+/* Variables and functions imported from readline.c */
+extern FILE *_rl_in_stream, *_rl_out_stream;
+extern int readline_echoing_p;
+extern int _rl_bell_preference;
+extern Keymap _rl_keymap;
+
+/* Functions imported from bind.c */
+extern void _rl_bind_if_unbound ();
+
+/* Functions imported from shell.c */
+extern void set_lines_and_columns ();
+extern char *get_env_value ();
+
+/* Functions imported from display.c */
+extern void _rl_redisplay_after_sigwinch ();
/* **************************************************************** */
/* */
@@ -71,13 +90,15 @@
/* */
/* **************************************************************** */
+#ifndef __DJGPP__
static char *term_buffer = (char *)NULL;
static char *term_string_buffer = (char *)NULL;
-static int tcap_initialized;
-
/* Non-zero means this terminal can't really do anything. */
static int dumb_term;
+#endif
+
+static int tcap_initialized;
#if !defined (__linux__)
# if defined (__EMX__) || defined (NEED_EXTERN_PC)
@@ -137,22 +158,6 @@ int _rl_enable_keypad;
/* Non-zero means the user wants to enable a meta key. */
int _rl_enable_meta = 1;
-#if defined (__EMX__)
-static void
-_emx_get_screensize (swp, shp)
- int *swp, *shp;
-{
- int sz[2];
-
- _scrsize (sz);
-
- if (swp)
- *swp = sz[0];
- if (shp)
- *shp = sz[1];
-}
-#endif
-
/* Get readline's idea of the screen size. TTY is a file descriptor open
to the terminal. If IGNORE_ENV is true, we do not pay attention to the
values of $LINES and $COLUMNS. The tests for TERM_STRING_BUFFER being
@@ -165,6 +170,9 @@ _rl_get_screen_size (tty, ignore_env)
#if defined (TIOCGWINSZ)
struct winsize window_size;
#endif /* TIOCGWINSZ */
+#if defined (__EMX__)
+ int sz[2];
+#endif
#if defined (TIOCGWINSZ)
if (ioctl (tty, TIOCGWINSZ, &window_size) == 0)
@@ -175,7 +183,9 @@ _rl_get_screen_size (tty, ignore_env)
#endif /* TIOCGWINSZ */
#if defined (__EMX__)
- _emx_get_screensize (&screenwidth, &screenheight);
+ _scrsize (sz);
+ screenwidth = sz[0];
+ screenheight = sz[1];
#endif
/* Environment variable COLUMNS overrides setting of "co" if IGNORE_ENV
@@ -185,7 +195,11 @@ _rl_get_screen_size (tty, ignore_env)
if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
screenwidth = atoi (ss);
-#if !defined (__DJGPP__)
+#if defined(__DJGPP__)
+ tty = tty;
+ if (screenwidth <= 0)
+ screenwidth = ScreenCols ();
+#else
if (screenwidth <= 0 && term_string_buffer)
screenwidth = tgetnum ("co");
#endif
@@ -198,7 +212,10 @@ _rl_get_screen_size (tty, ignore_env)
if (ignore_env == 0 && (ss = get_env_value ("LINES")))
screenheight = atoi (ss);
-#if !defined (__DJGPP__)
+#if defined(__DJGPP__)
+ if (screenheight <= 0)
+ screenheight = ScreenRows ();
+#else
if (screenheight <= 0 && term_string_buffer)
screenheight = tgetnum ("li");
#endif
@@ -216,7 +233,7 @@ _rl_get_screen_size (tty, ignore_env)
do a pair of putenv () or setenv () calls. */
set_lines_and_columns (screenheight, screenwidth);
- if (_rl_term_autowrap == 0)
+ if (!_rl_term_autowrap)
screenwidth--;
screenchars = screenwidth * screenheight;
@@ -254,32 +271,32 @@ struct _tc_string {
search algorithm to something smarter. */
static struct _tc_string tc_strings[] =
{
- { "DC", &term_DC },
- { "IC", &term_IC },
- { "ce", &term_clreol },
- { "cl", &term_clrpag },
- { "cr", &term_cr },
- { "dc", &term_dc },
- { "ei", &term_ei },
- { "ic", &term_ic },
- { "im", &term_im },
- { "kd", &term_kd },
- { "kh", &term_kh }, /* home */
- { "kH", &term_kH }, /* end */
- { "kl", &term_kl },
- { "kr", &term_kr },
- { "ku", &term_ku },
- { "ks", &term_ks },
- { "ke", &term_ke },
- { "le", &term_backspace },
- { "mm", &term_mm },
- { "mo", &term_mo },
+ "DC", &term_DC,
+ "IC", &term_IC,
+ "ce", &term_clreol,
+ "cl", &term_clrpag,
+ "cr", &term_cr,
+ "dc", &term_dc,
+ "ei", &term_ei,
+ "ic", &term_ic,
+ "im", &term_im,
+ "kd", &term_kd,
+ "kh", &term_kh, /* home */
+ "kH", &term_kH, /* end */
+ "kl", &term_kl,
+ "kr", &term_kr,
+ "ku", &term_ku,
+ "ks", &term_ks,
+ "ke", &term_ke,
+ "le", &term_backspace,
+ "mm", &term_mm,
+ "mo", &term_mo,
#if defined (HACK_TERMCAP_MOTION)
- { "nd", &term_forward_char },
+ "nd", &term_forward_char,
#endif
- { "pc", &term_pc },
- { "up", &term_up },
- { "vb", &visible_bell },
+ "pc", &term_pc,
+ "up", &term_up,
+ "vb", &visible_bell,
};
#define NUM_TC_STRINGS (sizeof (tc_strings) / sizeof (struct _tc_string))
@@ -290,7 +307,9 @@ static void
get_term_capabilities (bp)
char **bp;
{
-#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
+#if defined(__DJGPP__)
+ bp = bp;
+#else
register int i;
for (i = 0; i < NUM_TC_STRINGS; i++)
@@ -299,87 +318,66 @@ get_term_capabilities (bp)
tcap_initialized = 1;
}
-#define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay)
-#define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc)
-
int
_rl_init_terminal_io (terminal_name)
char *terminal_name;
{
+#if defined (__GO32__)
+ terminal_name = terminal_name;
+ screenwidth = screenheight = 0;
+ _rl_get_screen_size (rl_instream ? fileno (rl_instream) : 0, 0);
+
+ term_cr = "\r";
+ term_im = term_ei = term_ic = term_IC = (char *)NULL;
+ term_up = term_dc = term_DC = visible_bell = (char *)NULL;
+
+ /* Does the __GO32__ have a meta key? I don't know. */
+ term_has_meta = 0;
+ term_mm = term_mo = (char *)NULL;
+
+ /* It probably has arrow keys, but I don't know what they are. */
+ term_ku = term_kd = term_kr = term_kl = (char *)NULL;
+
+#if defined (HACK_TERMCAP_MOTION)
+ term_forward_char = (char *)NULL;
+#endif /* HACK_TERMCAP_MOTION */
+ terminal_can_insert = _rl_term_autowrap = 0;
+ return 0;
+#else /* !__GO32__ */
+
char *term, *buffer;
- int tty, tgetent_ret;
+ int tty;
Keymap xkeymap;
term = terminal_name ? terminal_name : get_env_value ("TERM");
- term_clrpag = term_cr = term_clreol = (char *)NULL;
- tty = rl_instream ? fileno (rl_instream) : 0;
- screenwidth = screenheight = 0;
- if (term == 0)
- term = "dumb";
+ if (term_string_buffer == 0)
+ term_string_buffer = xmalloc (2032);
- /* I've separated this out for later work on not calling tgetent at all
- if the calling application has supplied a custom redisplay function,
- (and possibly if the application has supplied a custom input function). */
- if (CUSTOM_REDISPLAY_FUNC())
- {
- tgetent_ret = -1;
- }
- else
- {
- if (term_string_buffer == 0)
- term_string_buffer = xmalloc(2032);
+ if (term_buffer == 0)
+ term_buffer = xmalloc (4080);
- if (term_buffer == 0)
- term_buffer = xmalloc(4080);
+ buffer = term_string_buffer;
- buffer = term_string_buffer;
+ term_clrpag = term_cr = term_clreol = (char *)NULL;
- tgetent_ret = tgetent (term_buffer, term);
- }
+ if (term == 0)
+ term = "dumb";
- if (tgetent_ret <= 0)
+ if (tgetent (term_buffer, term) <= 0)
{
- FREE (term_string_buffer);
- FREE (term_buffer);
- buffer = term_buffer = term_string_buffer = (char *)NULL;
-
dumb_term = 1;
- _rl_term_autowrap = 0; /* used by _rl_get_screen_size */
-
-#if defined (__EMX__)
- _emx_get_screensize (&screenwidth, &screenheight);
- screenwidth--;
-#else /* !__EMX__ */
- _rl_get_screen_size (tty, 0);
-#endif /* !__EMX__ */
-
- /* Defaults. */
- if (screenwidth <= 0 || screenheight <= 0)
- {
- screenwidth = 79;
- screenheight = 24;
- }
-
- /* Everything below here is used by the redisplay code (tputs). */
- screenchars = screenwidth * screenheight;
+ screenwidth = 79;
+ screenheight = 24;
+ screenchars = 79 * 24;
term_cr = "\r";
term_im = term_ei = term_ic = term_IC = (char *)NULL;
term_up = term_dc = term_DC = visible_bell = (char *)NULL;
term_ku = term_kd = term_kl = term_kr = (char *)NULL;
- term_mm = term_mo = (char *)NULL;
#if defined (HACK_TERMCAP_MOTION)
term_forward_char = (char *)NULL;
#endif
- terminal_can_insert = term_has_meta = 0;
-
- /* Reasonable defaults for tgoto(). Readline currently only uses
- tgoto if term_IC or term_DC is defined, but just in case we
- change that later... */
- PC = '\0';
- BC = term_backspace = "\b";
- UP = term_up;
-
+ terminal_can_insert = 0;
return 0;
}
@@ -394,6 +392,10 @@ _rl_init_terminal_io (terminal_name)
if (!term_cr)
term_cr = "\r";
+ tty = rl_instream ? fileno (rl_instream) : 0;
+
+ screenwidth = screenheight = 0;
+
_rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
_rl_get_screen_size (tty, 0);
@@ -436,6 +438,7 @@ _rl_init_terminal_io (terminal_name)
_rl_keymap = xkeymap;
+#endif /* !__GO32__ */
return 0;
}
@@ -481,7 +484,6 @@ _rl_output_character_function (c)
return putc (c, _rl_out_stream);
}
#endif /* !_MINIX */
-
/* Write COUNT characters from STRING to the output stream. */
void
_rl_output_some_chars (string, count)
@@ -498,10 +500,12 @@ _rl_backspace (count)
{
register int i;
+#if !defined (__GO32__)
if (term_backspace)
for (i = 0; i < count; i++)
tputs (term_backspace, 1, _rl_output_character_function);
else
+#endif /* !__GO32__ */
for (i = 0; i < count; i++)
putc ('\b', _rl_out_stream);
return 0;
@@ -531,11 +535,16 @@ ding ()
default:
break;
case VISIBLE_BELL:
+#if defined (__GO32__)
+ ScreenVisualBell ();
+ break;
+#else
if (visible_bell)
{
tputs (visible_bell, 1, _rl_output_character_function);
break;
}
+#endif
/* FALLTHROUGH */
case AUDIBLE_BELL:
fprintf (stderr, "\007");
@@ -556,7 +565,7 @@ ding ()
void
_rl_enable_meta_key ()
{
-#if !defined (__DJGPP__)
+#if !defined(__DJGPP__)
if (term_has_meta && term_mm)
tputs (term_mm, 1, _rl_output_character_function);
#endif
@@ -566,7 +575,9 @@ void
_rl_control_keypad (on)
int on;
{
-#if !defined (__DJGPP__)
+#if defined(__DJGPP__)
+ on = on;
+#else
if (on && term_ks)
tputs (term_ks, 1, _rl_output_character_function);
else if (!on && term_ke)
diff --git a/readline/tilde.c b/readline/tilde.c
index 777b655..d1853bd 100644
--- a/readline/tilde.c
+++ b/readline/tilde.c
@@ -7,7 +7,7 @@
Readline 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
+ Free Software Foundation; either version 1, or (at your option) any
later version.
Readline is distributed in the hope that it will be useful, but
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with Readline; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if defined (HAVE_CONFIG_H)
# include <config.h>
@@ -47,22 +47,12 @@
#include "tilde.h"
-#if defined (TEST) || defined (STATIC_MALLOC)
-static char *xmalloc (), *xrealloc ();
-#else
-# if defined __STDC__
-extern char *xmalloc (int);
-extern char *xrealloc (void *, int);
-# else
-extern char *xmalloc (), *xrealloc ();
-# endif /* !__STDC__ */
-#endif /* TEST || STATIC_MALLOC */
-
#if !defined (HAVE_GETPW_DECLS)
extern struct passwd *getpwuid (), *getpwnam ();
#endif /* !HAVE_GETPW_DECLS */
#if !defined (savestring)
+extern char *xmalloc ();
# ifndef strcpy
extern char *strcpy ();
# endif
@@ -77,11 +67,17 @@ extern char *strcpy ();
# endif /* !__STDC__ */
#endif /* !NULL */
+#if defined (TEST) || defined (STATIC_MALLOC)
+static char *xmalloc (), *xrealloc ();
+#else
+extern char *xmalloc (), *xrealloc ();
+#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 __P((void));
-extern char *get_env_value __P((char *));
+extern char *get_home_dir ();
+extern char *get_env_value ();
/* The default value of tilde_additional_prefixes. This is set to
whitespace preceding a tilde so that simple programs which do not
@@ -126,9 +122,7 @@ tilde_find_prefix (string, len)
int *len;
{
register int i, j, string_len;
- register char **prefixes;
-
- prefixes = tilde_additional_prefixes;
+ register char **prefixes = tilde_additional_prefixes;
string_len = strlen (string);
*len = 0;
@@ -167,11 +161,7 @@ tilde_find_suffix (string)
for (i = 0; i < string_len; i++)
{
-#if defined (__MSDOS__)
- if (string[i] == '/' || string[i] == '\\' /* || !string[i] */)
-#else
if (string[i] == '/' /* || !string[i] */)
-#endif
break;
for (j = 0; suffixes && suffixes[j]; j++)
@@ -235,18 +225,11 @@ tilde_expand (string)
free (tilde_word);
len = strlen (expansion);
-#ifdef __CYGWIN32__
- /* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when
- $HOME for `user' is /. On cygwin, // denotes a network drive. */
- if (len > 1 || *expansion != '/' || *string != '/')
-#endif
- {
- if ((result_index + len + 1) > result_size)
- result = xrealloc (result, 1 + (result_size += (len + 20)));
+ if ((result_index + len + 1) > result_size)
+ result = xrealloc (result, 1 + (result_size += (len + 20)));
- strcpy (result + result_index, expansion);
- result_index += len;
- }
+ strcpy (result + result_index, expansion);
+ result_index += len;
free (expansion);
}
@@ -267,11 +250,7 @@ isolate_tilde_prefix (fname, lenp)
int i;
ret = xmalloc (strlen (fname));
-#if defined (__MSDOS__)
- for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++)
-#else
for (i = 1; fname[i] && fname[i] != '/'; i++)
-#endif
ret[i - 1] = fname[i];
ret[i - 1] = '\0';
if (lenp)
@@ -292,7 +271,7 @@ glue_prefix_and_suffix (prefix, suffix, suffind)
plen = (prefix && *prefix) ? strlen (prefix) : 0;
slen = strlen (suffix + suffind);
ret = xmalloc (plen + slen + 1);
- if (plen)
+ if (prefix && *prefix)
strcpy (ret, prefix);
strcpy (ret + plen, suffix + suffind);
return ret;
diff --git a/readline/tilde.h b/readline/tilde.h
index 7783fd6..634b954 100644
--- a/readline/tilde.h
+++ b/readline/tilde.h
@@ -8,7 +8,7 @@
The 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 2, or (at your option)
+ the Free Software Foundation; either version 1, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
@@ -19,27 +19,11 @@
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,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_TILDE_H_)
# define _TILDE_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* 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 (__P)
-# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
-# define __P(protos) protos
-# else
-# define __P(protos) ()
-# endif
-#endif
-
/* Function pointers can be declared as (Function *)foo. */
#if !defined (_FUNCTION_DEF)
# define _FUNCTION_DEF
@@ -72,14 +56,10 @@ extern char **tilde_additional_prefixes;
extern char **tilde_additional_suffixes;
/* Return a new string which is the result of tilde expanding STRING. */
-extern char *tilde_expand __P((char *));
+extern char *tilde_expand ();
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
tilde. If there is no expansion, call tilde_expansion_failure_hook. */
-extern char *tilde_expand_word __P((char *));
-
-#ifdef __cplusplus
-}
-#endif
+extern char *tilde_expand_word ();
#endif /* _TILDE_H_ */
diff --git a/readline/undo.c b/readline/undo.c
index f7f30d1..28ebcc8 100644
--- a/readline/undo.c
+++ b/readline/undo.c
@@ -8,7 +8,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -47,8 +47,6 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-
#define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0)
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
diff --git a/readline/util.c b/readline/util.c
index be9e0a9..1dc3b66 100644
--- a/readline/util.c
+++ b/readline/util.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -52,11 +52,25 @@
/* Some standard library routines. */
#include "readline.h"
-#include "rlprivate.h"
-#include "xmalloc.h"
-
#define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0)
+/* Pseudo-globals imported from readline.c */
+extern int readline_echoing_p;
+extern procenv_t readline_top_level;
+extern int rl_line_buffer_len;
+extern Function *rl_last_func;
+
+extern int _rl_defining_kbd_macro;
+extern char *_rl_executing_macro;
+
+/* Pseudo-global functions imported from other library files. */
+extern void _rl_replace_text ();
+extern void _rl_pop_executing_macro ();
+extern void _rl_set_the_line ();
+extern void _rl_init_argument ();
+
+extern char *xmalloc (), *xrealloc ();
+
/* **************************************************************** */
/* */
/* Utility Functions */
diff --git a/readline/vi_keymap.c b/readline/vi_keymap.c
index cf6724c..14929a3 100644
--- a/readline/vi_keymap.c
+++ b/readline/vi_keymap.c
@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (BUFSIZ)
#include <stdio.h>
diff --git a/readline/vi_mode.c b/readline/vi_mode.c
index be7f949..d4868bf 100644
--- a/readline/vi_mode.c
+++ b/readline/vi_mode.c
@@ -8,7 +8,7 @@
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2, or
+ 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
@@ -19,7 +19,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READLINE_LIBRARY
/* **************************************************************** */
@@ -54,9 +54,6 @@
#include "readline.h"
#include "history.h"
-#include "rlprivate.h"
-#include "xmalloc.h"
-
#ifndef _rl_digit_p
#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
#endif
@@ -77,6 +74,26 @@
#define exchange(x, y) do {int temp = x; x = y; y = temp;} while (0)
#endif
+extern char *xmalloc (), *xrealloc ();
+
+/* Variables imported from readline.c */
+extern int rl_point, rl_end, rl_mark;
+extern FILE *rl_instream;
+extern int rl_line_buffer_len, rl_explicit_arg, rl_numeric_arg;
+extern Keymap _rl_keymap;
+extern char *rl_prompt;
+extern char *rl_line_buffer;
+extern int rl_arg_sign;
+
+extern int _rl_doing_an_undo;
+extern int _rl_undo_group_level;
+
+extern void _rl_dispatch ();
+extern int _rl_char_search_internal ();
+
+extern void rl_extend_line_buffer ();
+extern int rl_vi_check ();
+
/* Non-zero means enter insertion mode. */
static int _rl_vi_doing_insert;
@@ -114,7 +131,7 @@ static char *vi_textmod = "_*\\AaIiCcDdPpYyRrSsXx~";
/* Arrays for the saved marks. */
static int vi_mark_chars[27];
-static int rl_digit_loop1 __P((void));
+static int rl_digit_loop1 ();
void
_rl_vi_initialize_line ()
@@ -1026,7 +1043,7 @@ rl_vi_char_search (count, key)
if (vi_redoing)
target = _rl_vi_last_search_char;
else
- _rl_vi_last_search_char = target = (*rl_getc_function) (rl_instream);
+ _rl_vi_last_search_char = target = rl_getc (rl_instream);
switch (key)
{
@@ -1142,7 +1159,7 @@ rl_vi_change_char (count, key)
if (vi_redoing)
c = _rl_vi_last_replacement;
else
- _rl_vi_last_replacement = c = (*rl_getc_function) (rl_instream);
+ _rl_vi_last_replacement = c = rl_getc (rl_instream);
if (c == '\033' || c == CTRL ('C'))
return -1;
diff --git a/readline/xmalloc.c b/readline/xmalloc.c
index c0d0640..4160651 100644
--- a/readline/xmalloc.c
+++ b/readline/xmalloc.c
@@ -7,7 +7,7 @@
Readline 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
+ Free Software Foundation; either version 1, or (at your option) any
later version.
Readline is distributed in the hope that it will be useful, but
@@ -17,8 +17,7 @@
You should have received a copy of the GNU General Public License
along with Readline; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
-#define READLINE_LIBRARY
+ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if defined (HAVE_CONFIG_H)
#include <config.h>
@@ -32,7 +31,7 @@
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
-#include "xmalloc.h"
+static void memory_error_and_abort ();
/* **************************************************************** */
/* */
@@ -40,14 +39,6 @@
/* */
/* **************************************************************** */
-static void
-memory_error_and_abort (fname)
- char *fname;
-{
- fprintf (stderr, "%s: out of virtual memory\n", fname);
- exit (2);
-}
-
/* Return a pointer to free()able block of memory large enough
to hold BYTES number of bytes. If the memory cannot be allocated,
print an error message and abort. */
@@ -65,7 +56,7 @@ xmalloc (bytes)
char *
xrealloc (pointer, bytes)
- PTR_T pointer;
+ char *pointer;
int bytes;
{
char *temp;
@@ -77,11 +68,19 @@ xrealloc (pointer, bytes)
return (temp);
}
+static void
+memory_error_and_abort (fname)
+ char *fname;
+{
+ fprintf (stderr, "%s: out of virtual memory\n", fname);
+ exit (2);
+}
+
/* Use this as the function to call when adding unwind protects so we
don't need to know what free() returns. */
void
xfree (string)
- PTR_T string;
+ char *string;
{
if (string)
free (string);