~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getopt.h

  • Committer: Monty Taylor
  • Date: 2008-10-27 23:19:48 UTC
  • mto: (520.4.12 merge-innodb-plugin)
  • mto: This revision was merged to the branch mainline in revision 563.
  • Revision ID: monty@inaugust.com-20081027231948-3kl6ss04plbakqcr
Split some more things out of common_includes.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#ifndef _my_getopt_h
17
17
#define _my_getopt_h
18
18
 
19
 
#include <mysys/my_sys.h>
20
 
 
21
19
#define GET_NO_ARG     1
22
20
#define GET_BOOL       2
23
21
#define GET_INT        3
32
30
#define GET_ENUM      12
33
31
#define GET_SET       13
34
32
#define GET_DOUBLE    14
35
 
#define GET_SIZE      15
36
33
 
37
34
#define GET_ASK_ADDR     128
38
35
#define GET_TYPE_MASK    127
39
36
 
40
 
 
41
37
#ifdef __cplusplus
42
38
extern "C" {
43
39
#endif
44
40
 
 
41
#include <mysys/my_sys.h>
 
42
 
45
43
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
46
44
 
47
45
struct st_typelib;
66
64
 
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 *);
70
67
 
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, ...);
76
72
 
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 *));
83
80
 
84
81
uint64_t getopt_ull_limit_value(uint64_t num, const struct my_option *optp,
85
82
                                 bool *fix);