X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0ca1291c2f63ca6235f4b4885c48413a900aade4..5e61205077b453d1460c7008d1af3a68e6667db6:/src/xbt/config.c diff --git a/src/xbt/config.c b/src/xbt/config.c index a5207db770..0e532308ef 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -18,7 +18,12 @@ #include "xbt/peer.h" #include "xbt/config.h" /* prototypes of this module */ -#include "surf/surf.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */ +#include "surf/surf_routing.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */ + +xbt_lib_t host_lib; +int COORD_HOST_LEVEL; //Coordinates level +xbt_lib_t as_router_lib; +int COORD_ASR_LEVEL; //Coordinates level XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support"); @@ -292,7 +297,7 @@ void xbt_cfg_unregister(xbt_cfg_t cfg, const char *name) * Each of them must use the following syntax: \:\_to_\_\ * with type being one of 'string','int', 'peer' or 'double'. * - * @fixme: this does not allow to set the description + * FIXME: this does not allow to set the description */ void xbt_cfg_register_str(xbt_cfg_t * cfg, const char *entry) @@ -663,21 +668,21 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) xbt_die("Setting CMD prop coordinates must be \"yes\""); } - if (strcmp(name,"contexts/factory")) + if (strncmp(name, "contexts/", strlen("contexts/"))) XBT_INFO("Configuration change: Set '%s' to '%s'", name, val); TRY { variable = xbt_dict_get((xbt_dict_t) cfg, name); } CATCH(e) { - /* put it back on what won't get freed, ie within "options" and out of "optionlist_cpy" */ - name = (char *) (optionlist_cpy - name + options); - free(optionlist_cpy); if (e.category == not_found_error) { xbt_ex_free(e); + name = xbt_strdup(name); + free(optionlist_cpy); THROWF(not_found_error, 0, "No registered variable corresponding to '%s'.", name); } + free(optionlist_cpy); RETHROW; }