Prototypes | |
int | XLALRegisterUserVar (void *cvar, const void *cdata, const CHAR *name, UserVarType type, CHAR optchar, UserVarCategory category, const CHAR *help) |
Internal function: Register a user-variable with the module. More... | |
int | XLALUserVarPrintUsage (FILE *file) |
Print a one-line usage string. More... | |
int | XLALUserVarPrintHelp (FILE *file) |
Print help page. More... | |
static void | format_user_var_names (char *s) |
static void | fprint_wrapped (FILE *f, int line_width, const char *prefix, char *text) |
DEFN_REGISTER_UVAR (BOOLEAN, BOOLEAN) | |
DEFN_REGISTER_UVAR (INT4, INT4) | |
DEFN_REGISTER_UVAR (INT8, INT8) | |
DEFN_REGISTER_UVAR (UINT4, UINT4) | |
DEFN_REGISTER_UVAR (UINT8, UINT8) | |
DEFN_REGISTER_UVAR (REAL8, REAL8) | |
DEFN_REGISTER_UVAR (RAJ, REAL8) | |
DEFN_REGISTER_UVAR (DECJ, REAL8) | |
DEFN_REGISTER_UVAR (EPOCH, LIGOTimeGPS) | |
DEFN_REGISTER_UVAR (STRING, CHAR *) | |
DEFN_REGISTER_UVAR (INT4Range, INT4Range) | |
DEFN_REGISTER_UVAR (REAL8Range, REAL8Range) | |
DEFN_REGISTER_UVAR (EPOCHRange, LIGOTimeGPSRange) | |
DEFN_REGISTER_UVAR (RAJRange, REAL8Range) | |
DEFN_REGISTER_UVAR (DECJRange, REAL8Range) | |
DEFN_REGISTER_UVAR_AUX_DATA (UserEnum, int, UserChoices) | |
DEFN_REGISTER_UVAR_AUX_DATA (UserFlag, int, UserChoices) | |
DEFN_REGISTER_UVAR (INT4Vector, INT4Vector *) | |
DEFN_REGISTER_UVAR (UINT4Vector, UINT4Vector *) | |
DEFN_REGISTER_UVAR (REAL8Vector, REAL8Vector *) | |
DEFN_REGISTER_UVAR (STRINGVector, LALStringVector *) | |
void | XLALDestroyUserVars (void) |
Free all memory associated with user-variable linked list. More... | |
int | XLALUserVarReadCmdline (BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list) |
Parse command-line into UserVariable array. More... | |
int | XLALUserVarReadCfgfile (BOOLEAN *should_exit, const CHAR *cfgfile) |
Read config-variables from cfgfile and parse into input-structure. More... | |
int | XLALUserVarReadAllInput (BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list) |
Put all the pieces together, and basically does everything: print help (if requested), get config-filename from cmd-line (if found), then interpret config-file and then the command-line. More... | |
int | XLALUserVarWasSet (const void *cvar) |
Has this user-variable been set by the user? returns 1 (=TRUE) or 0 (=FALSE) on success, error-code otherwise. More... | |
void | XLALUserVarCheck (BOOLEAN *should_exit, const int assertion, const CHAR *fmt,...) |
If assertion is false, print the given error message, then the help usage; should_exit is then set to true. More... | |
CHAR * | XLALUserVarGetLog (UserVarLogFormat format) |
Return a log-string representing the complete user-input. More... | |
CHAR * | XLALUserVarGetLogEx (UserVarLogFormat format, const BOOLEAN skip_unset) |
Return a log-string representing the complete user-input. More... | |
Go to the source code of this file.
Data Structures | |
struct | LALUserVariable |
Macros | |
#define | TRUE (1==1) |
#define | FALSE (1==0) |
#define | DEFN_REGISTER_UVAR(UTYPE, CTYPE) DEFN_REGISTER_UVAR_AUX_DATA(UTYPE,CTYPE,void) |
#define | DEFN_REGISTER_UVAR_AUX_DATA(UTYPE, CTYPE, DTYPE) |
#define | REGULAR_MAP_ENTRY(UTYPE, DESTRUCTOR, FORMATHELP) |
#define | REGULAR_MAP_ENTRY_AUX_DATA(UTYPE, DESTRUCTOR, DTYPE) |
Typedefs | |
typedef void(* | destructorT) (void *cvar) |
typedef int(* | parserT) (void *cvar, const char *valstr) |
typedef char *(* | printerT) (const void *cvar) |
typedef int(* | parser_cdataT) (void *cvar, const void *cdata, const char *valstr) |
typedef char *(* | printer_cdataT) (const void *cvar, const void *cdata) |
typedef char *(* | format_help_cdataT) (const void *cdata) |
Variables | |
struct { | |
const char *const name | |
type name More... | |
destructorT destructor | |
destructor for this variable type, NULL if none required More... | |
parserT parser | |
parser function to parse string as this type More... | |
printerT printer | |
'printer' function returning string value for given type More... | |
const char *const format_help_str | |
help string describing format of user variable More... | |
parser_cdataT parser_cdata | |
parser function (with auxilliary data) to parse string as this type More... | |
printer_cdataT printer_cdata | |
'printer' function (with auxilliary data) returning string value for given type More... | |
format_help_cdataT format_help_cdata | |
function returning describing format of user variable (with auxilliary data) More... | |
} | UserVarTypeMap [UVAR_TYPE_END] |
static LALUserVariable | UVAR_vars |
static CHAR * | program_path = NULL |
static CHAR * | program_name = NULL |
const char * | lalUserVarHelpBrief = NULL |
An optional brief description of the program, printed after its name as part of the help page. More... | |
const char * | lalUserVarHelpDescription = NULL |
An optional longer description of the program, printed in its own section as part of the help page. More... | |
const char * | lalUserVarHelpOptionSubsection = NULL |
An optional subsection heading under OPTIONS, under which all subsequently-defined user variables are printed as part of the help page. More... | |
#define TRUE (1==1) |
Definition at line 48 of file UserInput.c.
#define FALSE (1==0) |
Definition at line 49 of file UserInput.c.
#define DEFN_REGISTER_UVAR | ( | UTYPE, | |
CTYPE | |||
) | DEFN_REGISTER_UVAR_AUX_DATA(UTYPE,CTYPE,void) |
Definition at line 55 of file UserInput.c.
#define DEFN_REGISTER_UVAR_AUX_DATA | ( | UTYPE, | |
CTYPE, | |||
DTYPE | |||
) |
Definition at line 57 of file UserInput.c.
#define REGULAR_MAP_ENTRY | ( | UTYPE, | |
DESTRUCTOR, | |||
FORMATHELP | |||
) |
Definition at line 160 of file UserInput.c.
#define REGULAR_MAP_ENTRY_AUX_DATA | ( | UTYPE, | |
DESTRUCTOR, | |||
DTYPE | |||
) |
Definition at line 168 of file UserInput.c.
typedef void(* destructorT) (void *cvar) |
Definition at line 152 of file UserInput.c.
typedef int(* parserT) (void *cvar, const char *valstr) |
Definition at line 153 of file UserInput.c.
typedef char *(* printerT) (const void *cvar) |
Definition at line 154 of file UserInput.c.
typedef int(* parser_cdataT) (void *cvar, const void *cdata, const char *valstr) |
Definition at line 155 of file UserInput.c.
typedef char *(* printer_cdataT) (const void *cvar, const void *cdata) |
Definition at line 156 of file UserInput.c.
typedef char *(* format_help_cdataT) (const void *cdata) |
Definition at line 157 of file UserInput.c.
enum UserVarType |
Definition at line 71 of file UserInput.c.
int XLALUserVarPrintUsage | ( | FILE * | file | ) |
Print a one-line usage string.
Definition at line 729 of file UserInput.c.
int XLALUserVarPrintHelp | ( | FILE * | file | ) |
Print help page.
Definition at line 875 of file UserInput.c.
|
static |
Definition at line 769 of file UserInput.c.
|
static |
Definition at line 785 of file UserInput.c.
DEFN_REGISTER_UVAR | ( | RAJ | , |
REAL8 | |||
) |
DEFN_REGISTER_UVAR | ( | DECJ | , |
REAL8 | |||
) |
DEFN_REGISTER_UVAR | ( | EPOCH | , |
LIGOTimeGPS | |||
) |
DEFN_REGISTER_UVAR | ( | REAL8Range | , |
REAL8Range | |||
) |
DEFN_REGISTER_UVAR | ( | EPOCHRange | , |
LIGOTimeGPSRange | |||
) |
DEFN_REGISTER_UVAR | ( | RAJRange | , |
REAL8Range | |||
) |
DEFN_REGISTER_UVAR | ( | DECJRange | , |
REAL8Range | |||
) |
DEFN_REGISTER_UVAR_AUX_DATA | ( | UserEnum | , |
int | , | ||
UserChoices | |||
) |
DEFN_REGISTER_UVAR_AUX_DATA | ( | UserFlag | , |
int | , | ||
UserChoices | |||
) |
DEFN_REGISTER_UVAR | ( | INT4Vector | , |
INT4Vector * | |||
) |
DEFN_REGISTER_UVAR | ( | UINT4Vector | , |
UINT4Vector * | |||
) |
DEFN_REGISTER_UVAR | ( | REAL8Vector | , |
REAL8Vector * | |||
) |
DEFN_REGISTER_UVAR | ( | STRINGVector | , |
LALStringVector * | |||
) |
If assertion
is false, print the given error message, then the help usage; should_exit
is then set to true.
Definition at line 1206 of file UserInput.c.
const char* const name |
type name
Definition at line 193 of file UserInput.c.
destructorT destructor |
destructor for this variable type, NULL if none required
Definition at line 194 of file UserInput.c.
parserT parser |
parser function to parse string as this type
Definition at line 195 of file UserInput.c.
printerT printer |
'printer' function returning string value for given type
Definition at line 196 of file UserInput.c.
const char* const format_help_str |
help string describing format of user variable
Definition at line 197 of file UserInput.c.
parser_cdataT parser_cdata |
parser function (with auxilliary data) to parse string as this type
Definition at line 198 of file UserInput.c.
printer_cdataT printer_cdata |
'printer' function (with auxilliary data) returning string value for given type
Definition at line 199 of file UserInput.c.
format_help_cdataT format_help_cdata |
function returning describing format of user variable (with auxilliary data)
Definition at line 200 of file UserInput.c.
const struct { ... } UserVarTypeMap[UVAR_TYPE_END] |
|
static |
Definition at line 240 of file UserInput.c.
|
static |
Definition at line 241 of file UserInput.c.
|
static |
Definition at line 242 of file UserInput.c.