Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a bunch of memleaks
[simgrid.git] / src / surf / surfxml_parse.c
index b83d168..aec1820 100644 (file)
@@ -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);
 }