Go to the source code of this file.
Macros | |
#define | ARRAY_SIZE(a) |
Functions | |
static void | need_argument (const tw_optdef *def) |
static int | is_empty (const tw_optdef *def) |
static void | parse_args_file (const char *file_name, int *argc_p, char ***argv_p) |
void | tw_opt_add (const tw_optdef *options) |
static void | show_help (void) |
void | tw_opt_settings (FILE *outfile) |
void | tw_opt_print (void) |
char * | ltrim (char *s) |
char * | next_argument (char **line) |
static void | apply_opt (const tw_optdef *def, const char *value) |
static void | match_opt (const char *arg) |
void | tw_opt_parse (int *argc_p, char ***argv_p) |
Variables | |
static const char * | program |
static const tw_optdef * | all_groups [10] |
static const tw_optdef * | opt_groups [10] |
static unsigned int | opt_index = 0 |
static uint | args_file_depth = 0 |
static const tw_optdef | basic [] |
#define ARRAY_SIZE | ( | a | ) |
Definition at line 6 of file tw-opts.c.
Referenced by tw_opt_parse().
|
static |
Definition at line 327 of file tw-opts.c.
References args_file_depth, need_argument(), parse_args_file(), program, show_help(), tw_error(), tw_ismaster(), TW_LOC, tw_net_stop(), tw_opt_parse(), tw_warning(), TWOPTTYPE_ARGSFILE, TWOPTTYPE_CHAR, TWOPTTYPE_DOUBLE, TWOPTTYPE_FLAG, TWOPTTYPE_SHOWHELP, TWOPTTYPE_STIME, TWOPTTYPE_UINT, TWOPTTYPE_ULONG, TWOPTTYPE_ULONGLONG, tw_optdef::type, and tw_optdef::value.
Referenced by match_opt().
|
static |
Definition at line 496 of file tw-opts.c.
References TWOPTTYPE_GROUP, and tw_optdef::type.
Referenced by tw_opt_add(), and tw_opt_parse().
char * ltrim | ( | char * | s | ) |
Definition at line 296 of file tw-opts.c.
Referenced by parse_args_file().
|
static |
Definition at line 458 of file tw-opts.c.
References all_groups, apply_opt(), tw_optdef::name, program, tw_ismaster(), tw_net_stop(), TWOPTTYPE_GROUP, and tw_optdef::type.
Referenced by tw_opt_parse().
|
static |
Definition at line 285 of file tw-opts.c.
References tw_optdef::name, program, tw_ismaster(), and tw_net_stop().
Referenced by apply_opt().
char * next_argument | ( | char ** | line | ) |
Definition at line 304 of file tw-opts.c.
Referenced by parse_args_file().
|
static |
Definition at line 507 of file tw-opts.c.
References ltrim(), next_argument(), tw_error(), and TW_LOC.
Referenced by apply_opt().
|
static |
Definition at line 33 of file tw-opts.c.
References all_groups, tw_optdef::help, tw_optdef::name, program, TWOPTTYPE_CHAR, TWOPTTYPE_DOUBLE, TWOPTTYPE_FLAG, TWOPTTYPE_GROUP, TWOPTTYPE_STIME, TWOPTTYPE_UINT, TWOPTTYPE_ULONG, TWOPTTYPE_ULONGLONG, tw_optdef::type, and tw_optdef::value.
Referenced by apply_opt().
void tw_opt_add | ( | const tw_optdef * | options | ) |
Add an opt group
Definition at line 23 of file tw-opts.c.
References is_empty(), opt_groups, opt_index, and tw_optdef::type.
void tw_opt_parse | ( | int * | argc, |
char *** | argv ) |
Remove options from the command line arguments.
Definition at line 552 of file tw-opts.c.
References all_groups, ARRAY_SIZE, basic, is_empty(), match_opt(), opt_groups, program, tw_error(), and TW_LOC.
Referenced by apply_opt(), and tw_init().
void tw_opt_print | ( | void | ) |
Pretty-print the option descriptions (for –help)
Definition at line 224 of file tw-opts.c.
References all_groups, g_tw_csv, tw_optdef::name, tw_ismaster(), TWOPTTYPE_CHAR, TWOPTTYPE_DOUBLE, TWOPTTYPE_FLAG, TWOPTTYPE_GROUP, TWOPTTYPE_STIME, TWOPTTYPE_UINT, TWOPTTYPE_ULONG, TWOPTTYPE_ULONGLONG, tw_optdef::type, and tw_optdef::value.
void tw_opt_settings | ( | FILE * | f | ) |
Pretty-print the option descriptions and current values
Definition at line 147 of file tw-opts.c.
References all_groups, tw_optdef::help, tw_optdef::name, TWOPTTYPE_CHAR, TWOPTTYPE_DOUBLE, TWOPTTYPE_FLAG, TWOPTTYPE_GROUP, TWOPTTYPE_STIME, TWOPTTYPE_UINT, TWOPTTYPE_ULONG, TWOPTTYPE_ULONGLONG, tw_optdef::type, and tw_optdef::value.
Referenced by io_store_checkpoint().
|
static |
Definition at line 10 of file tw-opts.c.
Referenced by match_opt(), show_help(), tw_opt_parse(), tw_opt_print(), and tw_opt_settings().
|
static |
Definition at line 20 of file tw-opts.c.
Referenced by apply_opt().
|
static |
Definition at line 491 of file tw-opts.c.
Referenced by tw_opt_parse().
|
static |
Definition at line 16 of file tw-opts.c.
Referenced by tw_opt_add(), and tw_opt_parse().
|
static |
Definition at line 17 of file tw-opts.c.
Referenced by tw_opt_add().
|
static |
Definition at line 9 of file tw-opts.c.
Referenced by apply_opt(), match_opt(), need_argument(), show_help(), and tw_opt_parse().