X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2db530ae7af2f2d5b9b80877117816279279d7c3..c93a420f2f61da48ace7828257e97b593ae76251:/src/surf/surfxml_parse.c diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 72665c9635..312fdd9870 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -86,6 +86,8 @@ xbt_dynar_t STag_surfxml_ASroute_cb_list = NULL; xbt_dynar_t ETag_surfxml_ASroute_cb_list = NULL; xbt_dynar_t STag_surfxml_bypassRoute_cb_list = NULL; xbt_dynar_t ETag_surfxml_bypassRoute_cb_list = NULL; +xbt_dynar_t STag_surfxml_bypassASroute_cb_list = NULL; +xbt_dynar_t ETag_surfxml_bypassASroute_cb_list = NULL; xbt_dynar_t STag_surfxml_include_cb_list = NULL; xbt_dynar_t ETag_surfxml_include_cb_list = NULL; @@ -125,7 +127,7 @@ void ETag_surfxml_storage(void) memset(&storage,0,sizeof(storage)); storage.id = A_surfxml_storage_id; - storage.type_id = A_surfxml_storage_id; + storage.type_id = A_surfxml_storage_typeId; sg_platf_new_storage(&storage); } void STag_surfxml_storage_type(void) @@ -139,7 +141,7 @@ void ETag_surfxml_storage_type(void) memset(&storage_type,0,sizeof(storage_type)); storage_type.content = A_surfxml_storage_type_content; - storage_type.type_id = A_surfxml_storage_type_id; + storage_type.id = A_surfxml_storage_type_id; storage_type.model = A_surfxml_storage_type_model; storage_type.properties = current_property_set; sg_platf_new_storage_type(&storage_type); @@ -155,7 +157,7 @@ void ETag_surfxml_mstorage(void) memset(&mstorage,0,sizeof(mstorage)); mstorage.name = A_surfxml_mstorage_name; - mstorage.type_id = A_surfxml_mstorage_type_id; + mstorage.type_id = A_surfxml_mstorage_typeId; sg_platf_new_mstorage(&mstorage); } void STag_surfxml_mount(void) @@ -181,7 +183,7 @@ static xbt_dynar_t surf_parsed_filename_stack = NULL; void STag_surfxml_include(void) { - XBT_INFO("STag_surfxml_include '%s'",A_surfxml_include_file); + XBT_DEBUG("STag_surfxml_include '%s'",A_surfxml_include_file); xbt_dynar_push(surf_parsed_filename_stack,&surf_parsed_filename); // save old file name surf_parsed_filename = xbt_strdup(A_surfxml_include_file); @@ -216,22 +218,22 @@ void ETag_surfxml_include(void) { int ETag_surfxml_include_state(void) { fflush(NULL); - XBT_INFO("ETag_surfxml_include_state '%s'",A_surfxml_include_file); + XBT_DEBUG("ETag_surfxml_include_state '%s'",A_surfxml_include_file); - if(!xbt_dynar_is_empty(surf_input_buffer_stack)) // nope, that's a true premature EOF. Let the parser die verbosely. - return 1; + if(xbt_dynar_is_empty(surf_input_buffer_stack)) // nope, that's a true premature EOF. Let the parser die verbosely. + return 0; // Yeah, we were in an Restore state and proceed. fclose(surf_file_to_parse); xbt_dynar_pop(surf_file_to_parse_stack, &surf_file_to_parse); surf_parse_pop_buffer_state(); - xbt_dynar_pop(surf_input_buffer_stack,surf_input_buffer); + xbt_dynar_pop(surf_input_buffer_stack,&surf_input_buffer); // Restore the filename for error messages free(surf_parsed_filename); xbt_dynar_pop(surf_parsed_filename_stack,&surf_parsed_filename); - return 0; + return 1; } @@ -271,6 +273,10 @@ void surf_parse_init_callbacks(void) xbt_dynar_new(sizeof(void_f_void_t), NULL); ETag_surfxml_bypassRoute_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL); + STag_surfxml_bypassASroute_cb_list = + xbt_dynar_new(sizeof(void_f_void_t), NULL); + ETag_surfxml_bypassASroute_cb_list = + xbt_dynar_new(sizeof(void_f_void_t), NULL); STag_surfxml_peer_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL); ETag_surfxml_peer_cb_list = @@ -320,6 +326,8 @@ void surf_parse_free_callbacks(void) xbt_dynar_free(&ETag_surfxml_ASroute_cb_list); xbt_dynar_free(&STag_surfxml_bypassRoute_cb_list); xbt_dynar_free(&ETag_surfxml_bypassRoute_cb_list); + xbt_dynar_free(&STag_surfxml_bypassASroute_cb_list); + xbt_dynar_free(&ETag_surfxml_bypassASroute_cb_list); xbt_dynar_free(&STag_surfxml_peer_cb_list); xbt_dynar_free(&ETag_surfxml_peer_cb_list); xbt_dynar_free(&STag_surfxml_include_cb_list); @@ -557,6 +565,9 @@ void STag_surfxml_ASroute(void){ void STag_surfxml_bypassRoute(void){ surfxml_call_cb_functions(STag_surfxml_bypassRoute_cb_list); } +void STag_surfxml_bypassASroute(void){ + surfxml_call_cb_functions(STag_surfxml_bypassASroute_cb_list); +} void STag_surfxml_config(void){ XBT_DEBUG("START configuration name = %s",A_surfxml_config_id); xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)"); @@ -594,6 +605,7 @@ parse_method(E, trace_connect) parse_method(E, random) parse_method(E, ASroute) parse_method(E, bypassRoute) +parse_method(E, bypassASroute) /* Open and Close parse file */ @@ -615,8 +627,8 @@ void surf_parse_open(const char *file) if (!surf_file_to_parse_stack) surf_file_to_parse_stack = xbt_dynar_new(sizeof(FILE *), NULL); - if (!surf_file_to_parse_stack) - surf_parsed_filename_stack = xbt_dynar_new(sizeof(FILE *), xbt_free_f); + if (!surf_parsed_filename_stack) + surf_parsed_filename_stack = xbt_dynar_new(sizeof(char *), &xbt_free_ref); surf_parsed_filename = xbt_strdup(file); surf_file_to_parse = surf_fopen(file, "r");