ROSS
Data Structures | Macros | Typedefs | Enumerations | Functions
tw-opts.h File Reference

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)
 

Macro Definition Documentation

#define TWOPT_CHAR (   n,
  v,
 
)    { TWOPTTYPE_CHAR, (n), (h), &(v) }

Definition at line 33 of file tw-opts.h.

#define TWOPT_DOUBLE (   n,
  v,
 
)    { TWOPTTYPE_DOUBLE, (n), (h), &(v) }

Definition at line 32 of file tw-opts.h.

#define TWOPT_END ( )    { (tw_opttype)0, NULL, NULL, NULL }

Definition at line 35 of file tw-opts.h.

#define TWOPT_FLAG (   n,
  v,
 
)    { TWOPTTYPE_FLAG, (n), (h), &(v) }

Definition at line 34 of file tw-opts.h.

#define TWOPT_GROUP (   h)    { TWOPTTYPE_GROUP, NULL, (h), NULL }

Definition at line 27 of file tw-opts.h.

#define TWOPT_STIME (   n,
  v,
 
)    { TWOPTTYPE_STIME, (n), (h), &(v) }

Definition at line 31 of file tw-opts.h.

#define TWOPT_UINT (   n,
  v,
 
)    { TWOPTTYPE_UINT, (n), (h), &(v) }

Definition at line 30 of file tw-opts.h.

#define TWOPT_ULONG (   n,
  v,
 
)    { TWOPTTYPE_ULONG, (n), (h), &(v) }

Definition at line 28 of file tw-opts.h.

#define TWOPT_ULONGLONG (   n,
  v,
 
)    { TWOPTTYPE_ULONGLONG, (n), (h), &(v) }

Definition at line 29 of file tw-opts.h.

Typedef Documentation

typedef struct tw_optdef tw_optdef

Definition at line 18 of file tw-opts.h.

typedef enum tw_opttype tw_opttype

Definition at line 16 of file tw-opts.h.

Enumeration Type Documentation

enum tw_opttype
Enumerator
TWOPTTYPE_GROUP 
TWOPTTYPE_ULONG 

value must be an "unsigned long*"

TWOPTTYPE_ULONGLONG 

value must be an "unsigned long long*"

TWOPTTYPE_UINT 

value must be an "unsigned int*"

TWOPTTYPE_STIME 

value must be a "tw_stime*"

TWOPTTYPE_DOUBLE 

value must be a "double *"

TWOPTTYPE_CHAR 

value must be a "char *"

TWOPTTYPE_FLAG 

value must be an "unsigned int*"

TWOPTTYPE_SHOWHELP 

Definition at line 4 of file tw-opts.h.

Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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().

Here is the caller graph for this function: