|
#define | MAX_SRC 60 |
| Manage buffer of sources of all used parameters (Esorex + recipes)
|
|
|
void | er_paramutils_tilde_convert (cpl_parameterlist *param_list) |
| Replaces any tilde in parameters within a parameter list.
|
|
void | er_paramutils_print_key_desc (const char *flag_prefix, const char *keyword, const char *description) |
| Neatly print a parameter and its description.
|
|
void | er_paramutils_print_aux_info (const char *flag_prefix, const char *keyword, const char *description) |
| Neatly print auxiliary information for a parameter.
|
|
int | er_paramutils_print_list (cpl_parameterlist *param_list, const char *header) |
| Pretty-print a parameter list with a given header text.
|
|
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.
|
|
EsoRex Parameter Utility Functions
◆ MAX_SRC
Manage buffer of sources of all used parameters (Esorex + recipes)
- Parameters
-
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.
◆ er_paramutils_print_aux_info()
void er_paramutils_print_aux_info |
( |
const char * | flag_prefix, |
|
|
const char * | keyword, |
|
|
const char * | description ) |
Neatly print auxiliary information for a parameter.
- Parameters
-
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.
◆ er_paramutils_print_key_desc()
void er_paramutils_print_key_desc |
( |
const char * | flag_prefix, |
|
|
const char * | keyword, |
|
|
const char * | description ) |
Neatly print a parameter and its description.
- Parameters
-
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.
◆ er_paramutils_print_list()
int er_paramutils_print_list |
( |
cpl_parameterlist * | param_list, |
|
|
const char * | header ) |
Pretty-print a parameter list with a given header text.
- Parameters
-
param_list | List of Parameters |
header | Header Text |
- Returns
- Zero on sucess, or non-zero in the case of error.
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
.
◆ er_paramutils_tilde_convert()
void er_paramutils_tilde_convert |
( |
cpl_parameterlist * | param_list | ) |
|
Replaces any tilde in parameters within a parameter list.
- Parameters
-
param_list | List of Parameters |
- Returns
- None
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).
◆ paramutils_set_from_string()
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.
- Parameters
-
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 |
- Returns
- 0 if successfull, !=0 otherwise
Function sets the current value of the given parameter. Converts the string value to the necessary type if needed.