summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <vva@genie.(none)>2002-11-19 18:26:53 +0400
committerunknown <vva@genie.(none)>2002-11-19 18:26:53 +0400
commit953f6c51fed3478cc3905d2ce15728e5c3e7f00c (patch)
tree6f25883717e7c6cfc40b292a86148e469567534c /client
parent0fb3b8d9abc3eb2e3072c2f8681099e7db0a256e (diff)
downloadmariadb-git-953f6c51fed3478cc3905d2ce15728e5c3e7f00c.tar.gz
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
Diffstat (limited to 'client')
-rw-r--r--client/completion_hash.cc6
-rw-r--r--client/completion_hash.h4
-rw-r--r--client/mysql.cc18
3 files changed, 14 insertions, 14 deletions
diff --git a/client/completion_hash.cc b/client/completion_hash.cc
index ff5d0b28e41..536e7f9373a 100644
--- a/client/completion_hash.cc
+++ b/client/completion_hash.cc
@@ -27,7 +27,7 @@
#include <my_sys.h>
#include "completion_hash.h"
-uint hashpjw(char *arKey, uint nKeyLength)
+uint hashpjw(const char *arKey, uint nKeyLength)
{
uint h = 0, g, i;
@@ -111,7 +111,7 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength,
return SUCCESS;
}
-static Bucket *completion_hash_find(HashTable *ht, char *arKey,
+static Bucket *completion_hash_find(HashTable *ht, const char *arKey,
uint nKeyLength)
{
uint h, nIndex;
@@ -156,7 +156,7 @@ int completion_hash_exists(HashTable *ht, char *arKey, uint nKeyLength)
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)
{
Bucket *b;
diff --git a/client/completion_hash.h b/client/completion_hash.h
index c0853fddfe7..2595a445c9d 100644
--- a/client/completion_hash.h
+++ b/client/completion_hash.h
@@ -43,14 +43,14 @@ typedef struct hashtable {
uint nTableSize;
uint initialized;
MEM_ROOT mem_root;
- uint(*pHashFunction) (char *arKey, uint nKeyLength);
+ uint(*pHashFunction) (const char *arKey, uint nKeyLength);
Bucket **arBuckets;
} HashTable;
extern int completion_hash_init(HashTable *ht, uint nSize);
extern int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, char *str);
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 void add_word(HashTable *ht,char *str);
extern void completion_hash_clean(HashTable *ht);
diff --git a/client/mysql.cc b/client/mysql.cc
index 241f4cf7ecc..391779ef801 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1049,8 +1049,8 @@ static bool add_line(String &buffer,char *line,char *in_string)
#ifdef HAVE_READLINE
-static char *new_command_generator(char *text, int);
-static char **new_mysql_completion (char *text, int start, int end);
+static char *new_command_generator(const char *text, int);
+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
@@ -1058,8 +1058,8 @@ static char **new_mysql_completion (char *text, int start, int end);
if not.
*/
-char **no_completion (char *text __attribute__ ((unused)),
- char *word __attribute__ ((unused)))
+char *no_completion (const char *text __attribute__ ((unused)),
+ int )
{
return 0; /* No filename completion */
}
@@ -1071,8 +1071,8 @@ static void initialize_readline (char *name)
/* Tell the completer that we want a crack first. */
/* rl_attempted_completion_function = (CPPFunction *)mysql_completion;*/
- rl_attempted_completion_function = (CPPFunction *) new_mysql_completion;
- rl_completion_entry_function=(Function *) no_completion;
+ rl_attempted_completion_function = &new_mysql_completion;
+ rl_completion_entry_function= &no_completion;
}
/*
@@ -1082,17 +1082,17 @@ static void initialize_readline (char *name)
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 end __attribute__((unused)))
{
if (!status.batch && !quick)
- return completion_matches(text, (CPFunction*) new_command_generator);
+ return rl_completion_matches(text, new_command_generator);
else
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;
char *ptr;