49
47
const char *name; /* Name of the option */
50
48
int id; /* unique id or short option */
51
49
const char *comment; /* option comment, for autom. --help */
52
char **value; /* The variable value */
53
char **u_max_value; /* The user def. max variable value */
50
uchar **value; /* The variable value */
51
uchar **u_max_value; /* The user def. max variable value */
54
52
struct st_typelib *typelib; /* Pointer to possible values */
56
54
enum get_opt_arg_type arg_type;
57
int64_t def_value; /* Default value */
58
int64_t min_value; /* Min allowed value */
59
int64_t max_value; /* Max allowed value */
60
int64_t sub_size; /* Subtract this from given value */
55
longlong def_value; /* Default value */
56
longlong min_value; /* Min allowed value */
57
longlong max_value; /* Max allowed value */
58
longlong sub_size; /* Subtract this from given value */
61
59
long block_size; /* Value should be a mult. of this */
62
60
void *app_type; /* To be used by an application */
65
typedef bool (* my_get_one_option) (int, const struct my_option *, char * );
63
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
66
64
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
68
66
extern char *disabled_my_option;
69
extern bool my_getopt_print_errors;
70
extern bool my_getopt_skip_unknown;
67
extern my_bool my_getopt_print_errors;
68
extern my_bool my_getopt_skip_unknown;
71
69
extern my_error_reporter my_getopt_error_reporter;
73
71
extern int handle_options (int *argc, char ***argv,
75
73
extern void my_cleanup_options(const struct my_option *options);
76
74
extern void my_print_help(const struct my_option *options);
77
75
extern void my_print_variables(const struct my_option *options);
78
extern void my_getopt_register_get_addr(char ** (*func_addr)(const char *, uint,
79
const struct my_option *));
81
uint64_t getopt_ull_limit_value(uint64_t num, const struct my_option *optp,
83
int64_t getopt_ll_limit_value(int64_t, const struct my_option *,
85
bool getopt_compare_strings(const char *s, const char *t, uint32_t length);
76
extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
77
const struct my_option *));
79
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
81
longlong getopt_ll_limit_value(longlong, const struct my_option *,
83
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
91
87
#endif /* _my_getopt_h */