diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 10 | ||||
-rw-r--r-- | client/mysqltest.cc | 30 |
2 files changed, 25 insertions, 15 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 4a7a8f0e58c..45fabe9cf8c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2316,8 +2316,10 @@ static bool add_line(String &buffer,char *line,char *in_string, #ifdef HAVE_READLINE +C_MODE_START static char *new_command_generator(const char *text, int); -extern "C" char **new_mysql_completion (const char *text, int start, int end); +static char **new_mysql_completion(const char *text, int start, int end); +C_MODE_END /* Tell the GNU Readline library how to complete. We want to try to complete @@ -2449,9 +2451,9 @@ static void initialize_readline (char *name) array of matches, or NULL if there aren't any. */ -char **new_mysql_completion (const char *text, - int start __attribute__((unused)), - int end __attribute__((unused))) +static char **new_mysql_completion(const char *text, + int start __attribute__((unused)), + int end __attribute__((unused))) { if (!status.batch && !quick) #if defined(USE_NEW_READLINE_INTERFACE) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 24d520ff97f..d0c948e67bb 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -77,6 +77,12 @@ static int setenv(const char *name, const char *value, int overwrite); #endif +C_MODE_START +static sig_handler signal_handler(int sig); +static my_bool get_one_option(int optid, const struct my_option *, + char *argument); +C_MODE_END + enum { OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, @@ -462,7 +468,6 @@ void log_msg(const char *fmt, ...) VAR* var_from_env(const char *, const char *); VAR* var_init(VAR* v, const char *name, int name_len, const char *val, int val_len); -void var_free(void* v); VAR* var_get(const char *var_name, const char** var_name_end, my_bool raw, my_bool ignore_not_existing); void eval_expr(VAR* v, const char *p, const char** p_end); @@ -1914,6 +1919,8 @@ static void strip_parentheses(struct st_command *command) } +C_MODE_START + static uchar *get_var_key(const uchar* var, size_t *len, my_bool __attribute__((unused)) t) { @@ -1924,6 +1931,16 @@ static uchar *get_var_key(const uchar* var, size_t *len, } +static void var_free(void *v) +{ + my_free(((VAR*) v)->str_val, MYF(MY_WME)); + if (((VAR*)v)->alloced) + my_free(v, MYF(MY_WME)); +} + +C_MODE_END + + VAR *var_init(VAR *v, const char *name, int name_len, const char *val, int val_len) { @@ -1966,14 +1983,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, } -void var_free(void *v) -{ - my_free(((VAR*) v)->str_val, MYF(MY_WME)); - if (((VAR*)v)->alloced) - my_free(v, MYF(MY_WME)); -} - - VAR* var_from_env(const char *name, const char *def_val) { const char *tmp; @@ -6070,8 +6079,7 @@ void read_embedded_server_arguments(const char *name) static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument) +get_one_option(int optid, const struct my_option *, char *argument) { switch(optid) { case '#': |