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