Commit 1e3be5e9 authored by unknown's avatar unknown
Browse files

Merge mysqldev@production.mysql.com:jimw/mysql-5.0-readline

into  mysql.com:/home/jimw/my/mysql-5.0-readline

parents cdf03871 42d10743
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
Basic Installation
==================

These are installation instructions for Readline-4.3.
These are installation instructions for Readline-5.0.

The simplest way to compile readline is:

+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@ libreadline_a_SOURCES = readline.c funmap.c keymaps.c \
			callback.c terminal.c xmalloc.c \
			history.c histsearch.c histexpand.c \
			histfile.c nls.c search.c \
			shell.c tilde.c misc.c text.c mbutil.c
			shell.c tilde.c misc.c text.c mbutil.c \
			compat.c savestring.c

pkginclude_HEADERS =	readline.h chardefs.h keymaps.h \
			history.h tilde.h rlmbutil.h rltypedefs.h rlprivate.h \
+1 −1
Original line number Diff line number Diff line
Introduction
============

This is the Gnu Readline library, version 4.3.
This is the Gnu Readline library, version 5.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
+112 −40
Original line number Diff line number Diff line
@@ -19,8 +19,13 @@
   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. */

#define READLINE_LIBRARY

#if defined (__TANDEM)
#  include <floss.h>
#endif

#include "config_readline.h"

#include <stdio.h>
@@ -146,6 +151,34 @@ rl_bind_key_in_map (key, function, map)
  return (result);
}

/* Bind key sequence KEYSEQ to DEFAULT_FUNC if KEYSEQ is unbound.  Right
   now, this is always used to attempt to bind the arrow keys, hence the
   check for rl_vi_movement_mode. */
int
rl_bind_key_if_unbound_in_map (key, default_func, kmap)
     int key;
     rl_command_func_t *default_func;
     Keymap kmap;
{
  char keyseq[2];

  keyseq[0] = (unsigned char)key;
  keyseq[1] = '\0';
  return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, kmap));
}

int
rl_bind_key_if_unbound (key, default_func)
     int key;
     rl_command_func_t *default_func;
{
  char keyseq[2];

  keyseq[0] = (unsigned char)key;
  keyseq[1] = '\0';
  return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, _rl_keymap));
}

/* Make KEY do nothing in the currently selected keymap.
   Returns non-zero in case of error. */
int
@@ -197,10 +230,31 @@ rl_unbind_command_in_map (command, map)
  return (rl_unbind_function_in_map (func, map));
}

/* Bind the key sequence represented by the string KEYSEQ to
   FUNCTION, starting in the current keymap.  This makes new
   keymaps as necessary. */
int
rl_bind_keyseq (keyseq, function)
     const char *keyseq;
     rl_command_func_t *function;
{
  return (rl_generic_bind (ISFUNC, keyseq, (char *)function, _rl_keymap));
}

/* Bind the key sequence represented by the string KEYSEQ to
   FUNCTION.  This makes new keymaps as necessary.  The initial
   place to do bindings is in MAP. */
int
rl_bind_keyseq_in_map (keyseq, function, map)
     const char *keyseq;
     rl_command_func_t *function;
     Keymap map;
{
  return (rl_generic_bind (ISFUNC, keyseq, (char *)function, map));
}

/* Backwards compatibility; equivalent to rl_bind_keyseq_in_map() */
int
rl_set_key (keyseq, function, map)
     const char *keyseq;
     rl_command_func_t *function;
@@ -209,6 +263,40 @@ rl_set_key (keyseq, function, map)
  return (rl_generic_bind (ISFUNC, keyseq, (char *)function, map));
}

/* Bind key sequence KEYSEQ to DEFAULT_FUNC if KEYSEQ is unbound.  Right
   now, this is always used to attempt to bind the arrow keys, hence the
   check for rl_vi_movement_mode. */
