Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Further parser cleanups
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Nov 2011 15:33:11 +0000 (16:33 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Nov 2011 15:33:11 +0000 (16:33 +0100)
- Kill useless function chaining
- Deprecate the ETag_host in XML now that it's useless

include/surf/surfxml_parse.h
src/surf/surf_routing.c
src/surf/surf_routing_cluster.c
src/surf/surfxml_parse.c

index a1c1d92..4b7a25a 100644 (file)
@@ -17,7 +17,6 @@ SG_BEGIN_DECL()
 /* Hook for the different tags. All the functions which pointer to are push into here are run when the tag is encountered */
 XBT_PUBLIC_DATA(xbt_dynar_t) STag_surfxml_platform_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_platform_cb_list;
 /* Hook for the different tags. All the functions which pointer to are push into here are run when the tag is encountered */
 XBT_PUBLIC_DATA(xbt_dynar_t) STag_surfxml_platform_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_platform_cb_list;
-XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_host_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_router_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) STag_surfxml_link_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_link_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_router_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) STag_surfxml_link_cb_list;
 XBT_PUBLIC_DATA(xbt_dynar_t) ETag_surfxml_link_cb_list;
index e96b00c..ca28b7a 100644 (file)
@@ -172,17 +172,6 @@ static void parse_S_host(const char *host_id, const char* coord)
   }
 }
 
   }
 }
 
-static void parse_E_host(void)
-{
-        xbt_dict_cursor_t cursor = NULL;
-         char *key;
-         char *elem;
-
-         xbt_dict_foreach(current_property_set, cursor, key, elem) {
-                 XBT_DEBUG("property : %s = %s",key,elem);
-               }
-}
-
 /*
  * \brief Add a host to the network element list from XML
  */
 /*
  * \brief Add a host to the network element list from XML
  */
@@ -190,19 +179,6 @@ static void parse_S_host_XML(sg_platf_host_cbarg_t h)
 {
        parse_S_host(h->V_host_id, h->V_host_coord);
 }
 {
        parse_S_host(h->V_host_id, h->V_host_coord);
 }
-static void parse_E_host_XML(void)
-{
-       parse_E_host();
-}
-
-/*
- * \brief Add a host to the network element list from lua script
- */
-static void parse_S_host_lua(const char *host_id, const char *coord)
-{
-  parse_S_host(host_id, coord);
-}
-
 
 /**
  * \brief Add a "router" to the network element list
 
 /**
  * \brief Add a "router" to the network element list
@@ -961,7 +937,6 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_
 
   /* parse generic elements */
   sg_platf_host_add_cb(parse_S_host_XML);
 
   /* parse generic elements */
   sg_platf_host_add_cb(parse_S_host_XML);
-  surfxml_add_callback(ETag_surfxml_host_cb_list, &parse_E_host_XML);
   sg_platf_router_add_cb(parse_S_router);
 
   surfxml_add_callback(STag_surfxml_route_cb_list,
   sg_platf_router_add_cb(parse_S_router);
 
   surfxml_add_callback(STag_surfxml_route_cb_list,
@@ -1573,7 +1548,6 @@ void routing_parse_Scluster(void)
                }
                surf_parse_link();
 
                }
                surf_parse_link();
 
-               ETag_surfxml_host();
                ETag_surfxml_link();
 
                surf_parsing_link_up_down_t info = xbt_new0(s_surf_parsing_link_up_down_t, 1);
                ETag_surfxml_link();
 
                surf_parsing_link_up_down_t info = xbt_new0(s_surf_parsing_link_up_down_t, 1);
@@ -1668,7 +1642,6 @@ void routing_parse_Scluster(void)
                }
                surf_parse_link();
 
                }
                surf_parse_link();
 
-               ETag_surfxml_host();
                ETag_surfxml_link();
 
                surf_parsing_link_up_down_t info = xbt_new0(s_surf_parsing_link_up_down_t, 1);
                ETag_surfxml_link();
 
                surf_parsing_link_up_down_t info = xbt_new0(s_surf_parsing_link_up_down_t, 1);
