~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getopt.h

  • Committer: Brian Aker
  • Date: 2009-02-05 10:38:55 UTC
  • Revision ID: brian@tangent.org-20090205103855-wajzccrbu7zbvmh4
Reworked some classes out of session.h
Also updated ignore file.

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
30
32
#define GET_ENUM      12
31
33
#define GET_SET       13
32
34
#define GET_DOUBLE    14
 
35
#define GET_SIZE      15
33
36
 
34
37
#define GET_ASK_ADDR     128
35
38
#define GET_TYPE_MASK    127
36
39
 
 
40
 
37
41
#ifdef __cplusplus
38
42
extern "C" {
39
43
#endif
40
44
 
41
 
#include <mysys/my_sys.h>
42
 
 
43
45
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
44
46
 
45
47
struct st_typelib;
64
66
 
65
67
typedef bool (* my_get_one_option) (int, const struct my_option *, char * );
66
68
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 *);
67
70
 
68
71
extern char *disabled_my_option;
69
72
extern bool my_getopt_print_errors;
70
73
extern bool my_getopt_skip_unknown;
71
74
extern my_error_reporter my_getopt_error_reporter;
 
75
void default_reporter(enum loglevel level, const char *format, ...);
72
76
 
73
 
extern int handle_options (int *argc, char ***argv, 
 
77
extern int handle_options (int *argc, char ***argv,
74
78
                           const struct my_option *longopts, my_get_one_option);
75
79
extern void my_cleanup_options(const struct my_option *options);
76
80
extern void my_print_help(const struct my_option *options);
77
81
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 *));
 
82
extern void my_getopt_register_get_addr(getopt_get_addr_func func_addr);
80
83
 
81
84
uint64_t getopt_ull_limit_value(uint64_t num, const struct my_option *optp,
82
85
                                 bool *fix);