Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize the way parsing callbacks of the routing submodule are registered
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 8 Nov 2011 21:19:42 +0000 (22:19 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 8 Nov 2011 21:43:40 +0000 (22:43 +0100)
include/surf/surfxml_parse.h
src/surf/surf_private.h
src/surf/surf_routing.c
src/surf/surfxml_parseplatf.c

index 6c01e2f..de18857 100644 (file)
@@ -50,7 +50,6 @@ XBT_PUBLIC(void) surf_parse_free_callbacks(void);
 XBT_PUBLIC(void) surf_parse_error(char *msg);
 XBT_PUBLIC(double) surf_parse_get_double(const char *string);
 XBT_PUBLIC(int) surf_parse_get_int(const char *string);
-XBT_PUBLIC(void) surf_parse_add_callback_config(void);
 XBT_PUBLIC(void) surf_parse_models_setup(void);
 /* Prototypes of the functions offered by flex */
 XBT_PUBLIC(int) surf_parse_lex(void);
index ad8bde9..2534167 100644 (file)
@@ -197,6 +197,7 @@ struct s_routing_global {
 };
 
 XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback, double_f_cpvoid_t get_link_latency_fun);
+XBT_PUBLIC(void) routing_register_callbacks(void);
 
 XBT_PUBLIC(void) routing_parse_Scluster(void);       /* cluster bypass */
 
index 987196f..eaf46a2 100644 (file)
@@ -835,11 +835,14 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_
   get_link_latency = get_link_latency_fun;
   /* no current routing at moment */
   current_routing = NULL;
+}
 
-  /* parse generic elements */
+void routing_register_callbacks() {
   sg_platf_host_add_cb(parse_S_host);
   sg_platf_router_add_cb(parse_S_router);
 
+  surfxml_add_callback(STag_surfxml_random_cb_list, &routing_parse_Srandom);
+
   surfxml_add_callback(STag_surfxml_route_cb_list,
       &parse_S_route_new_and_endpoints_XML);
   surfxml_add_callback(STag_surfxml_ASroute_cb_list,
@@ -867,12 +870,6 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_
 #endif
 }
 
-void surf_parse_add_callback_config(void)
-{
-  surfxml_add_callback(STag_surfxml_random_cb_list, &routing_parse_Srandom);
-}
-
-
 /* ************************************************** */
 /* ********** PATERN FOR NEW ROUTING **************** */
 
index 50e6301..45db0f3 100644 (file)
@@ -181,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;