@@ -2049,7 +2022,7 @@ static void routing_parse_Erandom(void)
 
 void routing_add_host(const char *host_id)
 {
 
 void routing_add_host(const char *host_id)
 {
-  parse_S_host_lua((char *) host_id, (char*)""); // FIXME propagate coordinate system to lua
+  parse_S_host(host_id, ""); // FIXME propagate coordinate system to lua
 }
 
 /*
 }
 
 /*
index 5236ef7..5438a30 100644 (file)
@@ -22,22 +22,10 @@ typedef struct {
   xbt_dict_t dict_autonomous_systems;
 } s_routing_component_cluster_t, *routing_component_cluster_t;
 
   xbt_dict_t dict_autonomous_systems;
 } s_routing_component_cluster_t, *routing_component_cluster_t;
 
-/* Parse routing model functions */
-
-static route_extended_t cluster_get_route(routing_component_t rc,
-                                            const char *src,
-                                            const char *dst);
-
 /* Business methods */
 static route_extended_t cluster_get_route(routing_component_t rc,
                                             const char *src,
 /* Business methods */
 static route_extended_t cluster_get_route(routing_component_t rc,
                                             const char *src,
-                                            const char *dst)
-{
-         xbt_assert(rc && src
-                     && dst,
-                     "Invalid params for \"get_route\" function at AS \"%s\"",
-                     rc->name);
-
+                                            const char *dst) {
 
          xbt_dynar_t links_list = xbt_dynar_new(global_routing->size_of_link, NULL);
 
 
          xbt_dynar_t links_list = xbt_dynar_new(global_routing->size_of_link, NULL);
 
index bc2e199..894e405 100644 (file)
@@ -51,7 +51,6 @@ int surf_parse_get_int(const char *string) {
 //xbt_dynar_t STag_surfxml_host_cb_list = NULL;
 xbt_dynar_t STag_surfxml_platform_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_platform_cb_list = NULL;
 //xbt_dynar_t STag_surfxml_host_cb_list = NULL;
 xbt_dynar_t STag_surfxml_platform_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_platform_cb_list = NULL;
-xbt_dynar_t ETag_surfxml_host_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_router_cb_list = NULL;
 xbt_dynar_t STag_surfxml_link_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_link_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_router_cb_list = NULL;
 xbt_dynar_t STag_surfxml_link_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_link_cb_list = NULL;
@@ -161,7 +160,6 @@ void surf_parse_init_callbacks(void)
              xbt_dynar_new(sizeof(void_f_void_t), NULL);
 
          sg_platf_init();
              xbt_dynar_new(sizeof(void_f_void_t), NULL);
 
          sg_platf_init();
-         ETag_surfxml_host_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
          ETag_surfxml_router_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
          STag_surfxml_link_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
          ETag_surfxml_link_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
          ETag_surfxml_router_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
          STag_surfxml_link_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
          ETag_surfxml_link_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
@@ -225,7 +223,6 @@ void surf_parse_free_callbacks(void)
 
   xbt_dynar_free(&STag_surfxml_platform_cb_list);
   xbt_dynar_free(&ETag_surfxml_platform_cb_list);
 
   xbt_dynar_free(&STag_surfxml_platform_cb_list);
   xbt_dynar_free(&ETag_surfxml_platform_cb_list);
-  xbt_dynar_free(&ETag_surfxml_host_cb_list);
   xbt_dynar_free(&ETag_surfxml_router_cb_list);
   xbt_dynar_free(&STag_surfxml_link_cb_list);
   xbt_dynar_free(&ETag_surfxml_link_cb_list);
   xbt_dynar_free(&ETag_surfxml_router_cb_list);
   xbt_dynar_free(&STag_surfxml_link_cb_list);
   xbt_dynar_free(&ETag_surfxml_link_cb_list);
@@ -310,11 +307,10 @@ void STag_surfxml_host(void){
        host.V_host_coord = A_surfxml_host_coordinates;
 
        sg_platf_new_host(&host);
        host.V_host_coord = A_surfxml_host_coordinates;
 
        sg_platf_new_host(&host);
-}
-void ETag_surfxml_host(void){
+
   current_property_set = NULL;
   current_property_set = NULL;
-       surfxml_call_cb_functions(ETag_surfxml_host_cb_list);
 }
 }
+void ETag_surfxml_host(void){ /* ignored -- do not add content here */ }
 
 
 void STag_surfxml_router(void){
 
 
 void STag_surfxml_router(void){