X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d435bdefd34324ed0b0c25d1b6eb6dd3b7344524..d740a86eb8bb0e5d729e0ad55db7395444dad131:/src/surf/surfxml_parse.c?ds=sidebyside diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 30b70dfcc5..aec18201b2 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -8,7 +8,7 @@ #include "xbt/log.h" #include "xbt/str.h" #include "xbt/dict.h" -#include "surf/surfxml_parse_private.h" +#include "surf/surfxml_parse.h" #include "surf/surf_private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, @@ -128,7 +128,7 @@ int ETag_surfxml_include_state(void) { fflush(NULL); XBT_INFO("ETag_surfxml_include_state '%s'",A_surfxml_include_file); - if(xbt_dynar_length(surf_input_buffer_stack)!= 0) + if(!xbt_dynar_is_empty(surf_input_buffer_stack)) return 1; fclose(surf_file_to_parse); xbt_dynar_pop(surf_file_to_parse_stack, &surf_file_to_parse); @@ -566,31 +566,15 @@ static XBT_INLINE void surfxml_call_cb_functions(xbt_dynar_t cb_list) /* Prop tag functions */ -void parse_properties(const char* prop_id, const char* prop_value) -{ - if (!current_property_set) - current_property_set = xbt_dict_new(); // Maybe, it should raise an error - if(!strcmp(prop_id,"coordinates")){ - if(!strcmp(prop_value,"yes") && !COORD_HOST_LEVEL) - { - XBT_INFO("Configuration change: Set '%s' to '%s'", prop_id, prop_value); - COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp); - COORD_ASR_LEVEL = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp); - } - if(strcmp(A_surfxml_prop_value,"yes")) - xbt_die("Setting XML prop coordinates must be \"yes\""); - } - else{ - xbt_dict_set(current_property_set, prop_id, xbt_strdup(prop_value), free); - } -} - /** * With XML parser */ -void parse_properties_XML(void) +void parse_properties(void) { - parse_properties(A_surfxml_prop_id, A_surfxml_prop_value); + if (!current_property_set) + current_property_set = xbt_dict_new(); // Maybe, it should raise an error + + xbt_dict_set(current_property_set, A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value), free); }