~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getopt.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

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