diff options
Diffstat (limited to 'contrib/libreadline')
-rw-r--r-- | contrib/libreadline/ChangeLog | 403 | ||||
-rw-r--r-- | contrib/libreadline/MANIFEST.doc | 16 | ||||
-rw-r--r-- | contrib/libreadline/STANDALONE | 32 | ||||
-rw-r--r-- | contrib/libreadline/complete.c | 135 | ||||
-rw-r--r-- | contrib/libreadline/display.c | 358 | ||||
-rw-r--r-- | contrib/libreadline/doc/Makefile | 69 | ||||
-rw-r--r-- | contrib/libreadline/doc/readline.3 | 15 | ||||
-rw-r--r-- | contrib/libreadline/examples/Makefile | 19 | ||||
-rw-r--r-- | contrib/libreadline/readline.3 | 15 | ||||
-rw-r--r-- | contrib/libreadline/readline.h | 34 | ||||
-rw-r--r-- | contrib/libreadline/rlconf.h | 8 | ||||
-rw-r--r-- | contrib/libreadline/savestring.c | 33 | ||||
-rw-r--r-- | contrib/libreadline/shell.c | 50 | ||||
-rw-r--r-- | contrib/libreadline/terminal.c | 210 | ||||
-rw-r--r-- | contrib/libreadline/util.c | 24 |
15 files changed, 322 insertions, 1099 deletions
diff --git a/contrib/libreadline/ChangeLog b/contrib/libreadline/ChangeLog deleted file mode 100644 index 1cf0c00..0000000 --- a/contrib/libreadline/ChangeLog +++ /dev/null @@ -1,403 +0,0 @@ -Tue Mar 23 14:36:51 1993 Brian Fox (bfox@eos.crseo.ucsb.edu) - - * readline.c (rl_copy): Changed name to rl_copy_text. - -Mon Mar 22 19:16:05 1993 Brian Fox (bfox@eos.crseo.ucsb.edu) - - * dispose_cmd.c, several other files. Declare dispose_xxx () as - "void". - - * builtins/hashcom.h: Make declarations of hashed_filenames be - "extern" to keep the SGI compiler happy. - - * readline.c (rl_initialize_everything): Assign values to - out_stream and in_stream immediately, since - output_character_function () can be called before - readline_internal () is called. - -Tue Dec 8 09:30:56 1992 Brian Fox (bfox@cubit) - - * readline.c (rl_init_terminal) Set PC from BC, not from *buffer. - -Mon Nov 30 09:35:47 1992 Brian Fox (bfox@cubit) - - * readline.c (invoking_keyseqs_in_map, rl_parse_and_bind) Allow - backslash to quote characters, such as backslash, double quote, - and space. Backslash quotes all character indiscriminately. - - * funmap.c (vi_keymap) Fix type in "vi-replace" declaration. - -Fri Nov 20 10:55:05 1992 Brian Fox (bfox@cubit) - - * readline.c (init_terminal_io, rl_prep_terminal): FINALLY! - Declare and use termcap variable `ospeed' when setting up terminal - parameters. - -Thu Oct 8 08:53:07 1992 Brian J. Fox (bfox@helios) - - * Makefile, this directory: Include (as links to the canonical - sources), tilde.c, tilde.h, posixstat.h and xmalloc.c. - -Tue Sep 29 13:07:21 1992 Brian J. Fox (bfox@helios) - - * readline.c (init_terminal_io) Don't set arrow keys if the key - sequences that represent them are already set. - - * readline.c (rl_function_of_keyseq) New function returns the first - function (or macro) found while searching a key sequence. - -Mon Sep 28 00:34:04 1992 Brian J. Fox (bfox@helios) - - * readline.c (LibraryVersion) New static char * contains current - version number. Version is at 2.0. - - * readline.c (rl_complete_internal): Incorporated clean changes - from gilmore (gnu@cygnus.com) to support quoted substrings within - completion functions. - - * readline.c (many locations) Added support for the _GO32_, - whatever that is. Patches supplied by Cygnus, typed in by hand, - with cleanups. - -Sun Aug 16 12:46:24 1992 Brian Fox (bfox@cubit) - - * readline.c (init_terminal_io): Find out the values of the keypad - arrows and bind them to appropriate RL functions if present. - -Mon Aug 10 18:13:24 1992 Brian Fox (bfox@cubit) - - * history.c (stifle_history): A negative argument to stifle - becomes zero. - -Tue Jul 28 09:28:41 1992 Brian Fox (bfox@cubit) - - * readline.c (rl_variable_bind): New local structure describes - booleans by name and address; code in rl_variable_bind () looks at - structure to set simple variables. - - * parens.c (rl_insert_close): New variable rl_blink_matching_paren - is non-zero if we want to blink the matching open when a close is - inserted. If FD_SET is defined, rl_blink_matching_paren defaults - to 1, else 0. If FD_SET is not defined, and - rl_blink_matching_paren is non-zero, the close character(s) are/is - simply inserted. - -Wed Jul 22 20:03:59 1992 Brian Fox (bfox@cubit) - - * history.c, readline.c, vi_mode.c: Cause the functions strchr () - and strrchr () to be used instead of index () and rindex () - throughout the source. - -Mon Jul 13 11:34:07 1992 Brian Fox (bfox@cubit) - - * readline.c: (rl_variable_bind) New variable "meta-flag" if "on" - means force the use of the 8th bit as Meta bit. Internal variable - is called meta_flag. - -Thu Jul 9 10:37:56 1992 Brian Fox (bfox@cubit) - - * history.c (get_history_event) Change INDEX to LOCAL_INDEX. If - compiling for the shell, allow shell metacharacters to separate - history tokens as they would for shell tokens. - -Sat Jul 4 19:29:12 1992 Brian Fox (bfox@cubit) - - * vi_keymap.c: According to Posix, TAB self-inserts instead of - doing completion. - - * vi_mode.c: (rl_vi_yank_arg) Enter VI insert mode after yanking - an arg from the previous line. - - * search.c: New file takes over vi style searching and implements - non-incremental searching the history. - - Makefile: Add search.c and search.o. - - funmap.c: Add names for non-incremental-forward-search-history and - non-incremental-reverse-search-history. - - readline.h: Add extern definitions for non-incremental searching. - - vi_mode.c: Remove old search code; add calls to code in search.c. - -Fri Jul 3 10:36:33 1992 Brian Fox (bfox@cubit) - - * readline.c (rl_delete_horizontal_space); New function deletes - all whitespace surrounding point. - - funmap.c: Add "delete-horizontal-space". - emacs_keymap.c: Put rl_delete_horizontal_space () on M-\. - - * readline.c (rl_set_signals, rl_clear_signals); New function - rl_set_sighandler () is either defined in a Posix way (if - HAVE_POSIX_SIGNALS is defined) or in a BSD way. Function is - called from rl_set_signals () and rl_clear_signals (). - -Fri May 8 12:50:15 1992 Brian Fox (bfox@cubit) - - * readline.c: (readline_default_bindings) Do comparisons with - _POSIX_VDISABLE casted to `unsigned char'. Change tty characters - to be unsigned char. - -Thu Apr 30 12:36:35 1992 Brian Fox (bfox@cubit) - - * readline.c: (rl_getc) Handle "read would block" error on - non-blocking IO streams. - - * readline.c: (rl_signal_handler): Unblock only the signal that we - have caught, not all signals. - -Sun Feb 23 03:33:09 1992 Brian Fox (bfox at gnuwest.fsf.org) - - * readline.c: Many functions. Use only the macros META_CHAR and - UNMETA to deal with meta characters. Prior to this, we used - numeric values and tests. - - * readline.c (rl_complete_internal) Report exactly the number of - possible completions, not the number + 1. - - * vi_mode.c (rl_do_move) Do not change the cursor position when - using `cw' or `cW'. - - * vi_mode.c (rl_vi_complete) Enter insert mode after completing - with `*' or `\'. - -Fri Feb 21 05:58:18 1992 Brian Fox (bfox at gnuwest.fsf.org) - - * readline.c (rl_dispatch) Increment rl_key_sequence_length for - meta characters that map onto ESC map. - -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. - - * readline.c: Include hbullx20 as well as hpux for determining - USGr3ness. - - * readline.c (rl_unix_word_rubout) As per the "Now REMEMBER" - comment, pass arguments to rl_kill_text () in the correct order to - preserve prepending and appending of killed text. - - * readline.c (rl_search_history) malloc (), realloc (), and free - () SEARCH_STRING so that there are no static limits on searching. - - * vi_mode.c (rl_vi_subst) Don't forget to end the undo group. - -Fri Jan 31 14:51:02 1992 Brian Fox (bfox at gnuwest.fsf.org) - - * readline.c (rl_signal_handler): Zero the current history entry's - pointer after freeing the undo_list when SIGINT received. - Reformat a couple of functions. - -Sat Jan 25 13:47:35 1992 Brian Fox (bfox at bears) - - * readline.c (parser_if): free () TNAME after use. - -Tue Jan 21 01:01:35 1992 Brian Fox (bfox at gnuwest.fsf.org) - - * readline.c (rl_redisplay) and (rl_character_len): Display - Control characters as "^c" and Meta characters as "\234", instead - of "C-C" and "M-C". - -Sun Dec 29 10:59:00 1991 Brian Fox (bfox at gnuwest.fsf.org) - - * readline.c (init_terminal_io) Default to environment variables - LINES and COLUMNS before termcap entry values. If all else fails, - then assume 80x24 terminal. - -Sat Dec 28 16:33:11 1991 Brian Fox (bfox at gnuwest.fsf.org) - - * readline.c: If this machine is USG and it is hpux, then define - USGr3. - - * history.c: Cosmetic fixes. - -Thu Nov 21 00:10:12 1991 Brian Fox (bfox at gnuwest.fsf.org) - - * vi_mode.c: (rl_do_move) Place cursor at end of line, never at - next to last character. - -Thu Nov 14 05:08:01 1991 Brian Fox (bfox at gnuwest.fsf.org) - - * history.c (get_history_event) Non-anchored searches can have a - return index of greater than zero from get_history_event (). - -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/contrib/libreadline/MANIFEST.doc b/contrib/libreadline/MANIFEST.doc deleted file mode 100644 index ed27cb3..0000000 --- a/contrib/libreadline/MANIFEST.doc +++ /dev/null @@ -1,16 +0,0 @@ -# -# Master Manifest file for documentation-only distribution -# -doc d -MANIFEST.doc f -doc/readline.ps f -doc/history.ps f -doc/readline.dvi f -doc/history.dvi f -doc/readline.info f -doc/history.info f -doc/readline.html f -doc/readline_toc.html f -doc/history.html f -doc/history_toc.html f -doc/readline.0 f diff --git a/contrib/libreadline/STANDALONE b/contrib/libreadline/STANDALONE deleted file mode 100644 index f999e8d..0000000 --- a/contrib/libreadline/STANDALONE +++ /dev/null @@ -1,32 +0,0 @@ -This is a description of C preprocessor defines that readline accepts. -Most are passed in from the parent `make'; e.g. from the bash source -directory. - -NO_SYS_FILE <sys/file.h> is not present -HAVE_UNISTD_H <unistd.h> exists -HAVE_STDLIB_H <stdlib.h> exists -HAVE_VARARGS_H <varargs.h> exists and is usable -HAVE_STRING_H <string.h> exists -HAVE_ALLOCA_H <alloca.h> exists and is needed for alloca() -HAVE_ALLOCA alloca(3) or a define for it exists -PRAGMA_ALLOCA use of alloca() requires a #pragma, as in AIX 3.x -VOID_SIGHANDLER signal handlers are void functions -HAVE_DIRENT_H <dirent.h> exists and is usable -HAVE_SYS_PTEM_H <sys/ptem.h> exists -HAVE_SYS_PTE_H <sys/pte.h> exists -HAVE_SYS_STREAM_H <sys/stream.h> exists -HAVE_SYS_SELECT_H <sys/select.h> exists - -System-specific options: - -GWINSZ_IN_SYS_IOCTL need to include <sys/ioctl.h> for TIOCGWINSZ -HAVE_GETPW_DECLS the getpw* functions are declared in <pwd.h> and cannot - be redeclared without compiler errors -HAVE_STRCASECMP the strcasecmp and strncasecmp functions are available - -USG Running a variant of System V -USGr3 Running System V.3 -XENIX_22 Xenix 2.2 -Linux Linux -CRAY running a recent version of Cray UNICOS -SunOS4 Running SunOS 4.x diff --git a/contrib/libreadline/complete.c b/contrib/libreadline/complete.c index fb48712..714a2bf 100644 --- a/contrib/libreadline/complete.c +++ b/contrib/libreadline/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 (); @@ -1418,9 +1407,9 @@ username_completion_function (text, state) char *text; int state; { -#if defined (__WIN32__) || defined (__OPENNT) +#if defined (__GO32__) || defined (__WIN32__) || defined (__OPENNT) return (char *)NULL; -#else /* !__WIN32__ && !__OPENNT) */ +#else /* !__GO32__ */ 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,25 +1494,11 @@ 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'; - } -#endif else { dirname[0] = '.'; @@ -1685,7 +1660,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/contrib/libreadline/display.c b/contrib/libreadline/display.c index 4487004..25aba64 100644 --- a/contrib/libreadline/display.c +++ b/contrib/libreadline/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; + +/* 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 __P((char *, char *, int, int, int, int)); -static void space_to_eol __P((int)); -static void delete_chars __P((int)); -static void insert_some_chars __P((char *, int)); -static void cr __P((void)); +static 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; @@ -684,12 +651,8 @@ rl_redisplay () if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && _rl_last_c_pos <= last_invisible && local_prompt) { -#if defined (__MSDOS__) - putc ('\r', rl_outstream); -#else if (term_cr) tputs (term_cr, 1, _rl_output_character_function); -#endif _rl_output_some_chars (local_prompt, nleft); _rl_last_c_pos = nleft; } @@ -809,17 +772,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 @@ -942,11 +899,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) term_cr && lendiff > visible_length && _rl_last_c_pos > 0 && od > lendiff && _rl_last_c_pos < last_invisible) { -#if defined (__MSDOS__) - putc ('\r', rl_outstream); -#else tputs (term_cr, 1, _rl_output_character_function); -#endif _rl_output_some_chars (local_prompt, lendiff); _rl_last_c_pos = lendiff; } @@ -1076,58 +1029,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 +1086,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 +1114,20 @@ _rl_move_vert (to) if (_rl_last_v_pos == to || to > screenheight) return; +#if defined (__GO32__) + { + int row, col; + + ScreenGetCursor (&row, &col); + ScreenSetCursor ((row + to - _rl_last_v_pos), col); + } +#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 +1136,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 +1344,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 +1369,11 @@ space_to_eol (count) void _rl_clear_screen () { +#if !defined (__GO32__) if (term_clrpag) tputs (term_clrpag, 1, _rl_output_character_function); else +#endif /* !__GO32__ */ crlf (); } @@ -1471,6 +1383,20 @@ insert_some_chars (string, count) char *string; int count; { +#if defined (__GO32__) + 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); + + /* 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 +1429,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 +1437,18 @@ static void delete_chars (count) int count; { +#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 +1464,7 @@ delete_chars (count) while (count--) tputs (term_dc, 1, _rl_output_character_function); } +#endif /* !__GO32__ */ } void @@ -1546,11 +1486,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); @@ -1567,66 +1503,23 @@ cr () { if (term_cr) { -#if defined (__MSDOS__) - putc ('\r', rl_outstream); -#else tputs (term_cr, 1, _rl_output_character_function); -#endif _rl_last_c_pos = 0; } } -/* Redraw the last line of a multi-line prompt that may possibly contain - terminal escape sequences. Called with the cursor at column 0 of the - line to draw the prompt on. */ -static void -redraw_prompt (t) - char *t; -{ - char *oldp, *oldl, *oldlprefix; - int oldlen, oldlast, oldplen; - - /* Geez, I should make this a struct. */ - oldp = rl_display_prompt; - oldl = local_prompt; - oldlprefix = local_prompt_prefix; - oldlen = visible_length; - oldplen = prefix_length; - oldlast = last_invisible; - - rl_display_prompt = t; - local_prompt = expand_prompt (t, &visible_length, &last_invisible); - local_prompt_prefix = (char *)NULL; - rl_forced_update_display (); - - rl_display_prompt = oldp; - local_prompt = oldl; - local_prompt_prefix = oldlprefix; - visible_length = oldlen; - prefix_length = oldplen; - last_invisible = oldlast; -} - /* Redisplay the current line after a SIGWINCH is received. */ void _rl_redisplay_after_sigwinch () { - char *t; + 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. */ if (term_cr) { -#if defined (__MSDOS__) - putc ('\r', rl_outstream); -#else tputs (term_cr, 1, _rl_output_character_function); -#endif _rl_last_c_pos = 0; -#if defined (__MSDOS__) - space_to_eol (screenwidth); - putc ('\r', rl_outstream); -#else if (term_clreol) tputs (term_clreol, 1, _rl_output_character_function); else @@ -1634,7 +1527,6 @@ _rl_redisplay_after_sigwinch () space_to_eol (screenwidth); tputs (term_cr, 1, _rl_output_character_function); } -#endif if (_rl_last_v_pos > 0) _rl_move_vert (0); } @@ -1644,7 +1536,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 +1571,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/contrib/libreadline/doc/Makefile b/contrib/libreadline/doc/Makefile deleted file mode 100644 index 9dbab24..0000000 --- a/contrib/libreadline/doc/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# This makefile for Readline library documentation is in -*- text -*- mode. -# Emacs likes it that way. -TEXI2DVI = texi2dvi - -RM = rm -f - -INSTALL_DATA = cp -infodir = /usr/local/info - -RLSRC = rlman.texinfo rluser.texinfo rltech.texinfo -HISTSRC = hist.texinfo hsuser.texinfo hstech.texinfo - -DVIOBJ = readline.dvi history.dvi -INFOOBJ = readline.info history.info -PSOBJ = readline.ps history.ps -HTMLOBJ = readline.html history.html - -all: info dvi html - -readline.dvi: $(RLSRC) - $(TEXI2DVI) rlman.texinfo - mv rlman.dvi readline.dvi - -readline.info: $(RLSRC) - makeinfo --no-split -o $@ rlman.texinfo - -history.dvi: ${HISTSRC} - $(TEXI2DVI) hist.texinfo - mv hist.dvi history.dvi - -history.info: ${HISTSRC} - makeinfo --no-split -o $@ hist.texinfo - -readline.ps: readline.dvi - dvips -D 300 -o $@ readline.dvi - -history.ps: history.dvi - dvips -D 300 -o $@ history.dvi - -readline.html: ${RLSRC} - texi2html rlman.texinfo - sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html - sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html - rm -f rlman.html rlman_toc.html - -history.html: ${HISTSRC} - texi2html hist.texinfo - sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html - sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html - rm -f hist.html hist_toc.html - -info: $(INFOOBJ) -dvi: $(DVIOBJ) -ps: $(PSOBJ) -html: $(HTMLOBJ) - -clean: - $(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \ - *.fns *.kys *.tps *.vrs *.o core - -distclean: clean -mostlyclean: clean - -maintainer-clean: clean - $(RM) *.dvi *.info *.info-* *.ps *.html - -install: info - ${INSTALL_DATA} readline.info $(infodir)/readline.info - ${INSTALL_DATA} history.info $(infodir)/history.info diff --git a/contrib/libreadline/doc/readline.3 b/contrib/libreadline/doc/readline.3 index c1ed9cf..5f01b6c 100644 --- a/contrib/libreadline/doc/readline.3 +++ b/contrib/libreadline/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. @@ -23,8 +23,8 @@ readline \- get a line from a user with editing .nf .ft B #include <stdio.h> -#include <readline.h> -#include <history.h> +#include <readline/readline.h> +#include <readline/history.h> .ft .fi .LP @@ -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/contrib/libreadline/examples/Makefile b/contrib/libreadline/examples/Makefile deleted file mode 100644 index cfa7745..0000000 --- a/contrib/libreadline/examples/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# This is the Makefile for the examples subdirectory of readline. -*- text -*- -# -EXECUTABLES = fileman rltest -CFLAGS = -g -I../.. -I.. -LDFLAGS = -g -L.. - -.c.o: - $(CC) $(CFLAGS) -c $< - -all: $(EXECUTABLES) - -fileman: fileman.o - $(CC) $(LDFLAGS) -o $@ fileman.o -lreadline -ltermcap - -rltest: rltest.o - $(CC) $(LDFLAGS) -o $@ rltest.o -lreadline -ltermcap - -fileman.o: fileman.c -rltest.o: rltest.c diff --git a/contrib/libreadline/readline.3 b/contrib/libreadline/readline.3 index c1ed9cf..5f01b6c 100644 --- a/contrib/libreadline/readline.3 +++ b/contrib/libreadline/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. @@ -23,8 +23,8 @@ readline \- get a line from a user with editing .nf .ft B #include <stdio.h> -#include <readline.h> -#include <history.h> +#include <readline/readline.h> +#include <readline/history.h> .ft .fi .LP @@ -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/contrib/libreadline/readline.h b/contrib/libreadline/readline.h index 97c62fd1..21fe31b 100644 --- a/contrib/libreadline/readline.h +++ b/contrib/libreadline/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,9 @@ 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. */ + +/* $FreeBSD$ */ #if !defined (_READLINE_H_) #define _READLINE_H_ @@ -192,7 +194,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. */ @@ -300,15 +302,7 @@ extern int rl_read_init_file __P((char *)); extern int rl_parse_and_bind __P((char *)); /* Functions for manipulating keymaps. */ -extern Keymap rl_make_bare_keymap __P((void)); -extern Keymap rl_copy_keymap __P((Keymap)); -extern Keymap rl_make_keymap __P((void)); -extern void rl_discard_keymap __P((Keymap)); - -extern Keymap rl_get_keymap_by_name __P((char *)); extern char *rl_get_keymap_name __P((Keymap)); -extern void rl_set_keymap __P((Keymap)); -extern Keymap rl_get_keymap __P((void)); extern void rl_set_keymap_from_edit_mode __P((void)); extern char *rl_get_keymap_name_from_edit_mode __P((void)); @@ -331,12 +325,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 +399,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 +462,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 +605,8 @@ extern int rl_inhibit_completion; #define MULT_MATCH 2 #if !defined (savestring) -extern char *savestring __P((char *)); /* XXX backwards compatibility */ +#define savestring rl_savestring +extern char *savestring (); /* XXX backwards compatibility */ #endif #ifdef __cplusplus diff --git a/contrib/libreadline/rlconf.h b/contrib/libreadline/rlconf.h index d2ab704..1356fd8 100644 --- a/contrib/libreadline/rlconf.h +++ b/contrib/libreadline/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/contrib/libreadline/savestring.c b/contrib/libreadline/savestring.c deleted file mode 100644 index 3f53a87..0000000 --- a/contrib/libreadline/savestring.c +++ /dev/null @@ -1,33 +0,0 @@ -/* savestring.c */ - -/* Copyright (C) 1998 Free Software Foundation, Inc. - - This file is part of the GNU Readline Library, a library for - reading lines of text with interactive input and history editing. - - The GNU Readline Library is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 1, or - (at your option) any later version. - - The GNU Readline Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - The GNU General Public License is often shipped with GNU software, and - is generally kept in a file called COPYING or LICENSE. If you do not - have a copy of the license, write to the Free Software Foundation, - 675 Mass Ave, Cambridge, MA 02139, USA. */ - -extern char *strcpy (); -extern char *xmalloc (); - -/* Backwards compatibility, now that savestring has been removed from - all `public' readline header files. */ -char * -savestring (s) - char *s; -{ - return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s))); -} diff --git a/contrib/libreadline/shell.c b/contrib/libreadline/shell.c index 3daef69..091ec08 100644 --- a/contrib/libreadline/shell.c +++ b/contrib/libreadline/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) @@ -44,21 +44,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 +63,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 +131,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/contrib/libreadline/terminal.c b/contrib/libreadline/terminal.c index 20ad126..e62b76c 100644 --- a/contrib/libreadline/terminal.c +++ b/contrib/libreadline/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" @@ -62,8 +64,18 @@ #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 (); /* **************************************************************** */ /* */ @@ -137,22 +149,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 +161,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 +174,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,10 +186,8 @@ _rl_get_screen_size (tty, ignore_env) if (ignore_env == 0 && (ss = get_env_value ("COLUMNS"))) screenwidth = atoi (ss); -#if !defined (__DJGPP__) if (screenwidth <= 0 && term_string_buffer) screenwidth = tgetnum ("co"); -#endif } /* Environment variable LINES overrides setting of "li" if IGNORE_ENV @@ -198,10 +197,8 @@ _rl_get_screen_size (tty, ignore_env) if (ignore_env == 0 && (ss = get_env_value ("LINES"))) screenheight = atoi (ss); -#if !defined (__DJGPP__) if (screenheight <= 0 && term_string_buffer) screenheight = tgetnum ("li"); -#endif } /* If all else fails, default to 80x24 terminal. */ @@ -216,7 +213,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 +251,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 */ + "@7", &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,96 +287,72 @@ static void get_term_capabilities (bp) char **bp; { -#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */ register int i; for (i = 0; i < NUM_TC_STRINGS; i++) *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp); -#endif 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__) + screenwidth = ScreenCols (); + screenheight = ScreenRows (); + screenchars = screenwidth * screenheight; + 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; +#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 +367,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 +413,7 @@ _rl_init_terminal_io (terminal_name) _rl_keymap = xkeymap; +#endif /* !__GO32__ */ return 0; } @@ -481,7 +459,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 +475,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; @@ -525,6 +504,7 @@ ding () { if (readline_echoing_p) { +#if !defined (__GO32__) switch (_rl_bell_preference) { case NO_BELL: @@ -542,6 +522,10 @@ ding () fflush (stderr); break; } +#else /* __GO32__ */ + fprintf (stderr, "\007"); + fflush (stderr); +#endif /* __GO32__ */ return (0); } return (-1); @@ -556,20 +540,16 @@ ding () void _rl_enable_meta_key () { -#if !defined (__DJGPP__) if (term_has_meta && term_mm) tputs (term_mm, 1, _rl_output_character_function); -#endif } void _rl_control_keypad (on) int on; { -#if !defined (__DJGPP__) if (on && term_ks) tputs (term_ks, 1, _rl_output_character_function); else if (!on && term_ke) tputs (term_ke, 1, _rl_output_character_function); -#endif } diff --git a/contrib/libreadline/util.c b/contrib/libreadline/util.c index be9e0a9..1dc3b66 100644 --- a/contrib/libreadline/util.c +++ b/contrib/libreadline/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 */ |