Transformer SDK For C
8.0.2.290852-a608fcd3
|
You can define and use variables in configuration files.
To define a variable, use the define configuration option.
Syntax: define var_name value
Example:
The variable name may contain letters, numbers, and the characters '_' and '.'. The variable value may contain any characters apart from spaces, unless enclosed by double quote marks.
Example:
Defined variables can be expanded back to their values at any point after the declaration by enclosing the variable name into "${" and "}".
Example:
Expansion is applied on all occurrences of ${ ... }, even if they contain invalid variable names, or are undefined. Such variables get converted to "" and a warning is printed.
Example:
It is possible to refer to variables in the definition of another variable.
Example:
If a variable is redefined, a warning is printed, and new definition takes precedence.
All child configuration files included by "include-file" inherit variables from their parent. Unrelated configuration files share no common variables.
Some variables are pre-defined:
HOST_NAME | Hostname of the machine currently running on |
APP_NAME | Application name |
HOME_DIR | Home directory of the user running the application |
MAJOR_VERSION | Major version of the application |
MINOR_VERSION | Minor version of the application |
It is possible to access environment variables by using ENV:name syntax, replacing name with the environment variable accessed. It is not possible to set environment variables this way, and any attempt to do so will result in an error. Undefined environment variables are expended to empty string.
Example:
Type: Function
Default: None
Define a variable
Type: Function
Default: None
Define a macro
Type: Function
Default: None
Undefine a variable