SimGrid 3.7.1
Scalable simulation of distributed systems
Typedefs | Functions
User interface: changing values
Configuration support

Typedefs

typedef void * xbt_cfg_t
 Configuration set's data type is opaque.

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.
void xbt_cfg_set_vargs (xbt_cfg_t cfg, const char *name, va_list pa)
 va_args version of xbt_cfg_set
void xbt_cfg_set_parse (xbt_cfg_t cfg, const char *options)
 Add values parsed from a string into a config set.
void xbt_cfg_set_int (xbt_cfg_t cfg, const char *name, int val)
 Set or add an integer value to name within cfg.
void xbt_cfg_set_double (xbt_cfg_t cfg, const char *name, double val)
 Set or add a double value to name within cfg.
void xbt_cfg_set_string (xbt_cfg_t cfg, const char *name, const char *val)
 Set or add a string value to name within cfg.
void xbt_cfg_set_peer (xbt_cfg_t cfg, const char *name, const char *peer, int port)
 Set or add an peer value to name within cfg.
void xbt_cfg_setdefault_int (xbt_cfg_t cfg, const char *name, int val)
 Set an integer value to name within cfg if it wasn't changed yet.
void xbt_cfg_setdefault_double (xbt_cfg_t cfg, const char *name, double val)
 Set an integer value to name within cfg if it wasn't changed yet.
void xbt_cfg_setdefault_string (xbt_cfg_t cfg, const char *name, const char *val)
 Set a string value to name within cfg if it wasn't changed yet.
void xbt_cfg_setdefault_peer (xbt_cfg_t cfg, const char *name, const char *host, int port)
 Set a peer value to name within cfg if it wasn't changed yet.
void xbt_cfg_rm_int (xbt_cfg_t cfg, const char *name, int val)
 Remove the provided val integer value from a variable.
void xbt_cfg_rm_double (xbt_cfg_t cfg, const char *name, double val)
 Remove the provided val double value from a variable.
void xbt_cfg_rm_string (xbt_cfg_t cfg, const char *name, const char *val)
 Remove the provided val string value from a variable.
void xbt_cfg_rm_peer (xbt_cfg_t cfg, const char *name, const char *peer, int port)
 Remove the provided val peer value from a variable.
void xbt_cfg_rm_at (xbt_cfg_t cfg, const char *name, int pos)
 Remove the pos th value from the provided variable.
void xbt_cfg_empty (xbt_cfg_t cfg, const char *name)
 Remove all the values from a variable.

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


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.

  • cfg config set to fill
  • name variable name
  • varargs variable value
void xbt_cfg_set_vargs ( xbt_cfg_t  cfg,
const char *  name,
va_list  pa 
)

va_args version of xbt_cfg_set

  • cfg config set to fill
  • n variable name
  • pa variable value

Add some values to the config set.

void xbt_cfg_set_parse ( xbt_cfg_t  cfg,
const char *  options 
)

Add values parsed from a string into a config set.

  • cfg config set to fill
  • options a 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 registred variable, and [value] conforms to the data type under which this variable was registred.
Todo:
This is a crude manual parser, it should be a proper lexer.
void xbt_cfg_set_int ( xbt_cfg_t  cfg,
const char *  name,
int  val 
)

Set or add an integer value to name within cfg.

  • cfg the config set
  • name the name of the variable
  • val the value of the variable
void xbt_cfg_set_double ( xbt_cfg_t  cfg,
const char *  name,
double  val 
)

Set or add a double value to name within cfg.

  • cfg the config set
  • name the name of the variable
  • val the doule to set
void xbt_cfg_set_string ( xbt_cfg_t  cfg,
const char *  name,
const char *  val 
)

Set or add a string value to name within cfg.

  • cfg the config set
  • name the name of the variable
  • val the value to be added
void xbt_cfg_set_peer ( xbt_cfg_t  cfg,
const char *  name,
const char *  peer,
int  port 
)

Set or add an peer value to name within cfg.

  • cfg the config set
  • name the name of the variable
  • peer the peer
  • port the port number

peer values are composed of a string (peername) and an integer (port)

void xbt_cfg_setdefault_int ( xbt_cfg_t  cfg,
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 ( xbt_cfg_t  cfg,
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 ( xbt_cfg_t  cfg,
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_peer ( xbt_cfg_t  cfg,
const char *  name,
const char *  host,
int  port 
)

Set a peer 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_rm_int ( xbt_cfg_t  cfg,
const char *  name,
int  val 
)

Remove the provided val integer value from a variable.

  • cfg the config set
  • name the name of the variable
  • val the value to be removed
void xbt_cfg_rm_double ( xbt_cfg_t  cfg,
const char *  name,
double  val 
)

Remove the provided val double value from a variable.

  • cfg the config set
  • name the name of the variable
  • val the value to be removed
void xbt_cfg_rm_string ( xbt_cfg_t  cfg,
const char *  name,
const char *  val 
)

Remove the provided val string value from a variable.

  • cfg the config set
  • name the name of the variable
  • val the value of the string which will be removed
void xbt_cfg_rm_peer ( xbt_cfg_t  cfg,
const char *  name,
const char *  peer,
int  port 
)

Remove the provided val peer value from a variable.

  • cfg the config set
  • name the name of the variable
  • peer the peername
  • port the port number
void xbt_cfg_empty ( xbt_cfg_t  cfg,
const char *  name 
)

Remove all the values from a variable.

  • cfg the config set
  • name the name of the variable


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