SimGrid  3.13
Versatile Simulation of Distributed Systems
Getting the stored values

This is how to retrieve the values stored in the configuration set. More...

Functions

int xbt_cfg_get_int (const char *name)
 Retrieve an integer value of a variable (get a warning if not uniq) More...
 
double xbt_cfg_get_double (const char *name)
 Retrieve a double value of a variable (get a warning if not uniq) More...
 
char * xbt_cfg_get_string (const char *name)
 Retrieve a string value of a variable (get a warning if not uniq) More...
 
int xbt_cfg_get_boolean (const char *name)
 Retrieve a boolean value of a variable (get a warning if not uniq) More...
 

Detailed Description

This is how to retrieve the values stored in the configuration set.

This is only intended to configurable code, naturally.

Note that those function return a pointer to the values actually stored in the set. Do not modify them unless you really know what you're doing. Likewise, do not free the strings after use, they are not copy of the data, but the data themselves.

Function Documentation

int xbt_cfg_get_int ( const char *  name)

Retrieve an integer value of a variable (get a warning if not uniq)

Parameters
namethe name of the variable

Returns the first value from the config set under the given name. If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() instead.

double xbt_cfg_get_double ( const char *  name)

Retrieve a double value of a variable (get a warning if not uniq)

Parameters
cfgthe config set
namethe name of the variable

Returns the first value from the config set under the given name. If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() instead.

char* xbt_cfg_get_string ( const char *  name)

Retrieve a string value of a variable (get a warning if not uniq)

Parameters
cfgthe config set
namethe name of the variable

Returns the first value from the config set under the given name. If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() instead. Returns NULL if there is no value.

Warning
the returned value is the actual content of the config set
int xbt_cfg_get_boolean ( const char *  name)

Retrieve a boolean value of a variable (get a warning if not uniq)

Parameters
cfgthe config set
namethe name of the variable

Returns the first value from the config set under the given name. If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() instead.