Go to the source code of this file.
Data Structures | |
struct | tw_optdef |
Macros | |
#define | TWOPT_GROUP(h) { TWOPTTYPE_GROUP, NULL, (h), NULL } |
#define | TWOPT_ULONG(n, v, h) { TWOPTTYPE_ULONG, (n), (h), &(v) } |
#define | TWOPT_ULONGLONG(n, v, h) { TWOPTTYPE_ULONGLONG, (n), (h), &(v) } |
#define | TWOPT_UINT(n, v, h) { TWOPTTYPE_UINT, (n), (h), &(v) } |
#define | TWOPT_STIME(n, v, h) { TWOPTTYPE_STIME, (n), (h), &(v) } |
#define | TWOPT_DOUBLE(n, v, h) { TWOPTTYPE_DOUBLE, (n), (h), &(v) } |
#define | TWOPT_CHAR(n, v, h) { TWOPTTYPE_CHAR, (n), (h), &(v) } |
#define | TWOPT_FLAG(n, v, h) { TWOPTTYPE_FLAG, (n), (h), &(v) } |
#define | TWOPT_END() { (tw_opttype)0, NULL, NULL, NULL } |
Typedefs | |
typedef enum tw_opttype | tw_opttype |
typedef struct tw_optdef | tw_optdef |
Enumerations | |
enum | tw_opttype { TWOPTTYPE_GROUP = 1, TWOPTTYPE_ULONG, TWOPTTYPE_ULONGLONG, TWOPTTYPE_UINT, TWOPTTYPE_STIME, TWOPTTYPE_DOUBLE, TWOPTTYPE_CHAR, TWOPTTYPE_FLAG, TWOPTTYPE_SHOWHELP } |
Functions | |
void | tw_opt_parse (int *argc, char ***argv) |
void | tw_opt_add (const tw_optdef *options) |
void | tw_opt_print (void) |
void | tw_opt_settings (FILE *f) |
#define TWOPT_CHAR | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_CHAR, (n), (h), &(v) } |
#define TWOPT_DOUBLE | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_DOUBLE, (n), (h), &(v) } |
#define TWOPT_END | ( | ) | { (tw_opttype)0, NULL, NULL, NULL } |
#define TWOPT_FLAG | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_FLAG, (n), (h), &(v) } |
#define TWOPT_GROUP | ( | h | ) | { TWOPTTYPE_GROUP, NULL, (h), NULL } |
#define TWOPT_STIME | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_STIME, (n), (h), &(v) } |
#define TWOPT_UINT | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_UINT, (n), (h), &(v) } |
#define TWOPT_ULONG | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_ULONG, (n), (h), &(v) } |
#define TWOPT_ULONGLONG | ( | n, | |
v, | |||
h | |||
) | { TWOPTTYPE_ULONGLONG, (n), (h), &(v) } |
typedef enum tw_opttype tw_opttype |
enum tw_opttype |
void tw_opt_add | ( | const tw_optdef * | options | ) |
Add an opt group
Definition at line 14 of file tw-opts.c.
References is_empty(), opt_index, and tw_optdef::type.
Referenced by main(), and tw_init().
void tw_opt_parse | ( | int * | argc, |
char *** | argv | ||
) |
Remove options from the command line arguments.
Definition at line 427 of file tw-opts.c.
References ARRAY_SIZE, basic, is_empty(), match_opt(), program, tw_error(), and TW_LOC.
Referenced by tw_init().
void tw_opt_print | ( | void | ) |
Pretty-print the option descriptions (for –help)
Definition at line 215 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 138 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().