~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getopt.h

  • Committer: Stewart Smith
  • Date: 2009-06-16 03:02:59 UTC
  • mto: This revision was merged to the branch mainline in revision 1065.
  • Revision ID: stewart@flamingspork.com-20090616030259-tn2thqrajk6cappd
ER_NISAMCHK is unused, mark it as so. Thanks to Paul DuBois for researching this for MySQL.

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
 
19
21
#define GET_NO_ARG     1
20
22
#define GET_BOOL       2
21
23
#define GET_INT        3
22
24
#define GET_UINT       4
23
25
#define GET_LONG       5
24
 
#define GET_ULONG      6
 
26
#define GET_UINT32     6
25
27
#define GET_LL         7
26
28
#define GET_ULL        8
27
29
#define GET_STR        9
30
32
#define GET_ENUM      12
31
33
#define GET_SET       13
32
34
#define GET_DOUBLE    14
 
35
#define GET_SIZE      15
 
36
#define GET_UINT64    16
 
37
#define GET_ULONG_IS_FAIL 17
33
38
 
34
39
#define GET_ASK_ADDR     128
35
40
#define GET_TYPE_MASK    127
36
41
 
 
42
 
37
43
#ifdef __cplusplus
38
44
extern "C" {
39
45
#endif
40
46
 
41
 
#include <mysys/my_sys.h>
42
 
 
43
47
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
44
48
 
45
49
struct st_typelib;
64
68
 
65
69
typedef bool (* my_get_one_option) (int, const struct my_option *, char * );
66
70
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
 
71
typedef char ** (*getopt_get_addr_func)(const char *, uint32_t, const struct my_option *);
67
72
 
68
73
extern char *disabled_my_option;
69
74
extern bool my_getopt_print_errors;
70
75
extern bool my_getopt_skip_unknown;
71
76
extern my_error_reporter my_getopt_error_reporter;
 
77
void default_reporter(enum loglevel level, const char *format, ...);
72
78
 
73
 
extern int handle_options (int *argc, char ***argv, 
 
79
extern int handle_options (int *argc, char ***argv,
74
80
                           const struct my_option *longopts, my_get_one_option);
75
81
extern void my_cleanup_options(const struct my_option *options);
76
82
extern void my_print_help(const struct my_option *options);
77
83
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 *));
 
84
extern void my_getopt_register_get_addr(getopt_get_addr_func func_addr);
80
85
 
81
86
uint64_t getopt_ull_limit_value(uint64_t num, const struct my_option *optp,
82
87
                                 bool *fix);