SimGrid  3.9.90
Versatile Simulation of Distributed Systems
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Getting the stored values

Functions

int xbt_cfg_get_int (xbt_cfg_t cfg, const char *name)
 Retrieve an integer value of a variable (get a warning if not uniq) More...
 
double xbt_cfg_get_double (xbt_cfg_t cfg, const char *name)
 Retrieve a double value of a variable (get a warning if not uniq) More...
 
char * xbt_cfg_get_string (xbt_cfg_t cfg, const char *name)
 Retrieve a string value of a variable (get a warning if not uniq) More...
 
int xbt_cfg_get_boolean (xbt_cfg_t cfg, const char *name)
 Retrieve a boolean value of a variable (get a warning if not uniq) More...
 
void xbt_cfg_get_peer (xbt_cfg_t cfg, const char *name, char **peer, int *port)
 Retrieve an peer value of a variable (get a warning if not uniq) More...
 
xbt_dynar_t xbt_cfg_get_dynar (xbt_cfg_t cfg, const char *name)
 Retrieve the dynar of all the values stored in a variable. More...
 
int xbt_cfg_get_int_at (xbt_cfg_t cfg, const char *name, int pos)
 Retrieve one of the integer value of a variable.
 
double xbt_cfg_get_double_at (xbt_cfg_t cfg, const char *name, int pos)
 Retrieve one of the double value of a variable.
 
char * xbt_cfg_get_string_at (xbt_cfg_t cfg, const char *name, int pos)
 Retrieve one of the string value of a variable.
 
int xbt_cfg_get_boolean_at (xbt_cfg_t cfg, const char *name, int pos)
 Retrieve one of the boolean value of a variable.
 
void xbt_cfg_get_peer_at (xbt_cfg_t cfg, const char *name, int pos, char **peer, int *port)
 Retrieve one of the peer value of a variable.
 

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 ( xbt_cfg_t  cfg,
const char *  name 
)

Retrieve an integer 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.

Warning
the returned value is the actual content of the config set
double xbt_cfg_get_double ( xbt_cfg_t  cfg,
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.

Warning
the returned value is the actual content of the config set
char* xbt_cfg_get_string ( xbt_cfg_t  cfg,
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 ( xbt_cfg_t  cfg,
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.

Warning
the returned value is the actual content of the config set
void xbt_cfg_get_peer ( xbt_cfg_t  cfg,
const char *  name,
char **  peer,
int *  port 
)

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

Parameters
cfgthe config set
namethe name of the variable
peerthe peer
portthe port number

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.

Warning
the returned value is the actual content of the config set
xbt_dynar_t xbt_cfg_get_dynar ( xbt_cfg_t  cfg,
const char *  name 
)

Retrieve the dynar of all the values stored in a variable.

Parameters
cfgwhere to search in
namewhat to search for

Get the data stored in the config set.

Warning
the returned value is the actual content of the config set