diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-06-17 17:31:51 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-06-17 17:31:51 +0400 |
commit | cc6dabba377bd05bb9a6a9ffaa985bbe5e38bcc1 (patch) | |
tree | 9413ba739bc0dbf1e647293756a3503f17dcde07 /include | |
parent | 91a7b147056a228804f81726127035aa305702ff (diff) | |
parent | 45c7bf3c54fa852b312773688fdce15bffe49abf (diff) | |
download | mariadb-git-cc6dabba377bd05bb9a6a9ffaa985bbe5e38bcc1.tar.gz |
Merge trunk-bugfixing -> trunk-runtime
Diffstat (limited to 'include')
-rw-r--r-- | include/my_getopt.h | 21 | ||||
-rw-r--r-- | include/my_global.h | 4 | ||||
-rw-r--r-- | include/my_sys.h | 2 | ||||
-rw-r--r-- | include/sslopt-longopts.h | 20 |
4 files changed, 30 insertions, 17 deletions
diff --git a/include/my_getopt.h b/include/my_getopt.h index 54ae5982ea1..5eb0004e9c3 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -64,8 +64,8 @@ struct my_option if it's NULL the option is not visible in --help. */ - uchar **value; /**< A pointer to the variable value */ - uchar **u_max_value; /**< The user def. max variable value */ + void *value; /**< A pointer to the variable value */ + void *u_max_value; /**< The user def. max variable value */ struct st_typelib *typelib; /**< Pointer to possible values */ ulong var_type; /**< GET_BOOL, GET_ULL, etc */ enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ @@ -77,8 +77,18 @@ struct my_option void *app_type; /**< To be used by an application */ }; -typedef my_bool (*my_get_one_option) (int, const struct my_option *, char * ); -typedef void (*my_error_reporter) (enum loglevel level, const char *format, ... ); + +typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *); +typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...); +/** + Used to retrieve a reference to the object (variable) that holds the value + for the given option. For example, if var_type is GET_UINT, the function + must return a pointer to a variable of type uint. A argument is stored in + the location pointed to by the returned pointer. +*/ +typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *, + int *); + extern char *disabled_my_option; extern my_bool my_getopt_print_errors; @@ -90,8 +100,7 @@ extern int handle_options (int *argc, char ***argv, extern void my_cleanup_options(const struct my_option *options); extern void my_print_help(const struct my_option *options); extern void my_print_variables(const struct my_option *options); -extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint, - const struct my_option *, int *)); +extern void my_getopt_register_get_addr(my_getopt_value); ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, my_bool *fix); diff --git a/include/my_global.h b/include/my_global.h index c21a8a1f9ea..7b9c34cd724 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -60,6 +60,10 @@ #define USE_PRAGMA_INTERFACE #endif +#if defined(__OpenBSD__) && (OpenBSD >= 200411) +#define HAVE_ERRNO_AS_DEFINE +#endif + #if defined(i386) && !defined(__i386__) #define __i386__ #endif diff --git a/include/my_sys.h b/include/my_sys.h index cca4d713ca6..29c78289a1b 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -54,7 +54,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #include <malloc.h> /*for alloca*/ #endif -#define MY_INIT(name); { my_progname= name; my_init(); } +#define MY_INIT(name) { my_progname= name; my_init(); } /** Max length of an error message generated by mysys utilities. diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index 151287e1718..5315b2e12b1 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -20,30 +20,30 @@ {"ssl", OPT_SSL_SSL, "Enable SSL for connection (automatically enabled with other flags).", - (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, - 0, 0, 0}, + &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-ca", OPT_SSL_CA, "CA file in PEM format (check OpenSSL docs, implies --ssl).", - (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-capath", OPT_SSL_CAPATH, "CA directory (check OpenSSL docs, implies --ssl).", - (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).", - (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).", - (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).", - (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef MYSQL_CLIENT {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, - "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.", - (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert, - 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, + "Verify server's \"Common Name\" in its cert against hostname used " + "when connecting. This option is disabled by default.", + &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif #endif /* HAVE_OPENSSL */ #endif /* SSLOPT_LONGOPTS_INCLUDED */ |