SimGrid: Getting the stored values

SimGrid 3.10 Versatile Simulation of Distributed Systems

- Home page
- Online documentation
- Dev's Corner

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
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)
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)
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.
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

  cfg | the config set
  name | the 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

  cfg | the config set
  name | the 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

  cfg | the config set
  name | the 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

  cfg | the config set
  name | the 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

  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.

Parameters

  cfg | where to search in
  name | what to search for

Get the data stored in the config set.

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