X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5bcfbaff5a82e40d9a5d1861f073fc0befbd7f1b..8cc10e99f53995bc7486e4467b4e6ad8d7be3460:/src/surf/surfxml_parseplatf.c diff --git a/src/surf/surfxml_parseplatf.c b/src/surf/surfxml_parseplatf.c index 9cfd8ea2c0..4fa418fcfa 100644 --- a/src/surf/surfxml_parseplatf.c +++ b/src/surf/surfxml_parseplatf.c @@ -53,11 +53,7 @@ void surfxml_bufferstack_pop(int new) * Pass arguments to parsing callback as structures to save some time (and allow callbacks to ignore some) */ -surf_parsing_router_arg_t struct_router = NULL; surf_parsing_cluster_arg_t struct_cluster = NULL; -surf_parsing_peer_arg_t struct_peer = NULL; -surf_parsing_link_arg_t struct_lnk = NULL; - /* * Trace related stuff @@ -78,7 +74,7 @@ static void parse_Stag_trace(void) { trace_id = xbt_strdup(A_surfxml_trace_id); trace_file = xbt_strdup(A_surfxml_trace_file); - surf_parse_get_double(&trace_periodicity, A_surfxml_trace_periodicity); + trace_periodicity = surf_parse_get_double(A_surfxml_trace_periodicity); } static void parse_Etag_trace(void) @@ -140,15 +136,6 @@ static void parse_Stag_trace_connect(void) } } -/* Call the right C function when we see the tags */ -static void parse_S_AS(void) { - sg_platf_new_AS_open(A_surfxml_AS_id, A_surfxml_AS_routing); -} -static void parse_E_AS(void) { - sg_platf_new_AS_close(); -} - - /* Init and free parse data */ static void init_data(void) @@ -169,8 +156,8 @@ static void init_data(void) &parse_Stag_trace_connect); /* we care about the ASes while parsing the platf. Incredible, isnt it? */ - surfxml_add_callback(STag_surfxml_AS_cb_list, &parse_S_AS); - surfxml_add_callback(ETag_surfxml_AS_cb_list, &parse_E_AS); + sg_platf_AS_end_add_cb(routing_AS_end); + sg_platf_AS_begin_add_cb(routing_AS_begin); } static void free_data(void) @@ -191,7 +178,10 @@ void parse_platform_file(const char *file) int parse_status; surf_parse_reset_callbacks(); - surf_parse_add_callback_config(); + + /* Register classical callbacks */ + surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties_XML); + routing_register_callbacks(); surfxml_buffer_stack_stack_ptr = 1; surfxml_buffer_stack_stack[0] = 0; @@ -203,7 +193,5 @@ void parse_platform_file(const char *file) surf_parse_close(); if (parse_status) xbt_die("Parse error in %s", file); - - surf_config_models_create_elms(); }