Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use a sane way to declare postparse callbacks, now that this way exists
[simgrid.git] / src / surf / surfxml_parseplatf.c
index 894dc9e..9f2e6de 100644 (file)
@@ -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)
  */
 
-sg_platf_router_cbarg_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
@@ -140,14 +136,6 @@ static void parse_Stag_trace_connect(void)
   }
 }
 
-/* Call the right C function when we see the <AS> 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)
@@ -168,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_ASclose_add_cb(routing_AS_close);
+  sg_platf_ASopen_add_cb(routing_AS_open);
 }
 
 static void free_data(void)
@@ -193,7 +181,7 @@ void parse_platform_file(const char *file)
 
   /* Register classical callbacks */
   surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties_XML);
-  surf_parse_add_callback_config();
+  routing_register_callbacks();
 
   surfxml_buffer_stack_stack_ptr = 1;
   surfxml_buffer_stack_stack[0] = 0;
@@ -205,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();
 }