LAL  7.5.0.1-b72065a
UserInput.h File Reference

Prototypes

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,...) _LAL_GCC_PRINTF_FORMAT_(3
 
void CHARXLALUserVarGetLog (UserVarLogFormat format)
 Return a log-string representing the complete user-input. More...
 
CHARXLALUserVarGetLogEx (UserVarLogFormat format, const BOOLEAN skip_unset)
 Return a log-string representing the complete user-input. More...
 
 DECL_REGISTER_UVAR (BOOLEAN, BOOLEAN)
 
 DECL_REGISTER_UVAR (INT4, INT4)
 
 DECL_REGISTER_UVAR (INT8, INT8)
 
 DECL_REGISTER_UVAR (UINT4, UINT4)
 
 DECL_REGISTER_UVAR (UINT8, UINT8)
 
 DECL_REGISTER_UVAR (REAL8, REAL8)
 
 DECL_REGISTER_UVAR (EPOCH, LIGOTimeGPS)
 
 DECL_REGISTER_UVAR (RAJ, REAL8)
 
 DECL_REGISTER_UVAR (DECJ, REAL8)
 
 DECL_REGISTER_UVAR (STRING, CHAR *)
 
 DECL_REGISTER_UVAR (INT4Range, INT4Range)
 
 DECL_REGISTER_UVAR (REAL8Range, REAL8Range)
 
 DECL_REGISTER_UVAR (EPOCHRange, LIGOTimeGPSRange)
 
 DECL_REGISTER_UVAR (RAJRange, REAL8Range)
 
 DECL_REGISTER_UVAR (DECJRange, REAL8Range)
 
 DECL_REGISTER_UVAR_AUX_DATA (UserEnum, int, UserChoices)
 
 DECL_REGISTER_UVAR_AUX_DATA (UserFlag, int, UserChoices)
 
 DECL_REGISTER_UVAR (INT4Vector, INT4Vector *)
 
 DECL_REGISTER_UVAR (UINT4Vector, UINT4Vector *)
 
 DECL_REGISTER_UVAR (REAL8Vector, REAL8Vector *)
 
 DECL_REGISTER_UVAR (STRINGVector, LALStringVector *)
 

Go to the source code of this file.

Macros

#define XLALRegisterUvarMember(name, type, option, category, ...)    XLALRegister ##type## UserVar( &(uvar-> name), NULL, #name, option, UVAR_CATEGORY_ ## category, __VA_ARGS__)
 Shortcut macro for registering new user variables, which are accessed via the struct-pointer '*uvar'. More...
 
#define XLALRegisterUvarAuxDataMember(name, type, cdata, option, category, ...)    XLALRegister ##type## UserVar( &(uvar-> name), cdata, #name, option, UVAR_CATEGORY_ ## category, __VA_ARGS__)
 Shortcut macro for registering new user variables, which are accessed via the struct-pointer '*uvar', and which acquire some auxilliary data in order to be parsed. More...
 
#define XLALRegisterNamedUvar(cvar, name, type, option, category, ...)    XLALRegister ##type## UserVar( cvar, NULL, name, option, UVAR_CATEGORY_ ## category, __VA_ARGS__)
 Shortcut macro for registering new user variables, named 'name' and accessed via the variable-pointer '*cvar'. More...
 
#define XLALRegisterNamedUvarAuxData(cvar, name, type, cdata, option, category, ...)    XLALRegister ##type## UserVar( cvar, cdata, name, option, UVAR_CATEGORY_ ## category, __VA_ARGS__)
 Shortcut macro for registering new user variables, named 'name' and accessed via the variable-pointer '*cvar', and which acquire some auxilliary data in order to be parsed. More...
 
#define DECL_REGISTER_UVAR(UTYPE, CTYPE)    DECL_REGISTER_UVAR_AUX_DATA(UTYPE,CTYPE,void)
 
#define DECL_REGISTER_UVAR_AUX_DATA(UTYPE, CTYPE, DTYPE)    int XLALRegister ##UTYPE## UserVar ( CTYPE *cvar, const DTYPE *cdata, const CHAR *name, CHAR optchar, UserVarCategory category, const CHAR *fmt, ... ) _LAL_GCC_PRINTF_FORMAT_(6,7)
 
Convenience macros for checking how many of a set of user input variables were set
#define UVAR_SET(n)   (XLALUserVarWasSet(&(uvar-> n)) ? 1 : 0)
 
#define UVAR_SET2(n1, n2)   (UVAR_SET(n1) + UVAR_SET(n2))
 
#define UVAR_SET3(n1, n2, n3)   (UVAR_SET2(n1,n2) + UVAR_SET(n3))
 
#define UVAR_SET4(n1, n2, n3, n4)   (UVAR_SET3(n1,n2,n3) + UVAR_SET(n4))
 
#define UVAR_SET5(n1, n2, n3, n4, n5)   (UVAR_SET4(n1,n2,n3,n4) + UVAR_SET(n5))
 
#define UVAR_SET6(n1, n2, n3, n4, n5, n6)   (UVAR_SET5(n1,n2,n3,n4,n5) + UVAR_SET(n6))
 
Convenience macros for checking whether all of a set of user input variables were set
#define UVAR_ALLSET2(n1, n2)   (UVAR_SET2(n1,n2) == 2)
 
#define UVAR_ALLSET3(n1, n2, n3)   (UVAR_SET3(n1,n2,n3) == 3)
 
#define UVAR_ALLSET4(n1, n2, n3, n4)   (UVAR_SET4(n1,n2,n3,n4) == 4)
 
#define UVAR_ALLSET5(n1, n2, n3, n4, n5)   (UVAR_SET5(n1,n2,n3,n4,n5) == 5)
 
#define UVAR_ALLSET6(n1, n2, n3, n4, n5, n6)   (UVAR_SET6(n1,n2,n3,n4,n5,n6) == 6)
 
Convenience macros for checking whether any of a set of user input variables were set
#define UVAR_ANYSET2(n1, n2)   (UVAR_SET2(n1,n2) > 0)
 
#define UVAR_ANYSET3(n1, n2, n3)   (UVAR_SET3(n1,n2,n3) > 0)
 
#define UVAR_ANYSET4(n1, n2, n3, n4)   (UVAR_SET4(n1,n2,n3,n4) > 0)
 
#define UVAR_ANYSET5(n1, n2, n3, n4, n5)   (UVAR_SET5(n1,n2,n3,n4,n5) > 0)
 
#define UVAR_ANYSET6(n1, n2, n3, n4, n5, n6)   (UVAR_SET6(n1,n2,n3,n4,n5,n6) > 0)
 
Convenience macros for printing user input variables in error messages
#define UVAR_FMT   "`--%s'"
 
#define UVAR_STR(n)   "`--"#n"'"
 
#define UVAR_STR2AND(n1, n2)   "`--"#n1"' and `--"#n2"'"
 
#define UVAR_STR2OR(n1, n2)   "`--"#n1"' or `--"#n2"'"
 
#define UVAR_STR3AND(n1, n2, n3)   "`--"#n1"', `--"#n2"', and `--"#n3"'"
 
#define UVAR_STR3OR(n1, n2, n3)   "`--"#n1"', `--"#n2"', or `--"#n3"'"
 
#define UVAR_STR4AND(n1, n2, n3, n4)   "`--"#n1"', `--"#n2"', `--"#n3"', and `--"#n4"'"
 
#define UVAR_STR4OR(n1, n2, n3, n4)   "`--"#n1"', `--"#n2"', `--"#n3"', or `--"#n4"'"
 
#define UVAR_STR5AND(n1, n2, n3, n4, n5)   "`--"#n1"', `--"#n2"', `--"#n3"', `--"#n4"', and `--"#n5"'"
 
#define UVAR_STR5OR(n1, n2, n3, n4, n5)   "`--"#n1"', `--"#n2"', `--"#n3"', `--"#n4"', or `--"#n5"'"
 
#define UVAR_STR6AND(n1, n2, n3, n4, n5, n6)   "`--"#n1"', `--"#n2"', `--"#n3"', `--"#n4"', `--"#n5"', and `--"#n6"'"
 
#define UVAR_STR6OR(n1, n2, n3, n4, n5, n6)   "`--"#n1"', `--"#n2"', `--"#n3"', `--"#n4"', `--"#n5"', or `--"#n6"'"
 

Enumerations

enum  UserVarCategory {
  UVAR_CATEGORY_START = 0 , UVAR_CATEGORY_OPTIONAL , UVAR_CATEGORY_REQUIRED , UVAR_CATEGORY_DEVELOPER ,
  UVAR_CATEGORY_DEPRECATED , UVAR_CATEGORY_DEFUNCT , UVAR_CATEGORY_NODEFAULT , UVAR_CATEGORY_END
}
 Mutually-exclusive user variable categories: optional, required, help, developer, ... More...
 
enum  UserVarLogFormat {
  UVAR_LOGFMT_RAWFORM , UVAR_LOGFMT_CFGFILE , UVAR_LOGFMT_CMDLINE , UVAR_LOGFMT_PROCPARAMS ,
  UVAR_LOGFMT_LAST
}
 Format for logging User-input: configFile- or cmdLine-style. More...
 

Variables

const char * lalUserVarHelpBrief
 An optional brief description of the program, printed after its name as part of the help page. More...
 
const char * lalUserVarHelpDescription
 An optional longer description of the program, printed in its own section as part of the help page. More...
 
const char * lalUserVarHelpOptionSubsection
 An optional subsection heading under OPTIONS, under which all subsequently-defined user variables are printed as part of the help page. More...