}
*(val++) = '\0';
- DEBUG2("Configuration change: Set '%s' to '%s'", name, val);
+ if (strcmp(name,"contexts/factory"))
+ INFO2("Configuration change: Set '%s' to '%s'", name, val);
TRY {
variable = xbt_dict_get((xbt_dict_t) cfg, name);
{
xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
- if (variable->isdefault)
+ if (variable->isdefault){
xbt_cfg_set_int(cfg, name, val);
- else
+ variable->isdefault = 1;
+ }
+ else
DEBUG2
("Do not override configuration variable '%s' with value '%d' because it was already set.",
name, val);
{
xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
- if (variable->isdefault)
+ if (variable->isdefault) {
xbt_cfg_set_double(cfg, name, val);
+ variable->isdefault = 1;
+ }
else
DEBUG2
("Do not override configuration variable '%s' with value '%lf' because it was already set.",
{
xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
- if (variable->isdefault)
+ if (variable->isdefault){
xbt_cfg_set_string(cfg, name, val);
+ variable->isdefault = 1;
+ }
else
DEBUG2
("Do not override configuration variable '%s' with value '%s' because it was already set.",
{
xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
- if (variable->isdefault)
+ if (variable->isdefault){
xbt_cfg_set_peer(cfg, name, host, port);
+ variable->isdefault = 1;
+ }
else
DEBUG3
("Do not override configuration variable '%s' with value '%s:%d' because it was already set.",
xbt_dynar_reset(variable->content);
}
}
+/*
+ * Say if the value is the default value
+ */
+int xbt_cfg_is_default_value(xbt_cfg_t cfg, const char *name)
+{
+ xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_any);
+ return variable->isdefault;
+}
/*----[ Getting ]---------------------------------------------------------*/