+void xbt_cfg_register_alias(xbt_cfg_t * cfg, const char *newname, const char *oldname)
+{
+ if (*cfg == NULL)
+ *cfg = xbt_cfg_new();
+
+ xbt_cfgelm_t res = xbt_dict_get_or_null((xbt_dict_t) * cfg, oldname);
+ xbt_assert(NULL == res, "Refusing to register the option '%s' twice.", oldname);
+
+ res = xbt_dict_get_or_null((xbt_dict_t) * cfg, newname);
+ xbt_assert(res, "Cannot define an alias to the non-existing option '%s'.", newname);
+
+ res = xbt_new0(s_xbt_cfgelm_t, 1);
+ XBT_DEBUG("Register cfg alias %s -> %s in set %p)",oldname,newname, *cfg);
+
+ res->desc = bprintf("Deprecated alias for %s",newname);
+ res->type = xbt_cfgelm_alias;
+ res->min = 1;
+ res->max = 1;
+ res->isdefault = 1;
+ res->content = (xbt_dynar_t)newname;
+
+ xbt_dict_set((xbt_dict_t) * cfg, oldname, res, NULL);
+}
+