Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics: s/overide/override/g.
[simgrid.git] / src / surf / surfxml_parse.c
index 18a6a7a..83a6047 100644 (file)
@@ -59,7 +59,7 @@ int surf_parse_get_int(const char *string) {
 
 
 /*
- * All the callback lists that can be overiden anywhere.
+ * All the callback lists that can be overridden anywhere.
  * (this list should probably be reduced to the bare minimum to allow the models to work)
  */
 
@@ -88,6 +88,8 @@ xbt_dynar_t STag_surfxml_bypassRoute_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_bypassRoute_cb_list = NULL;
 xbt_dynar_t STag_surfxml_include_cb_list = NULL;
 xbt_dynar_t ETag_surfxml_include_cb_list = NULL;
+xbt_dynar_t STag_surfxml_storage_cb_list = NULL;
+xbt_dynar_t ETag_surfxml_storage_cb_list = NULL;
 
 /* The default current property receiver. Setup in the corresponding opening callbacks. */
 xbt_dict_t current_property_set = NULL;
@@ -103,6 +105,27 @@ FILE *surf_file_to_parse = NULL;
 static void init_randomness(void);
 static void add_randomness(void);
 
+/*
+ * Stuff relative to the <storage> tag
+ */
+void STag_surfxml_storage(void)
+{
+  XBT_DEBUG("STag_surfxml_storage");
+}
+void ETag_surfxml_storage(void)
+{
+  s_sg_platf_storage_cbarg_t storage;
+  memset(&storage,0,sizeof(storage));
+
+  storage.id = A_surfxml_storage_id;
+  storage.type = A_surfxml_storage_type;
+  storage.properties = current_property_set;
+  storage.content = A_surfxml_storage_content;
+  current_property_set = NULL;
+
+  sg_platf_new_storage(&storage);
+}
+
 /*
  * Stuff relative to the <include> tag
  */
@@ -210,6 +233,10 @@ void surf_parse_init_callbacks(void)
                          xbt_dynar_new(sizeof(void_f_void_t), NULL);
          ETag_surfxml_include_cb_list =
                          xbt_dynar_new(sizeof(void_f_void_t), NULL);
+         STag_surfxml_storage_cb_list =
+             xbt_dynar_new(sizeof(void_f_void_t), NULL);
+         ETag_surfxml_storage_cb_list =
+             xbt_dynar_new(sizeof(void_f_void_t), NULL);
 }
 
 void surf_parse_reset_callbacks(void)
@@ -246,6 +273,8 @@ void surf_parse_free_callbacks(void)
   xbt_dynar_free(&ETag_surfxml_peer_cb_list);
   xbt_dynar_free(&STag_surfxml_include_cb_list);
   xbt_dynar_free(&ETag_surfxml_include_cb_list);
+  xbt_dynar_free(&STag_surfxml_storage_cb_list);
+  xbt_dynar_free(&ETag_surfxml_storage_cb_list);
 }
 
 /* Stag and Etag parse functions */