+/** @brief Set an integer value to \a name within \a 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_int(xbt_cfg_t cfg, const char *name, int val)
+{
+ xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
+
+ if (variable->isdefault){
+ xbt_cfg_set_int(cfg, name, val);
+ variable->isdefault = 1;
+ }
+ else
+ XBT_DEBUG
+ ("Do not override configuration variable '%s' with value '%d' because it was already set.",
+ name, val);
+}
+
+/** @brief Set an integer value to \a name within \a 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)
+{
+ xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
+
+ if (variable->isdefault) {
+ xbt_cfg_set_double(cfg, name, val);
+ variable->isdefault = 1;
+ }
+ else
+ XBT_DEBUG
+ ("Do not override configuration variable '%s' with value '%lf' because it was already set.",
+ name, val);
+}
+
+/** @brief Set a string value to \a name within \a 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)
+{
+ xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
+
+ if (variable->isdefault){
+ xbt_cfg_set_string(cfg, name, val);
+ variable->isdefault = 1;
+ }
+ else
+ XBT_DEBUG
+ ("Do not override configuration variable '%s' with value '%s' because it was already set.",
+ name, val);
+}
+
+/** @brief Set a peer value to \a name within \a 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)
+{
+ xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
+
+ if (variable->isdefault){
+ xbt_cfg_set_peer(cfg, name, host, port);
+ variable->isdefault = 1;
+ }
+ else
+ XBT_DEBUG
+ ("Do not override configuration variable '%s' with value '%s:%d' because it was already set.",
+ name, host, port);
+}
+