ESO Recipe Execution Tool
3.13
|
Functions | |
void | er_paramutils_tilde_convert (cpl_parameterlist *param_list) |
Replaces any tilde in parameters within a parameter list. More... | |
void | er_paramutils_print_key_desc (const char *flag_prefix, const char *keyword, const char *description) |
Neatly print a parameter and its description. More... | |
int | er_manage_sources (const int flag, const char *name, char **source) |
Manage buffer of sources of all used parameters (Esorex + recipes) More... | |
void | er_paramutils_print_aux_info (const char *flag_prefix, const char *keyword, const char *description) |
Neatly print auxiliary information for a parameter. More... | |
int | er_paramutils_print_list (cpl_parameterlist *param_list, const char *header) |
Pretty-print a parameter list with a given header text. More... | |
int | paramutils_set_from_string (cpl_parameter *p, const char *value, const char *source) |
Set the value of a parameter from that of a given string. More... | |
EsoRex Parameter Utility Functions
int er_manage_sources | ( | const int | flag, |
const char * | name, | ||
char ** | source | ||
) |
Manage buffer of sources of all used parameters (Esorex + recipes)
flag | Control flag: = 1, for given param. save source in internal buffer = 2, for given param. pull out source from internal buffer = 3, free allocated memory |
name | Name of parameter |
source | desription of source of a param. maybe "default", config-file name, "command line", etc |
This function manages a buffer of sources of all used parameters in Esorex + all called recipes. Max MAX_SRC can be handled, i.e. for at most MAX_SRC different params. Esorex has already 25 parameters... Max length of parameter name is PAR_LEN chars.
void er_paramutils_print_aux_info | ( | const char * | flag_prefix, |
const char * | keyword, | ||
const char * | description | ||
) |
Neatly print auxiliary information for a parameter.
flag_prefix | This is the prefix used to flag certain types of switches/parameters. For example a double hypen "--" may be used before the long form of command line options. It is only used for spacing. |
keyword | This is the keyword itself. It is only used for spacing. |
description | This is the descriptive text that is to be printed. It is aligned to a tab stop to ensure that the output is neat. |
This function neatly prints an auxiliary line of information regarding a parameter. The infomation is printed to the normal output stream. The formatting is handled automatically to get neat alignment of the output.
void er_paramutils_print_key_desc | ( | const char * | flag_prefix, |
const char * | keyword, | ||
const char * | description | ||
) |
Neatly print a parameter and its description.
flag_prefix | This is the prefix used to flag certain types of switches/parameters. For example a double hypen "--" may be used before the long form of command line options. |
keyword | This is the keyword itself. It is appended to the flag-prefix, if any. |
description | This is the descriptive text that follows the keyword. It is put at a tab-stop, so that all the descriptions are neatly aligned. |
This function neatly prints a keyword and its associated description to the normal output channel. The formatting is handled automatically to get neat alignment of the output.
int er_paramutils_print_list | ( | cpl_parameterlist * | param_list, |
const char * | header | ||
) |
Pretty-print a parameter list with a given header text.
param_list | List of Parameters |
header | Header Text |
This function takes a parameter list, and a title and prints them. The function makes use of the COMMENT_TAB_POSITION
constant that is defined in er_macros.h
.
void er_paramutils_tilde_convert | ( | cpl_parameterlist * | param_list | ) |
Replaces any tilde in parameters within a parameter list.
param_list | List of Parameters |
Function searches param_list for parameters whose values begin with a tilde (~) and if found, replace the tilde with the user's home directory (using the $HOME environment variable).
int paramutils_set_from_string | ( | cpl_parameter * | p, |
const char * | value, | ||
const char * | source | ||
) |
Set the value of a parameter from that of a given string.
p | Parameter that will have its value set. |
value | A string containing the value to be assigned to the parameter. |
source | The source of value |
Function sets the current value of the given parameter. Converts the string value to the necessary type if needed.