#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,
{
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);
/* 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);
}