From c4f1ced9f16f6e58a469e24a592ee32d6bef05c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Jan 2002 05:08:17 +0200 Subject: 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. --- include/my_getopt.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/my_getopt.h') diff --git a/include/my_getopt.h b/include/my_getopt.h index fef8aacd75a..8321ad4cd1c 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -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 */ }; -- cgit v1.2.1