All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Turbulence Config: files to access to run-time Turbulence Config

Functions

axlDoc * turbulence_config_get (TurbulenceCtx *ctx)
 
int turbulence_config_get_number (TurbulenceCtx *ctx, const char *path, const char *attr_name)
 
axl_bool turbulence_config_is_attr_negative (TurbulenceCtx *ctx, axlNode *node, const char *attr_name)
 
axl_bool turbulence_config_is_attr_positive (TurbulenceCtx *ctx, axlNode *node, const char *attr_name)
 
axl_bool turbulence_config_set (TurbulenceCtx *ctx, const char *path, const char *attr_name, const char *attr_value)
 

Detailed Description

Function Documentation

axlDoc* turbulence_config_get ( TurbulenceCtx ctx)

Allows to get the configuration loaded at the startup.

The function will always return a configuration object.

Returns
A reference to the axlDoc having all the configuration loaded.

Referenced by turbulence_run_config(), and turbulence_support_simple_smtp_send().

int turbulence_config_get_number ( TurbulenceCtx ctx,
const char *  path,
const char *  attr_name 
)

Allows to get the value found on provided config path at the selected attribute.

Parameters
ctxThe turbulence context where to get the configuration value.
pathThe path to the node where the config is found.
attr_nameThe attribute name to be returned as a number.
Returns
The function returns the value configured or -1 in the case the configuration is wrong. The function returns -2 in the case path, ctx or attr_name are NULL. The function returns -3 in the case the path is not found so the user can take default action.

References msg, and wrn.

axl_bool turbulence_config_is_attr_negative ( TurbulenceCtx ctx,
axlNode *  node,
const char *  attr_name 
)

Allows to check if an xml attribute is positive, that is, have 1, true or yes as value.

Parameters
ctxThe turbulence context.
nodeThe node to check for positive attribute value.
attr_nameThe node attribute name to check for positive value.

Referenced by turbulence_run_config().

axl_bool turbulence_config_is_attr_positive ( TurbulenceCtx ctx,
axlNode *  node,
const char *  attr_name 
)

Allows to check if an xml attribute is positive, that is, have 1, true or yes as value.

Parameters
ctxThe turbulence context.
nodeThe node to check for positive attribute value.
attr_nameThe node attribute name to check for positive value.
axl_bool turbulence_config_set ( TurbulenceCtx ctx,
const char *  path,
const char *  attr_name,
const char *  attr_value 
)

Allows to configure the provided name and value on the provided path inside the turbulence config.

Parameters
ctxThe turbulence context where the configuration will be modified.
pathThe xml path to the configuration to be modified.
attr_nameThe attribute name to be modified on the selected path node.
attr_valueThe attribute value to be modified on the selected path node.
Returns
axl_true if the value was configured, otherwise axl_false is returned (telling the value wasn't configured mostly because the path is wrong or the node does not exists or any of the values passed to the function is NULL).

References msg, and wrn.