From: Martin Quinson Date: Mon, 7 Nov 2011 15:33:11 +0000 (+0100) Subject: Further parser cleanups X-Git-Tag: exp_20120216~455 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9970cff0913d40427d9007333bfee5af3a4d2163?hp=ff60e8360c97b7f1aee73c97d10480792b5dc2b3 Further parser cleanups - Kill useless function chaining - Deprecate the ETag_host in XML now that it's useless --- diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index a1c1d922f0..4b7a25a8ab 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -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; -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; diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index e96b00c5aa..ca28b7a9eb 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -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 */ @@ -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); } -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 @@ -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); - 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, @@ -1573,7 +1548,6 @@ void routing_parse_Scluster(void) } 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); @@ -1668,7 +1642,6 @@ void routing_parse_Scluster(void) } 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); @@ -2049,7 +2022,7 @@ static void routing_parse_Erandom(void) 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 } /* diff --git a/src/surf/surf_routing_cluster.c b/src/surf/surf_routing_cluster.c index 5236ef762c..5438a30c08 100644 --- a/src/surf/surf_routing_cluster.c +++ b/src/surf/surf_routing_cluster.c @@ -22,22 +22,10 @@ typedef struct { 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, - 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); diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index bc2e199d6b..894e405d8c 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -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 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; @@ -161,7 +160,6 @@ void surf_parse_init_callbacks(void) 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); @@ -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(&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); @@ -310,11 +307,10 @@ void STag_surfxml_host(void){ host.V_host_coord = A_surfxml_host_coordinates; sg_platf_new_host(&host); -} -void ETag_surfxml_host(void){ + 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){