mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
New functionality to my_getopt. myisamchk now uses my_getopt
only. include/my_getopt.h: Added u_max_value as for user definable maximum value for a variable in my_getopt. myisam/myisamchk.c: myisamchk now uses my_getopt struct for variables also. Variables can be set with -O var=val, --set-variable=var=val and --variable=val now. mysys/getvar.c: my_set_changeable_var moved to my_getopt.c mysys/my_getopt.c: Added special prefix --maximum[-variable-name=...] for user definable maximum values for variables, among other things.
This commit is contained in:
@ -23,14 +23,15 @@ struct my_optarg
|
||||
};
|
||||
|
||||
|
||||
enum get_opt_var_type { GET_NO_ARG, GET_INT, GET_LL, GET_STR };
|
||||
enum get_opt_var_type { GET_NO_ARG, GET_LONG, GET_LL, GET_STR };
|
||||
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
|
||||
|
||||
struct my_option
|
||||
{
|
||||
const char *name; /* Name of the option */
|
||||
const char *comment; /* option comment, for autom. --help */
|
||||
char *value; /* The variable value */
|
||||
gptr *value; /* The variable value */
|
||||
gptr *u_max_value; /* The user def. max variable value */
|
||||
const char **str_values; /* Pointer to possible values */
|
||||
enum get_opt_var_type var_type;
|
||||
enum get_opt_arg_type arg_type;
|
||||
@ -41,6 +42,6 @@ struct my_option
|
||||
longlong sub_size; /* Subtract this from given value */
|
||||
long block_size; /* Value should be a mult. of this */
|
||||
int app_type; /* To be used by an application */
|
||||
my_bool changeable_var; /* If true, the option is a variable */
|
||||
my_bool opt_is_var; /* If true, the option is a variable */
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user