DataSource for C SDK  8.0.3.290770-7760911e
Configuration: Variables

You can define and use variables in configuration files.

To define a variable, use the define configuration option.

Syntax: define var_name value

Example:

define localport 1500

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:

define SSL_seed_source "exec etc/random.sh"

Defined variables can be expanded back to their values at any point after the declaration by enclosing the variable name into "${" and "}".

Example:

udp-port ${localport}

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:

ssl-random-seed ${SSL_seed_source}${optional_suffix}

It is possible to refer to variables in the definition of another variable.

Example:

define SSL_seed_source "file /dev/random"
define SSL_seed_length 1024
define SSL_seed "${SSL_seed_source} ${SSL_seed_length}"
ssl-random-seed ${SSL_seed}

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:

jvm-location ${ENV:JAVA_HOME}/lib/i386/server/libjvm.so

define

Type: Function
Default: None

Define a variable


defmacro

Type: Function
Default: None

Define a macro


undefine

Type: Function
Default: None

Undefine a variable



Generated on Wed Jul 31 2024 16:32:49 for DataSource for C SDK