More cleanup from import of readline 4.3.
* completer.h (complete_line, readline_line_completion_function):
Update prototypes.
(line_completion_function): Removed, not used outside of completer.c.
* completer.c (readline_line_completion_function,
complete_function, line_completion_function): Use const for first
parameter.
(line_completion_function): Make static.
(filename_completer): filename_completion_function is now called
rl_filename_completion_function
* corelow.c: Include <readline/readline.h>.
* exec.c: Ditto.
* solib.c: Ditto.
* source.c: Ditto.
* symfile.c: Ditto.
* symmisc.c: Ditto.
* top.c (init_main): No need to coerce
readline_line_completion_function anymore.
* cli/cli-dump.c: Include <readline/readline.h>.
+2002-12-08 Elena Zannoni <ezannoni@redhat.com>
+
+ More cleanup from import of readline 4.3.
+ * completer.h (complete_line, readline_line_completion_function):
+ Update prototypes.
+ (line_completion_function): Removed, not used outside of completer.c.
+ * completer.c (readline_line_completion_function,
+ complete_function, line_completion_function): Use const for first
+ parameter.
+ (line_completion_function): Make static.
+ (filename_completer): filename_completion_function is now called
+ rl_filename_completion_function
+ * corelow.c: Include <readline/readline.h>.
+ * exec.c: Ditto.
+ * solib.c: Ditto.
+ * source.c: Ditto.
+ * symfile.c: Ditto.
+ * symmisc.c: Ditto.
+ * top.c (init_main): No need to coerce
+ readline_line_completion_function anymore.
+ * cli/cli-dump.c: Include <readline/readline.h>.
+
2002-12-08 Andrew Cagney <ac131313@redhat.com>
* stack.c (frame_info): Use get_prev_frame.
#include "gdb_assert.h"
#include <ctype.h>
#include "target.h"
+#include <readline/readline.h>
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
#include "gdbcmd.h"
/* Needed for rl_completer_word_break_characters() and for
- filename_completion_function. */
+ rl_filename_completion_function. */
#include <readline/readline.h>
/* readline defines this. */
#include "completer.h"
/* Prototypes for local functions */
-char *line_completion_function (char *text, int matches, char *line_buffer,
+static
+char *line_completion_function (const char *text, int matches, char *line_buffer,
int point);
/* readline uses the word breaks for two things:
/* Line completion interface function for readline. */
char *
-readline_line_completion_function (char *text, int matches)
+readline_line_completion_function (const char *text, int matches)
{
return line_completion_function (text, matches, rl_line_buffer, rl_point);
}
while (1)
{
char *p;
- p = filename_completion_function (text, subsequent_name);
+ p = rl_filename_completion_function (text, subsequent_name);
if (return_val_used >= return_val_alloced)
{
return_val_alloced *= 2;
should pretend that the line ends at POINT. */
char **
-complete_line (char *text, char *line_buffer, int point)
+complete_line (const char *text, char *line_buffer, int point)
{
char **list = NULL;
char *tmp_command, *p;
which is a possible completion, it is the caller's responsibility to
free the string. */
-char *
-line_completion_function (char *text, int matches, char *line_buffer, int point)
+static char *
+line_completion_function (const char *text, int matches, char *line_buffer, int point)
{
static char **list = (char **) NULL; /* Cache of completions */
static int index; /* Next cached completion */
#if !defined (COMPLETER_H)
#define COMPLETER_H 1
-extern char **complete_line (char *text, char *line_buffer, int point);
+extern char **complete_line (const char *text, char *line_buffer, int point);
-extern char *line_completion_function (char *, int, char *, int);
-
-extern char *readline_line_completion_function (char *text, int matches);
+extern char *readline_line_completion_function (const char *text, int matches);
extern char **noop_completer (char *, char *);
#include "gdbthread.h"
#include "regcache.h"
#include "symfile.h"
+#include <readline/readline.h>
#ifndef O_BINARY
#define O_BINARY 0
#endif
#include <fcntl.h>
+#include <readline/readline.h>
#include "gdb_string.h"
#include "gdbcore.h"
#include "filenames.h" /* for DOSish file names */
#include "solist.h"
+#include <readline/readline.h>
/* external data declarations */
#include "filenames.h" /* for DOSish file names */
#include "completer.h"
#include "ui-out.h"
+#include <readline/readline.h>
#ifdef CRLF_SOURCE_FILES
#include "gdb_obstack.h"
#include "completer.h"
#include "bcache.h"
+#include <readline/readline.h>
#include <sys/types.h>
#include <fcntl.h>
#include "bcache.h"
#include "gdb_string.h"
+#include <readline/readline.h>
#ifndef DEV_TTY
#define DEV_TTY "/dev/tty"
write_history_p = 0;
/* Setup important stuff for command line editing. */
- rl_completion_entry_function = (int (*)()) readline_line_completion_function;
+ rl_completion_entry_function = readline_line_completion_function;
rl_completer_word_break_characters =
get_gdb_completer_word_break_characters ();
rl_completer_quote_characters = get_gdb_completer_quote_characters ();