SimGrid
Functions
Getting the stored values
Configuration support

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)
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)
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)
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)
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.
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.
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)

  • cfg the config set
  • name the name of the variable
  • val the wanted value

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)

  • cfg the config set
  • name the name of the variable
  • val the wanted value

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)

  • th the config set
  • name the name of the variable
  • val the wanted value

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
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)

  • cfg the config set
  • name the name of the variable
  • peer the peer
  • port the 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.

  • cfg where to search in
  • name what to search for
  • dynar result

Get the data stored in the config set.

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


Back to the main Simgrid Documentation page The version of Simgrid documented here is v3.6.1.
Documentation of other versions can be found in their respective archive files (directory doc/html).
Generated for SimGridAPI by doxygen