Commit 953f6c51 authored by unknown's avatar unknown

upgrade readline to version 4.3


client/completion_hash.cc:
  correct headers of functions for readline 4.3 (add const modifier to char*)
client/completion_hash.h:
  correct headers of functions for readline 4.3 (add const modifier to char*)
client/mysql.cc:
  correct functions for readline 4.3
parent 0fb3b8d9
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <my_sys.h> #include <my_sys.h>
#include "completion_hash.h" #include "completion_hash.h"
uint hashpjw(char *arKey, uint nKeyLength) uint hashpjw(const char *arKey, uint nKeyLength)
{ {
uint h = 0, g, i; uint h = 0, g, i;
...@@ -111,7 +111,7 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, ...@@ -111,7 +111,7 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength,
return SUCCESS; return SUCCESS;
} }
static Bucket *completion_hash_find(HashTable *ht, char *arKey, static Bucket *completion_hash_find(HashTable *ht, const char *arKey,
uint nKeyLength) uint nKeyLength)
{ {
uint h, nIndex; uint h, nIndex;
...@@ -156,7 +156,7 @@ int completion_hash_exists(HashTable *ht, char *arKey, uint nKeyLength) ...@@ -156,7 +156,7 @@ int completion_hash_exists(HashTable *ht, char *arKey, uint nKeyLength)
return 0; return 0;
} }
Bucket *find_all_matches(HashTable *ht, char *str, uint length, Bucket *find_all_matches(HashTable *ht, const char *str, uint length,
uint *res_length) uint *res_length)
{ {
Bucket *b; Bucket *b;
......
...@@ -43,14 +43,14 @@ typedef struct hashtable { ...@@ -43,14 +43,14 @@ typedef struct hashtable {
uint nTableSize; uint nTableSize;
uint initialized; uint initialized;
MEM_ROOT mem_root; MEM_ROOT mem_root;
uint(*pHashFunction) (char *arKey, uint nKeyLength); uint(*pHashFunction) (const char *arKey, uint nKeyLength);
Bucket **arBuckets; Bucket **arBuckets;
} HashTable; } HashTable;
extern int completion_hash_init(HashTable *ht, uint nSize); extern int completion_hash_init(HashTable *ht, uint nSize);
extern int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, char *str); extern int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, char *str);
extern int hash_exists(HashTable *ht, char *arKey); extern int hash_exists(HashTable *ht, char *arKey);
extern Bucket *find_all_matches(HashTable *ht, char *str, uint length, uint *res_length); extern Bucket *find_all_matches(HashTable *ht, const char *str, uint length, uint *res_length);
extern Bucket *find_longest_match(HashTable *ht, char *str, uint length, uint *res_length); extern Bucket *find_longest_match(HashTable *ht, char *str, uint length, uint *res_length);
extern void add_word(HashTable *ht,char *str); extern void add_word(HashTable *ht,char *str);
extern void completion_hash_clean(HashTable *ht); extern void completion_hash_clean(HashTable *ht);
......
...@@ -1049,8 +1049,8 @@ static bool add_line(String &buffer,char *line,char *in_string) ...@@ -1049,8 +1049,8 @@ static bool add_line(String &buffer,char *line,char *in_string)
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
static char *new_command_generator(char *text, int); static char *new_command_generator(const char *text, int);
static char **new_mysql_completion (char *text, int start, int end); static char **new_mysql_completion (const char *text, int start, int end);
/* /*
Tell the GNU Readline library how to complete. We want to try to complete Tell the GNU Readline library how to complete. We want to try to complete
...@@ -1058,8 +1058,8 @@ static char **new_mysql_completion (char *text, int start, int end); ...@@ -1058,8 +1058,8 @@ static char **new_mysql_completion (char *text, int start, int end);
if not. if not.
*/ */
char **no_completion (char *text __attribute__ ((unused)), char *no_completion (const char *text __attribute__ ((unused)),
char *word __attribute__ ((unused))) int )
{ {
return 0; /* No filename completion */ return 0; /* No filename completion */
} }
...@@ -1071,8 +1071,8 @@ static void initialize_readline (char *name) ...@@ -1071,8 +1071,8 @@ static void initialize_readline (char *name)
/* Tell the completer that we want a crack first. */ /* Tell the completer that we want a crack first. */
/* rl_attempted_completion_function = (CPPFunction *)mysql_completion;*/ /* rl_attempted_completion_function = (CPPFunction *)mysql_completion;*/
rl_attempted_completion_function = (CPPFunction *) new_mysql_completion; rl_attempted_completion_function = &new_mysql_completion;
rl_completion_entry_function=(Function *) no_completion; rl_completion_entry_function= &no_completion;
} }
/* /*
...@@ -1082,17 +1082,17 @@ static void initialize_readline (char *name) ...@@ -1082,17 +1082,17 @@ static void initialize_readline (char *name)
array of matches, or NULL if there aren't any. array of matches, or NULL if there aren't any.
*/ */
static char **new_mysql_completion (char *text, static char **new_mysql_completion (const char *text,
int start __attribute__((unused)), int start __attribute__((unused)),
int end __attribute__((unused))) int end __attribute__((unused)))
{ {
if (!status.batch && !quick) if (!status.batch && !quick)
return completion_matches(text, (CPFunction*) new_command_generator); return rl_completion_matches(text, new_command_generator);
else else
return (char**) 0; return (char**) 0;
} }
static char *new_command_generator(char *text,int state) static char *new_command_generator(const char *text,int state)
{ {
static int textlen; static int textlen;
char *ptr; char *ptr;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA 59 Temple Place, Suite 330, Boston, MA 02111 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. 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. ...@@ -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 You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
......
This diff is collapsed.
...@@ -15,7 +15,7 @@ libreadline_a_SOURCES = readline.c funmap.c keymaps.c \ ...@@ -15,7 +15,7 @@ libreadline_a_SOURCES = readline.c funmap.c keymaps.c \
callback.c terminal.c xmalloc.c \ callback.c terminal.c xmalloc.c \
history.c histsearch.c histexpand.c \ history.c histsearch.c histexpand.c \
histfile.c nls.c search.c \ histfile.c nls.c search.c \
shell.c tilde.c shell.c tilde.c misc.c text.c mbutil.c
pkginclude_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h pkginclude_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
......
Introduction Introduction
============ ============
This is the Gnu Readline library, version 4.0. This is the Gnu Readline library, version 4.3.
The Readline library provides a set of functions for use by applications The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both that allow users to edit command lines as they are typed in. Both
...@@ -16,8 +16,8 @@ may be used without Readline in applications which desire its ...@@ -16,8 +16,8 @@ may be used without Readline in applications which desire its
capabilities. capabilities.
The Readline library is free software, distributed under the terms of The Readline library is free software, distributed under the terms of
the GNU Public License, version 2. For more information, see the file the [GNU] General Public License, version 2. For more information, see
COPYING. the file COPYING.
To build the library, try typing `./configure', then `make'. The To build the library, try typing `./configure', then `make'. The
configuration process is automated, so no further intervention should configuration process is automated, so no further intervention should
...@@ -37,6 +37,9 @@ to customize and control the build process. ...@@ -37,6 +37,9 @@ to customize and control the build process.
The file rlconf.h contains C preprocessor defines that enable and disable The file rlconf.h contains C preprocessor defines that enable and disable
certain Readline features. certain Readline features.
The special make target `everything' will build the static and shared
libraries (if the target platform supports them) and the examples.
Examples Examples
======== ========
...@@ -54,6 +57,9 @@ a Makefile in the `shlib' subdirectory, and typing `make shared' ...@@ -54,6 +57,9 @@ a Makefile in the `shlib' subdirectory, and typing `make shared'
will cause shared versions of the Readline and History libraries will cause shared versions of the Readline and History libraries
to be built on supported platforms. to be built on supported platforms.
If `configure' is given the `--enable-shared' option, it will attempt
to build the shared libraries by default on supported platforms.
Configure calls the script support/shobj-conf to test whether or Configure calls the script support/shobj-conf to test whether or
not shared library creation is supported and to generate the values not shared library creation is supported and to generate the values
of variables that are substituted into shlib/Makefile. If you of variables that are substituted into shlib/Makefile. If you
...@@ -64,8 +70,8 @@ your platform. ...@@ -64,8 +70,8 @@ your platform.
If you need to update support/shobj-conf, you will need to create If you need to update support/shobj-conf, you will need to create
a `stanza' for your operating system and compiler. The script uses a `stanza' for your operating system and compiler. The script uses
the value of host_os and ${CC} as determined by configure. For the value of host_os and ${CC} as determined by configure. For
instance, FreeBSD 2.2.5 with any version of gcc is identified as instance, FreeBSD 4.2 with any version of gcc is identified as
`freebsd2.2.5-gcc*'. `freebsd4.2-gcc*'.
In the stanza for your operating system-compiler pair, you will need to In the stanza for your operating system-compiler pair, you will need to
define several variables. They are: define several variables. They are:
...@@ -122,18 +128,21 @@ Once you have updated support/shobj-conf, re-run configure and type ...@@ -122,18 +128,21 @@ Once you have updated support/shobj-conf, re-run configure and type
`make shared'. The shared libraries will be created in the shlib `make shared'. The shared libraries will be created in the shlib
subdirectory. subdirectory.
Since shared libraries are not created on all platforms, `make install' If shared libraries are created, `make install' will install them.
will not automatically install the shared libraries. To install them, You may install only the shared libraries by running `make
change the current directory to shlib and type `make install'. Running install-shared' from the top-level build directory. Running `make
`make install-shared' from the top-level build directory will also work. install' in the shlib subdirectory will also work. If you don't want
to install any created shared libraries, run `make install-static'.
Documentation Documentation
============= =============
The documentation for the Readline and History libraries appears in the The documentation for the Readline and History libraries appears in
`doc' subdirectory. There are two texinfo files and a Unix-style manual the `doc' subdirectory. There are three texinfo files and a
page describing the programming facilities available in the Readline Unix-style manual page describing the facilities available in the
library. The texinfo files include both user and programmer's manuals. Readline library. The texinfo files include both user and
programmer's manuals. HTML versions of the manuals appear in the
`doc' subdirectory as well.
Reporting Bugs Reporting Bugs
============== ==============
...@@ -144,7 +153,7 @@ Bug reports for Readline should be sent to: ...@@ -144,7 +153,7 @@ Bug reports for Readline should be sent to:
When reporting a bug, please include the following information: When reporting a bug, please include the following information:
* the version number and release status of Readline (e.g., 4.0-release) * the version number and release status of Readline (e.g., 4.2-release)
* the machine and OS that it is running on * the machine and OS that it is running on
* a list of the compilation flags or the contents of `config.h', if * a list of the compilation flags or the contents of `config.h', if
appropriate appropriate
......
...@@ -18,18 +18,31 @@ ...@@ -18,18 +18,31 @@
You should have received a copy of the GNU General Public License along 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 with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_STDLIB_H_) #if !defined (_STDLIB_H_)
#define _STDLIB_H_ 1 #define _STDLIB_H_ 1
/* String conversion functions. */ /* String conversion functions. */
extern int atoi (); extern int atoi ();
extern long int atol ();
extern double atof ();
extern double strtod ();
/* Memory allocation functions. */ /* Memory allocation functions. */
extern char *malloc (); /* Generic pointer type. */
extern char *realloc (); #ifndef PTR_T
#if defined (__STDC__)
# define PTR_T void *
#else
# define PTR_T char *
#endif
#endif /* PTR_T */
extern PTR_T malloc ();
extern PTR_T realloc ();
extern void free (); extern void free ();
/* Other miscellaneous functions. */ /* Other miscellaneous functions. */
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 1, or as published by the Free Software Foundation; either version 2, or
(at your option) any later version. (at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be The GNU Readline Library is distributed in the hope that it will be
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and 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 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, have a copy of the license, write to the Free Software Foundation,
675 Mass Ave, Cambridge, MA 02139, USA. */ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
...@@ -29,22 +29,20 @@ ...@@ -29,22 +29,20 @@
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
#include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#else
# include "ansi_stdlib.h"
#endif
#include <stdio.h> #include <stdio.h>
/* System-specific feature definitions and include files. */ /* System-specific feature definitions and include files. */
#include "rldefs.h" #include "rldefs.h"
#include "readline.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;
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
...@@ -61,7 +59,7 @@ extern int rl_visible_prompt_length; ...@@ -61,7 +59,7 @@ extern int rl_visible_prompt_length;
text read in at each end of line. The terminal is kept prepped and text read in at each end of line. The terminal is kept prepped and
signals handled all the time, except during calls to the user's function. */ signals handled all the time, except during calls to the user's function. */
VFunction *rl_linefunc; /* user callback function */ rl_vcpfunc_t *rl_linefunc; /* user callback function */
static int in_handler; /* terminal_prepped and signals set? */ static int in_handler; /* terminal_prepped and signals set? */
/* Make sure the terminal is set up, initialize readline, and prompt. */ /* Make sure the terminal is set up, initialize readline, and prompt. */
...@@ -87,11 +85,10 @@ _rl_callback_newline () ...@@ -87,11 +85,10 @@ _rl_callback_newline ()
/* Install a readline handler, set up the terminal, and issue the prompt. */ /* Install a readline handler, set up the terminal, and issue the prompt. */
void void
rl_callback_handler_install (prompt, linefunc) rl_callback_handler_install (prompt, linefunc)
char *prompt; const char *prompt;
VFunction *linefunc; rl_vcpfunc_t *linefunc;
{ {
rl_prompt = prompt; rl_set_prompt (prompt);
rl_visible_prompt_length = rl_prompt ? rl_expand_prompt (rl_prompt) : 0;
rl_linefunc = linefunc; rl_linefunc = linefunc;
_rl_callback_newline (); _rl_callback_newline ();
} }
...@@ -111,24 +108,33 @@ rl_callback_read_char () ...@@ -111,24 +108,33 @@ rl_callback_read_char ()
eof = readline_internal_char (); eof = readline_internal_char ();
if (rl_done) /* We loop in case some function has pushed input back with rl_execute_next. */
for (;;)
{ {
line = readline_internal_teardown (eof); if (rl_done)
{
line = readline_internal_teardown (eof);
(*rl_deprep_term_function) (); (*rl_deprep_term_function) ();
#if defined (HANDLE_SIGNALS) #if defined (HANDLE_SIGNALS)
rl_clear_signals (); rl_clear_signals ();
#endif #endif
in_handler = 0; in_handler = 0;
(*rl_linefunc) (line); (*rl_linefunc) (line);
/* If the user did not clear out the line, do it for him. */ /* If the user did not clear out the line, do it for him. */
if (rl_line_buffer[0]) if (rl_line_buffer[0])
_rl_init_line_state (); _rl_init_line_state ();
/* Redisplay the prompt if readline_handler_{install,remove} not called. */ /* Redisplay the prompt if readline_handler_{install,remove}
if (in_handler == 0 && rl_linefunc) not called. */
_rl_callback_newline (); if (in_handler == 0 && rl_linefunc)
_rl_callback_newline ();
}
if (rl_pending_input)
eof = readline_internal_char ();
else
break;
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
The GNU Readline Library is free software; you can redistribute it The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 1, or as published by the Free Software Foundation; either version 2, or
(at your option) any later version. (at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be The GNU Readline Library is distributed in the hope that it will be
...@@ -18,21 +18,23 @@ ...@@ -18,21 +18,23 @@
The GNU General Public License is often shipped with GNU software, and 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 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, have a copy of the license, write to the Free Software Foundation,
675 Mass Ave, Cambridge, MA 02139, USA. */ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _CHARDEFS_H_ #ifndef _CHARDEFS_H_
#define _CHARDEFS_H_ #define _CHARDEFS_H_
#ifndef _m_ctype_h
#include <ctype.h> #include <ctype.h>
#endif
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# if defined (HAVE_STRING_H) # if defined (HAVE_STRING_H)
# if ! defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
# include <memory.h>
# endif
# include <string.h> # include <string.h>
# else
# include <strings.h>
# endif /* HAVE_STRING_H */ # endif /* HAVE_STRING_H */
# if defined (HAVE_STRINGS_H)
# include <strings.h>
# endif /* HAVE_STRINGS_H */
#else #else
# include <string.h> # include <string.h>
#endif /* !HAVE_CONFIG_H */ #endif /* !HAVE_CONFIG_H */
...@@ -42,7 +44,10 @@ ...@@ -42,7 +44,10 @@
#endif #endif
#ifdef CTRL #ifdef CTRL
#undef CTRL # undef CTRL
#endif
#ifdef UNCTRL
# undef UNCTRL
#endif #endif
/* Some character stuff. */ /* Some character stuff. */
...@@ -53,7 +58,7 @@ ...@@ -53,7 +58,7 @@
#define meta_character_bit 0x080 /* x0000000, must be on. */ #define meta_character_bit 0x080 /* x0000000, must be on. */
#define largest_char 255 /* Largest character value. */ #define largest_char 255 /* Largest character value. */
#define CTRL_CHAR(c) ((c) < control_character_threshold && (c) >= 0) #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
#define CTRL(c) ((c) & control_character_mask) #define CTRL(c) ((c) & control_character_mask)
...@@ -62,32 +67,58 @@ ...@@ -62,32 +67,58 @@
#define UNMETA(c) ((c) & (~meta_character_bit)) #define UNMETA(c) ((c) & (~meta_character_bit))
#define UNCTRL(c) _rl_to_upper(((c)|control_character_bit)) #define UNCTRL(c) _rl_to_upper(((c)|control_character_bit))
/* Old versions #if defined STDC_HEADERS || (!defined (isascii) && !defined (HAVE_ISASCII))
#define _rl_lowercase_p(c) (((c) > ('a' - 1) && (c) < ('z' + 1))) # define IN_CTYPE_DOMAIN(c) 1
#define _rl_uppercase_p(c) (((c) > ('A' - 1) && (c) < ('Z' + 1))) #else
#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9') # define IN_CTYPE_DOMAIN(c) isascii(c)
*/ #endif
#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT)
# define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
#endif
#define NON_NEGATIVE(c) ((unsigned char)(c) == (c))
#define _rl_lowercase_p(c) (islower(c)) /* Some systems define these; we want our definitions. */
#define _rl_uppercase_p(c) (isupper(c)) #undef ISPRINT
#define _rl_digit_p(x) (isdigit (x))
#define _rl_pure_alphabetic(c) (_rl_lowercase_p(c) || _rl_uppercase_p(c)) #define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
#define ALPHABETIC(c) (_rl_lowercase_p(c) || _rl_uppercase_p(c) || _rl_digit_p(c)) #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
/* Old versions #define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
# define _rl_to_upper(c) (_rl_lowercase_p(c) ? ((c) - 32) : (c)) #define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
# define _rl_to_lower(c) (_rl_uppercase_p(c) ? ((c) + 32) : (c)) #define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
*/
#define _rl_pure_alphabetic(c) (NON_NEGATIVE(c) && ISALPHA(c))
#define ALPHABETIC(c) (NON_NEGATIVE(c) && ISALNUM(c))
#ifndef _rl_to_upper #ifndef _rl_to_upper
# define _rl_to_upper(c) (islower(c) ? toupper(c) : (c)) # define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)c) : (c))
# define _rl_to_lower(c) (isupper(c) ? tolower(c) : (c)) # define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)c) : (c))
#endif #endif
#ifndef _rl_digit_value #ifndef _rl_digit_value
#define _rl_digit_value(x) ((x) - '0') # define _rl_digit_value(x) ((x) - '0')
#endif
#ifndef _rl_isident
# define _rl_isident(c) (ISALNUM(c) || (c) == '_')
#endif
#ifndef ISOCTAL
# define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
#endif #endif
#define OCTVALUE(c) ((c) - '0')
#define HEXVALUE(c) \
(((c) >= 'a' && (c) <= 'f') \
? (c)-'a'+10 \
: (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0')
#ifndef NEWLINE #ifndef NEWLINE
#define NEWLINE '\n' #define NEWLINE '\n'
...@@ -125,18 +156,4 @@ ...@@ -125,18 +156,4 @@
#endif #endif
#define ESC CTRL('[') #define ESC CTRL('[')
#ifndef ISOCTAL
#define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
#endif
#define OCTVALUE(c) ((c) - '0')
#ifndef isxdigit
# define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
#endif
#define HEXVALUE(c) \
(((c) >= 'a' && (c) <= 'f') \
? (c)-'a'+10 \
: (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0')
#endif /* _CHARDEFS_H_ */ #endif /* _CHARDEFS_H_ */
This diff is collapsed.
This diff is collapsed.
...@@ -4,34 +4,49 @@ dnl ...@@ -4,34 +4,49 @@ dnl
dnl report bugs to chet@po.cwru.edu dnl report bugs to chet@po.cwru.edu
dnl dnl
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION) AC_REVISION([for Readline 4.3, version 2.45, from autoconf version] AC_ACVERSION)
LIBVERSION=4.0
AC_INIT(readline.h) AC_INIT(readline, 4.3, bug-readline@gnu.org)
AC_CONFIG_HEADER(config.h)
dnl make sure we are using a recent autoconf version dnl make sure we are using a recent autoconf version
AC_PREREQ(2.10) AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(readline.h)
AC_CONFIG_AUX_DIR(./support) AC_CONFIG_AUX_DIR(./support)
AC_CONFIG_HEADERS(config.h)
dnl update the value of RL_READLINE_VERSION in readline.h when this changes
LIBVERSION=4.3
AC_CANONICAL_HOST AC_CANONICAL_HOST
dnl configure defaults dnl configure defaults
opt_curses=no opt_curses=no
opt_shared=no
dnl arguments to configure dnl arguments to configure
AC_ARG_WITH(curses, --with-curses use the curses library instead of the termcap library,opt_curses=$withval) AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
if test "$opt_curses" = "yes"; then if test "$opt_curses" = "yes"; then
prefer_curses=yes prefer_curses=yes
fi fi
dnl option parsing for optional features
opt_static_libs=yes
opt_shared_libs=yes
AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
echo ""
echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
echo ""
# We want these before the checks, so the checks can modify their values. # We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_MAKE_SET
AC_PROG_CC AC_PROG_CC
dnl AC_AIX
AC_MINIX AC_MINIX
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
...@@ -39,7 +54,7 @@ test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" ...@@ -39,7 +54,7 @@ test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL AC_PROG_INSTALL
AC_CHECK_PROG(AR, ar, ar) AC_CHECK_PROG(AR, ar, , ar)
dnl Set default for ARFLAGS, since autoconf does not have a macro for it. dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
dnl This allows people to set it when running configure or make dnl This allows people to set it when running configure or make
test -n "$ARFLAGS" || ARFLAGS="cr" test -n "$ARFLAGS" || ARFLAGS="cr"
...@@ -48,32 +63,42 @@ AC_PROG_RANLIB ...@@ -48,32 +63,42 @@ AC_PROG_RANLIB
MAKE_SHELL=/bin/sh MAKE_SHELL=/bin/sh
AC_SUBST(MAKE_SHELL) AC_SUBST(MAKE_SHELL)
AC_RETSIGTYPE AC_C_CONST
AC_C_PROTOTYPES
AC_C_CHAR_UNSIGNED
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, int)
AC_HEADER_STAT AC_HEADER_STAT
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat) AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit)
AC_FUNC_STRCOLL AC_FUNC_STRCOLL
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \ AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
sys/ptem.h sys/pte.h sys/stream.h sys/select.h \ limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
termcap.h termios.h termio.h sys/file.h locale.h) termcap.h termios.h termio.h sys/file.h locale.h memory.h )
BASH_SIGNAL_CHECK BASH_SYS_SIGNAL_VINTAGE
BASH_REINSTALL_SIGHANDLERS BASH_SYS_REINSTALL_SIGHANDLERS
BASH_FUNC_POSIX_SETJMP BASH_FUNC_POSIX_SETJMP
BASH_FUNC_LSTAT BASH_FUNC_LSTAT
BASH_CHECK_GETPW_FUNCS
BASH_FUNC_STRCOLL BASH_FUNC_STRCOLL
BASH_CHECK_GETPW_FUNCS
AC_HEADER_TIOCGWINSZ
BASH_TYPE_SIGHANDLER BASH_TYPE_SIGHANDLER
BASH_HAVE_TIOCGWINSZ
BASH_HAVE_TIOCSTAT BASH_HAVE_TIOCSTAT
BASH_HAVE_FIONREAD BASH_HAVE_FIONREAD
BASH_MISC_SPEED_T BASH_CHECK_SPEED_T
BASH_STRUCT_WINSIZE BASH_STRUCT_WINSIZE
BASH_STRUCT_DIRENT_D_INO BASH_STRUCT_DIRENT_D_INO
BASH_STRUCT_DIRENT_D_FILENO BASH_STRUCT_DIRENT_D_FILENO
...@@ -84,11 +109,18 @@ aix*) prefer_curses=yes ;; ...@@ -84,11 +109,18 @@ aix*) prefer_curses=yes ;;
esac esac
BASH_CHECK_LIB_TERMCAP BASH_CHECK_LIB_TERMCAP
if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
TERMCAP_LIB=-ltermcap #default if test "$prefer_curses" = yes; then
TERMCAP_LIB=-lcurses
else
TERMCAP_LIB=-ltermcap #default
fi
fi fi
BASH_CHECK_MULTIBYTE
case "$host_cpu" in case "$host_cpu" in
*cray*) LOCAL_CFLAGS=-DCRAY ;; *cray*) LOCAL_CFLAGS=-DCRAY ;;
*s390*) LOCAL_CFLAGS=-fsigned-char ;;
esac esac
case "$host_os" in case "$host_os" in
...@@ -102,7 +134,7 @@ esac ...@@ -102,7 +134,7 @@ esac
# #
if test -f ${srcdir}/support/shobj-conf; then if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries) 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_CC)
AC_SUBST(SHOBJ_CFLAGS) AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD) AC_SUBST(SHOBJ_LD)
...@@ -116,9 +148,40 @@ if test -f ${srcdir}/support/shobj-conf; then ...@@ -116,9 +148,40 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_SUBST(SHLIB_LIBVERSION) AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_LIBS) AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS) AC_MSG_RESULT($SHLIB_STATUS)
# SHLIB_STATUS is either `supported' or `unsupported'. If it's
# `unsupported', turn off any default shared library building
if test "$SHLIB_STATUS" = 'unsupported'; then
opt_shared_libs=no
fi
# 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
if test "$opt_static_libs" = "yes"; then
STATIC_TARGET=static
STATIC_INSTALL_TARGET=install-static
fi
if test "$opt_shared_libs" = "yes"; then
SHARED_TARGET=shared
SHARED_INSTALL_TARGET=install-shared
fi fi
BUILD_DIR=`pwd` AC_SUBST(STATIC_TARGET)
AC_SUBST(SHARED_TARGET)
AC_SUBST(STATIC_INSTALL_TARGET)
AC_SUBST(SHARED_INSTALL_TARGET)
case "$host_os" in
msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
*) BUILD_DIR=`pwd` ;;
esac
AC_SUBST(BUILD_DIR) AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS) AC_SUBST(CFLAGS)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
The Library is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
The Library is distributed in the hope that it will be useful, but The Library is distributed in the hope that it will be useful, but
...@@ -17,27 +17,24 @@ ...@@ -17,27 +17,24 @@
The GNU General Public License is often shipped with GNU software, and 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 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, have a copy of the license, write to the Free Software Foundation,
675 Mass Ave, Cambridge, MA 02139, USA. */ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_HISTLIB_H_) #if !defined (_HISTLIB_H_)
#define _HISTLIB_H_ #define _HISTLIB_H_
/* Function pointers can be declared as (Function *)foo. */ #if defined (HAVE_STRING_H)
#if !defined (_FUNCTION_DEF) # include <string.h>
# define _FUNCTION_DEF #else
typedef int Function (); # include <strings.h>
typedef void VFunction (); #endif /* !HAVE_STRING_H */
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 STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
#define STREQN(a, b, n) (((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0)) #define STREQN(a, b, n) (((n) == 0) ? (1) \
: ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
#endif
#ifndef savestring #ifndef savestring
# ifndef strcpy
extern char *strcpy ();
# endif
#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x)) #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
#endif #endif
...@@ -79,4 +76,7 @@ extern char *strchr (); ...@@ -79,4 +76,7 @@ extern char *strchr ();
#define HISTORY_APPEND 0 #define HISTORY_APPEND 0
#define HISTORY_OVERWRITE 1 #define HISTORY_OVERWRITE 1
/* Some variable definitions shared across history source files. */
extern int history_offset;
#endif /* !_HISTLIB_H_ */ #endif /* !_HISTLIB_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment