Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remote support for filling state->internal_comm
[simgrid.git] / src / mc / mc_object_info.c
index 35789e5..874235c 100644 (file)
@@ -5,7 +5,7 @@
 #include "mc_object_info.h"
 #include "mc_private.h"
 
-dw_frame_t MC_file_object_info_find_function(mc_object_info_t info, void *ip)
+dw_frame_t MC_file_object_info_find_function(mc_object_info_t info, const void *ip)
 {
   xbt_dynar_t dynar = info->functions_index;
   mc_function_index_item_t base =
@@ -24,3 +24,15 @@ dw_frame_t MC_file_object_info_find_function(mc_object_info_t info, void *ip)
   }
   return NULL;
 }
+
+dw_variable_t MC_file_object_info_find_variable_by_name(mc_object_info_t info, const char* name)
+{
+  unsigned int cursor = 0;
+  dw_variable_t variable;
+  xbt_dynar_foreach(info->global_variables, cursor, variable){
+    if(!strcmp(name, variable->name))
+      return variable;
+  }
+
+  return NULL;
+}