67
65
typedef bool (* my_get_one_option) (int, const struct my_option *, char * );
68
66
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
69
typedef char ** (*getopt_get_addr_func)(const char *, uint32_t, const struct my_option *);
71
68
extern char *disabled_my_option;
72
69
extern bool my_getopt_print_errors;
73
70
extern bool my_getopt_skip_unknown;
74
71
extern my_error_reporter my_getopt_error_reporter;
75
void default_reporter(enum loglevel level, const char *format, ...);
77
extern int handle_options (int *argc, char ***argv,
73
extern int handle_options (int *argc, char ***argv,
78
74
const struct my_option *longopts, my_get_one_option);
79
75
extern void my_cleanup_options(const struct my_option *options);
80
76
extern void my_print_help(const struct my_option *options);
81
77
extern void my_print_variables(const struct my_option *options);
82
extern void my_getopt_register_get_addr(getopt_get_addr_func func_addr);
78
extern void my_getopt_register_get_addr(char ** (*func_addr)(const char *, uint,
79
const struct my_option *));
84
81
uint64_t getopt_ull_limit_value(uint64_t num, const struct my_option *optp,