int
rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, kmap)
     const char *keyseq;
     rl_command_func_t *default_func;
     Keymap kmap;
{
  rl_command_func_t *func;

  if (keyseq)
    {
      func = rl_function_of_keyseq (keyseq, kmap, (int *)NULL);
#if defined (VI_MODE)
      if (!func || func == rl_do_lowercase_version || func == rl_vi_movement_mode)
#else
      if (!func || func == rl_do_lowercase_version)
#endif
	return (rl_bind_keyseq_in_map (keyseq, default_func, kmap));
      else
	return 1;
    }
  return 0;
}

int
rl_bind_keyseq_if_unbound (keyseq, default_func)
     const char *keyseq;
     rl_command_func_t *default_func;
{
  return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, _rl_keymap));
}

/* Bind the key sequence represented by the string KEYSEQ to
   the string of characters MACRO.  This makes new keymaps as
   necessary.  The initial place to do bindings is in MAP. */
@@ -346,7 +434,7 @@ rl_translate_keyseq (seq, array, len)
{
  register int i, c, l, temp;

  for (i = l = 0; (c = seq[i]); i++)
  for (i = l = 0; c = seq[i]; i++)
    {
      if (c == '\\')
	{
@@ -678,7 +766,7 @@ _rl_read_file (filename, sizep)
/* Re-read the current keybindings file. */
int
rl_re_read_init_file (count, ignore)
     int count __attribute__((unused)), ignore __attribute__((unused));
     int count, ignore;
{
  int r;
  r = rl_read_init_file ((const char *)NULL);
@@ -900,7 +988,7 @@ parser_if (args)
/* Invert the current parser state if there is anything on the stack. */
static int
parser_else (args)
     char *args __attribute__((unused));
     char *args;
{
  register int i;

@@ -910,9 +998,15 @@ parser_else (args)
      return 0;
    }

#if 0
  /* Check the previous (n - 1) levels of the stack to make sure that
     we haven't previously turned off parsing. */
  for (i = 0; i < if_stack_depth - 1; i++)
#else
  /* Check the previous (n) levels of the stack to make sure that
     we haven't previously turned off parsing. */
  for (i = 0; i < if_stack_depth; i++)
#endif
    if (if_stack[i] == 1)
      return 0;

@@ -925,7 +1019,7 @@ parser_else (args)
   _rl_parsing_conditionalized_out from the stack. */
static int
parser_endif (args)
     char *args __attribute__((unused));
     char *args;
{
  if (if_stack_depth)
    _rl_parsing_conditionalized_out = if_stack[--if_stack_depth];
@@ -1048,7 +1142,7 @@ rl_parse_and_bind (string)
    {
      int passc = 0;

      for (i = 1; (c = string[i]); i++)
      for (i = 1; c = string[i]; i++)
	{
	  if (passc)
	    {
@@ -1124,7 +1218,7 @@ rl_parse_and_bind (string)
    {
      int delimiter = string[i++], passc;

      for (passc = 0; (c = string[i]); i++)
      for (passc = 0; c = string[i]; i++)
	{
	  if (passc)
	    {
@@ -1159,7 +1253,7 @@ rl_parse_and_bind (string)
    }

  /* If this is a new-style key-binding, then do the binding with
     rl_set_key ().  Otherwise, let the older code deal with it. */
     rl_bind_keyseq ().  Otherwise, let the older code deal with it. */
  if (*string == '"')
    {
      char *seq;
@@ -1198,7 +1292,7 @@ rl_parse_and_bind (string)
	  rl_macro_bind (seq, &funname[1], _rl_keymap);
	}
      else
	rl_set_key (seq, rl_named_function (funname), _rl_keymap);
	rl_bind_keyseq (seq, rl_named_function (funname));

      free (seq);
      return 0;
@@ -1279,10 +1373,11 @@ static struct {
  { "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 },
  { "show-all-if-unmodified",	&_rl_complete_show_unmodified,	0 },
#if defined (VISIBLE_STATS)
  { "visible-stats",		&rl_visible_stats,		0 },
#endif /* VISIBLE_STATS */
  { (char *)NULL, (int *)NULL, 0 }
  { (char *)NULL, (int *)NULL }
};

static int
@@ -1351,7 +1446,7 @@ static struct {
  { "editing-mode",	V_STRING,	sv_editmode },
  { "isearch-terminators", V_STRING,	sv_isrchterm },
  { "keymap",		V_STRING,	sv_keymap },
  { (char *)NULL,	0, 0 }
  { (char *)NULL,	0 }
};

static int
@@ -1626,8 +1721,7 @@ rl_set_keymap_from_edit_mode ()
#endif /* VI_MODE */
}


const char *
char *
rl_get_keymap_name_from_edit_mode ()
{
  if (rl_editing_mode == emacs_mode)
@@ -1637,7 +1731,7 @@ rl_get_keymap_name_from_edit_mode ()
    return "vi";
#endif /* VI_MODE */
  else
    return "nope";
    return "none";
}

/* **************************************************************** */
@@ -1649,7 +1743,7 @@ rl_get_keymap_name_from_edit_mode ()
/* Each of the following functions produces information about the
   state of keybindings and functions known to Readline.  The info
   is always printed to rl_outstream, and in such a way that it can
   be read back in (i.e., passed to rl_parse_and_bind (). */
   be read back in (i.e., passed to rl_parse_and_bind ()). */

/* Print the names of functions known to Readline. */
void
@@ -1872,7 +1966,7 @@ rl_function_dumper (print_readably)

  fprintf (rl_outstream, "\n");

  for (i = 0; (name = names[i]); i++)
  for (i = 0; name = names[i]; i++)
    {
      rl_command_func_t *function;
      char **invokers;
@@ -1932,7 +2026,7 @@ rl_function_dumper (print_readably)
   the output in such a way that it can be read back in. */
int
rl_dump_functions (count, key)
     int count __attribute__((unused)), key __attribute__((unused));
     int count, key;
{
  if (rl_dispatching)
    fprintf (rl_outstream, "\r\n");
@@ -2012,7 +2106,7 @@ rl_macro_dumper (print_readably)

int
rl_dump_macros (count, key)
     int count __attribute__((unused)), key __attribute__((unused));
     int count, key;
{
  if (rl_dispatching)
    fprintf (rl_outstream, "\r\n");
@@ -2102,7 +2196,7 @@ rl_variable_dumper (print_readably)
   the output in such a way that it can be read back in. */
int
rl_dump_variables (count, key)
     int count __attribute__((unused)), key __attribute__((unused));
     int count, key;
{
  if (rl_dispatching)
    fprintf (rl_outstream, "\r\n");
@@ -2111,28 +2205,6 @@ rl_dump_variables (count, key)
  return (0);
}

/* Bind key sequence KEYSEQ to DEFAULT_FUNC if KEYSEQ is unbound.  Right
   now, this is always used to attempt to bind the arrow keys, hence the
   check for rl_vi_movement_mode. */
void
_rl_bind_if_unbound (keyseq, default_func)
     const char *keyseq;
     rl_command_func_t *default_func;
{
  rl_command_func_t *func;

  if (keyseq)
    {
      func = rl_function_of_keyseq (keyseq, _rl_keymap, (int *)NULL);
#if defined (VI_MODE)
      if (!func || func == rl_do_lowercase_version || func == rl_vi_movement_mode)
#else
      if (!func || func == rl_do_lowercase_version)
#endif
	rl_set_key (keyseq, default_func, _rl_keymap);
    }
}

/* Return non-zero if any members of ARRAY are a substring in STRING. */
static int
substring_member_of_array (string, array)
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ rl_callback_read_char ()
	  if (in_handler == 0 && rl_linefunc)
	    _rl_callback_newline ();
	}
      if (rl_pending_input)
      if (rl_pending_input || _rl_pushed_input_available ())
	eof = readline_internal_char ();
      else
        break;
Loading