Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use defined interface for accessing to lib properties.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 14 Nov 2011 10:21:06 +0000 (11:21 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 14 Nov 2011 12:18:31 +0000 (13:18 +0100)
src/msg/msg_host.c
src/simdag/sd_dotloader.c
src/simdag/sd_link.c
src/simdag/sd_workstation.c

index 9b6688c..bcd8b8f 100644 (file)
@@ -148,7 +148,7 @@ void __MSG_host_destroy(m_host_t host)
  */
 int MSG_get_host_number(void)
 {
  */
 int MSG_get_host_number(void)
 {
-  return host_lib->count;
+  return xbt_lib_length(host_lib);
 }
 
 /** \ingroup m_host_management
 }
 
 /** \ingroup m_host_management
@@ -162,10 +162,10 @@ m_host_t *MSG_get_host_table(void)
          char *key;
          void **data;
 
          char *key;
          void **data;
 
-         if (host_lib->count == 0)
+         if (xbt_lib_length(host_lib) == 0)
                return NULL;
          else
                return NULL;
          else
-               array = xbt_new0(void *, host_lib->count);
+               array = xbt_new0(void *, xbt_lib_length(host_lib));
 
          xbt_lib_foreach(host_lib, cursor, key, data) {
            if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST)
 
          xbt_lib_foreach(host_lib, cursor, key, data) {
            if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST)
index 801315e..25795b6 100644 (file)
@@ -318,7 +318,7 @@ void dot_add_task(Agnode_t * dag_node)
         computer = xbt_dynar_new(sizeof(SD_task_t), NULL);
         xbt_dict_set(computers, char_performer, computer, NULL);
       }
         computer = xbt_dynar_new(sizeof(SD_task_t), NULL);
         xbt_dict_set(computers, char_performer, computer, NULL);
       }
-      if(performer < host_lib->count){
+      if(performer < xbt_lib_length(host_lib)){
         // the  wanted computer is available
         SD_task_t *task_test = NULL;
         if(order < computer->used)
         // the  wanted computer is available
         SD_task_t *task_test = NULL;
         if(order < computer->used)
index 5308684..2cf0faa 100644 (file)
@@ -51,7 +51,7 @@ const SD_link_t *SD_link_get_list(void)
   int i;
 
   if (sd_global->link_list == NULL) {   /* this is the first time the function is called */
   int i;
 
   if (sd_global->link_list == NULL) {   /* this is the first time the function is called */
-    sd_global->link_list = xbt_new(SD_link_t, link_lib->count);
+    sd_global->link_list = xbt_new(SD_link_t, xbt_lib_length(link_lib));
 
     i = 0;
     xbt_lib_foreach(link_lib, cursor, key, data) {
 
     i = 0;
     xbt_lib_foreach(link_lib, cursor, key, data) {
@@ -69,7 +69,7 @@ const SD_link_t *SD_link_get_list(void)
  */
 int SD_link_get_number(void)
 {
  */
 int SD_link_get_number(void)
 {
-  return link_lib->count;
+  return xbt_lib_length(link_lib);
 }
 
 /**
 }
 
 /**
index 938e223..1f15df9 100644 (file)
@@ -70,7 +70,7 @@ const SD_workstation_t *SD_workstation_get_list(void)
 
   if (sd_global->workstation_list == NULL) {    /* this is the first time the function is called */
     sd_global->workstation_list =
 
   if (sd_global->workstation_list == NULL) {    /* this is the first time the function is called */
     sd_global->workstation_list =
-        xbt_new(SD_workstation_t, host_lib->count);
+      xbt_new(SD_workstation_t, xbt_lib_length(host_lib));
 
     i = 0;
     xbt_lib_foreach(host_lib, cursor, key, data) {
 
     i = 0;
     xbt_lib_foreach(host_lib, cursor, key, data) {
@@ -89,7 +89,7 @@ const SD_workstation_t *SD_workstation_get_list(void)
  */
 int SD_workstation_get_number(void)
 {
  */
 int SD_workstation_get_number(void)
 {
-  return host_lib->count;
+  return xbt_lib_length(host_lib);
 }
 
 /**
 }
 
 /**