13
13
along with this program; if not, write to the Free Software
14
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#ifndef DRIZZLED_MY_GETOPT_H
17
#define DRIZZLED_MY_GETOPT_H
19
#include "drizzled/typelib.h"
21
21
#define GET_NO_ARG 1
32
32
#define GET_ENUM 12
34
34
#define GET_DOUBLE 14
37
#define GET_ULONG_IS_FAIL 17
36
39
#define GET_ASK_ADDR 128
37
40
#define GET_TYPE_MASK 127
39
#include <mysys/my_sys.h>
41
53
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
63
75
typedef bool (* my_get_one_option) (int, const struct my_option *, char * );
64
76
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
77
typedef char ** (*getopt_get_addr_func)(const char *, uint32_t, const struct my_option *);
66
79
extern char *disabled_my_option;
67
extern bool my_getopt_print_errors;
68
80
extern bool my_getopt_skip_unknown;
69
81
extern my_error_reporter my_getopt_error_reporter;
71
extern int handle_options (int *argc, char ***argv,
83
extern int handle_options (int *argc, char ***argv,
72
84
const struct my_option *longopts, my_get_one_option);
73
85
extern void my_cleanup_options(const struct my_option *options);
74
86
extern void my_print_help(const struct my_option *options);
75
87
extern void my_print_variables(const struct my_option *options);
76
extern void my_getopt_register_get_addr(char ** (*func_addr)(const char *, uint,
77
const struct my_option *));
79
89
uint64_t getopt_ull_limit_value(uint64_t num, const struct my_option *optp,
81
91
int64_t getopt_ll_limit_value(int64_t, const struct my_option *,
83
bool getopt_compare_strings(const char *s, const char *t, uint length);
87
#endif /* _my_getopt_h */
93
bool getopt_compare_strings(const char *s, const char *t, uint32_t length);
99
#endif /* DRIZZLED_MY_GETOPT_H */