SimGrid  3.13
Versatile Simulation of Distributed Systems
User interface: changing values

This is the only interface you should use unless you want to let your own code become configurable with this. More...

Typedefs

typedef voidxbt_cfg_t
 Configuration set's data type is opaque. More...
 

Functions

void xbt_cfg_set (xbt_cfg_t cfg, const char *name,...)
 Add a NULL-terminated list of pairs {(char*)key, value} to the set. More...
 
void xbt_cfg_set_vargs (xbt_cfg_t cfg, const char *name, va_list pa)
 va_args version of xbt_cfg_set More...
 
void xbt_cfg_set_parse (const char *options)
 Add values parsed from a string into a config set. More...
 
void xbt_cfg_set_int (const char *name, int val)
 Set an integer value to name within cfg. More...
 
void xbt_cfg_set_double (const char *name, double val)
 Set or add a double value to name within cfg. More...
 
void xbt_cfg_set_string (const char *name, const char *val)
 Set or add a string value to name within cfg. More...
 
void xbt_cfg_set_boolean (const char *name, const char *val)
 Set or add a boolean value to name within cfg. More...
 
voidxbt_cfg_set_as_string (const char *name, const char *val)
 Set the value of a variable, using the string representation of that value. More...
 
void xbt_cfg_setdefault_int (const char *name, int val)
 Set an integer value to name within cfg if it wasn't changed yet. More...
 
void xbt_cfg_setdefault_double (const char *name, double val)
 Set an integer value to name within cfg if it wasn't changed yet. More...
 
void xbt_cfg_setdefault_string (const char *name, const char *val)
 Set a string value to name within cfg if it wasn't changed yet. More...
 
void xbt_cfg_setdefault_boolean (const char *name, const char *val)
 Set an boolean value to name within cfg if it wasn't changed yet. More...
 
int xbt_cfg_is_default_value (const char *name)
 Return if configuration is set by default. More...
 

Detailed Description

This is the only interface you should use unless you want to let your own code become configurable with this.

If the variable accept at most one value, those functions replace the current value with the provided one. If max>1, the provided value is appended to the list.

string values are strdup'ed before use, so you can (and should) free your copy

Typedef Documentation

typedef void* xbt_cfg_t

Configuration set's data type is opaque.

Function Documentation

void xbt_cfg_set ( xbt_cfg_t  cfg,
const char *  name,
  ... 
)

Add a NULL-terminated list of pairs {(char*)key, value} to the set.

Parameters
cfgconfig set to fill
namevariable name
...variable value
void xbt_cfg_set_vargs ( xbt_cfg_t  cfg,
const char *  name,
va_list  pa 
)

va_args version of xbt_cfg_set

Parameters
cfgconfig set to fill
namevariable name
pavariable value

Add some values to the config set.

void xbt_cfg_set_parse ( const char *  options)

Add values parsed from a string into a config set.

Parameters
optionsa string containing the content to add to the config set. This is a '\t',' ' or '\n' or ',' separated list of variables. Each individual variable is like "[name]:[value]" where [name] is the name of an already registered variable, and [value] conforms to the data type under which this variable was registered.
void xbt_cfg_set_int ( const char *  name,
int  val 
)

Set an integer value to name within cfg.

Parameters
namethe name of the variable
valthe value of the variable
void xbt_cfg_set_double ( const char *  name,
double  val 
)

Set or add a double value to name within cfg.

Parameters
namethe name of the variable
valthe double to set
void xbt_cfg_set_string ( const char *  name,
const char *  val 
)

Set or add a string value to name within cfg.

Parameters
cfgthe config set
namethe name of the variable
valthe value to be added
void xbt_cfg_set_boolean ( const char *  name,
const char *  val 
)

Set or add a boolean value to name within cfg.

Parameters
namethe name of the variable
valthe value of the variable
void* xbt_cfg_set_as_string ( const char *  key,
const char *  value 
)

Set the value of a variable, using the string representation of that value.

Parameters
keyname of the variable to modify
valuestring representation of the value to set
Returns
the first char after the parsed value in val
void xbt_cfg_setdefault_int ( const char *  name,
int  val 
)

Set an integer value to name within cfg if it wasn't changed yet.

This is useful to change the default value of a variable while allowing users to override it with command line arguments

void xbt_cfg_setdefault_double ( const char *  name,
double  val 
)

Set an integer value to name within cfg if it wasn't changed yet.

This is useful to change the default value of a variable while allowing users to override it with command line arguments

void xbt_cfg_setdefault_string ( const char *  name,
const char *  val 
)

Set a string value to name within cfg if it wasn't changed yet.

This is useful to change the default value of a variable while allowing users to override it with command line arguments

void xbt_cfg_setdefault_boolean ( const char *  name,
const char *  val 
)

Set an boolean value to name within cfg if it wasn't changed yet.

This is useful to change the default value of a variable while allowing users to override it with command line arguments

int xbt_cfg_is_default_value ( const char *  name)

Return if configuration is set by default.