+/**
+ * \brief Internal function to create a SIMIX storage.
+ * \param name name of the storage to create
+ * \param storage the SURF storage to encapsulate
+ * \param data some user data (may be NULL)
+ */
+smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data)
+{
+ smx_storage_priv_t smx_storage = xbt_new0(s_smx_storage_priv_t, 1);
+
+ smx_storage->data = data;
+
+ /* Update global variables */
+ xbt_lib_set(storage_lib,name,SIMIX_STORAGE_LEVEL,smx_storage);
+
+ return xbt_lib_get_or_null(storage_lib, name, SIMIX_STORAGE_LEVEL);
+}
+
+/**
+ * \brief Internal function to destroy a SIMIX storage.
+ *
+ * \param s the host to destroy (a smx_storage_t)
+ */
+void SIMIX_storage_destroy(void *s)
+{
+ smx_storage_priv_t storage = (smx_storage_priv_t) s;
+
+ xbt_assert((storage != NULL), "Invalid parameters");
+ if (storage->data)
+ free(storage->data);
+
+ /* Clean storage structure */
+ free(storage);
+}
+
+void* SIMIX_pre_file_get_data(smx_simcall_t simcall,smx_file_t fd){
+ return SIMIX_file_get_data(fd);
+}
+
+void* SIMIX_file_get_data(smx_file_t fd){
+ xbt_assert((fd != NULL), "Invalid parameters (simix file is NULL)");
+
+ return fd->data;
+}
+
+void SIMIX_pre_file_set_data(smx_simcall_t simcall, smx_file_t fd, void *data) {
+ SIMIX_file_set_data(fd, data);
+}
+
+void SIMIX_file_set_data(smx_file_t fd, void *data){
+ xbt_assert((fd != NULL), "Invalid parameter");
+
+ fd->data = data;
+}
+