Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename a function, and kill 2 dead prototypes
[simgrid.git] / src / surf / surfxml_parse.c
index a26f8a1..50c47f4 100644 (file)
@@ -443,7 +443,7 @@ void ETag_surfxml_host(void)    {
   XBT_DEBUG("Buffer: %s", buf);
   host.speed_peak = xbt_dynar_new(sizeof(double), NULL);
   if (strchr(buf, ',') == NULL){
   XBT_DEBUG("Buffer: %s", buf);
   host.speed_peak = xbt_dynar_new(sizeof(double), NULL);
   if (strchr(buf, ',') == NULL){
-         double speed = get_cpu_speed(A_surfxml_host_power);
+         double speed = parse_cpu_speed(A_surfxml_host_power);
          xbt_dynar_push_as(host.speed_peak,double, speed);
   }
   else {
          xbt_dynar_push_as(host.speed_peak,double, speed);
   }
   else {
@@ -455,7 +455,7 @@ void ETag_surfxml_host(void)    {
 
                  xbt_dynar_get_cpy(pstate_list, i, &speed_str);
                  xbt_str_trim(speed_str, NULL);
 
                  xbt_dynar_get_cpy(pstate_list, i, &speed_str);
                  xbt_str_trim(speed_str, NULL);
-                 speed = get_cpu_speed(speed_str);
+                 speed = parse_cpu_speed(speed_str);
                  xbt_dynar_push_as(host.speed_peak, double, speed);
                  XBT_DEBUG("Speed value: %f", speed);
          }
                  xbt_dynar_push_as(host.speed_peak, double, speed);
                  XBT_DEBUG("Speed value: %f", speed);
          }
@@ -472,9 +472,9 @@ void ETag_surfxml_host(void)    {
   xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
         (A_surfxml_host_state == A_surfxml_host_state_OFF), "Invalid state");
   if (A_surfxml_host_state == A_surfxml_host_state_ON)
   xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
         (A_surfxml_host_state == A_surfxml_host_state_OFF), "Invalid state");
   if (A_surfxml_host_state == A_surfxml_host_state_ON)
-    host.initial_state = SURF_RESOURCE_ON;
+    host.initiallyOn = 1;
   if (A_surfxml_host_state == A_surfxml_host_state_OFF)
   if (A_surfxml_host_state == A_surfxml_host_state_OFF)
-    host.initial_state = SURF_RESOURCE_OFF;
+    host.initiallyOn = 1;
   host.coord = A_surfxml_host_coordinates;
 
   sg_platf_new_host(&host);
   host.coord = A_surfxml_host_coordinates;
 
   sg_platf_new_host(&host);
@@ -490,7 +490,7 @@ void STag_surfxml_host___link(void){
   host_link.id        = A_surfxml_host___link_id;
   host_link.link_up   = A_surfxml_host___link_up;
   host_link.link_down = A_surfxml_host___link_down;
   host_link.id        = A_surfxml_host___link_id;
   host_link.link_up   = A_surfxml_host___link_up;
   host_link.link_down = A_surfxml_host___link_down;
-  sg_platf_new_host_link(&host_link);
+  sg_platf_new_netcard(&host_link);
 }
 
 void STag_surfxml_router(void){
 }
 
 void STag_surfxml_router(void){
@@ -637,10 +637,10 @@ void ETag_surfxml_link(void){
 
   switch (A_surfxml_link_state) {
   case A_surfxml_link_state_ON:
 
   switch (A_surfxml_link_state) {
   case A_surfxml_link_state_ON:
-    link.state = SURF_RESOURCE_ON;
+    link.initiallyOn = 1;
     break;
   case A_surfxml_link_state_OFF:
     break;
   case A_surfxml_link_state_OFF:
-    link.state = SURF_RESOURCE_OFF;
+    link.initiallyOn = 0;
     break;
   default:
     surf_parse_error("invalid state for link %s", link.id);
     break;
   default:
     surf_parse_error("invalid state for link %s", link.id);
@@ -698,7 +698,7 @@ void ETag_surfxml_backbone(void){
   link.id = A_surfxml_backbone_id;
   link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth);
   link.latency = surf_parse_get_time(A_surfxml_backbone_latency);
   link.id = A_surfxml_backbone_id;
   link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth);
   link.latency = surf_parse_get_time(A_surfxml_backbone_latency);
-  link.state = SURF_RESOURCE_ON;
+  link.initiallyOn = 1;
   link.policy = SURF_LINK_SHARED;
 
   sg_platf_new_link(&link);
   link.policy = SURF_LINK_SHARED;
 
   sg_platf_new_link(&link);
@@ -773,8 +773,8 @@ void ETag_surfxml_ASroute(void){
   ASroute.src = A_surfxml_ASroute_src;
   ASroute.dst = A_surfxml_ASroute_dst;
 
   ASroute.src = A_surfxml_ASroute_src;
   ASroute.dst = A_surfxml_ASroute_dst;
 
-  ASroute.gw_src = sg_routing_edge_by_name_or_null(A_surfxml_ASroute_gw___src);
-  ASroute.gw_dst = sg_routing_edge_by_name_or_null(A_surfxml_ASroute_gw___dst);
+  ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___src);
+  ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___dst);
 
   if (A_surfxml_ASroute_gw___src && !ASroute.gw_src)
     surf_parse_error("gw_src=\"%s\" not found for ASroute from \"%s\" to \"%s\"",
 
   if (A_surfxml_ASroute_gw___src && !ASroute.gw_src)
     surf_parse_error("gw_src=\"%s\" not found for ASroute from \"%s\" to \"%s\"",
@@ -823,8 +823,8 @@ void ETag_surfxml_bypassASroute(void){
   ASroute.link_list   = parsed_link_list;
   ASroute.symmetrical = FALSE;
 
   ASroute.link_list   = parsed_link_list;
   ASroute.symmetrical = FALSE;
 
-  ASroute.gw_src = sg_routing_edge_by_name_or_null(A_surfxml_bypassASroute_gw___src);
-  ASroute.gw_dst = sg_routing_edge_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
+  ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___src);
+  ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
 
   sg_platf_new_bypassASroute(&ASroute);
   parsed_link_list = NULL;
 
   sg_platf_new_bypassASroute(&ASroute);
   parsed_link_list = NULL;
@@ -1061,7 +1061,7 @@ int_f_void_t surf_parse = _surf_parse;
  * With XML parser
  */
 
  * With XML parser
  */
 
-double get_cpu_speed(const char *str_speed)
+double parse_cpu_speed(const char *str_speed)
 {
   double speed = 0.0;
   const char *p, *q;
 {
   double speed = 0.0;
   const char *p, *q;