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);
}
if (surf_workstation_model->extension.workstation.unlink(host, fd->surf_file)){
- fd->surf_file = NULL;
+ xbt_free(fd);
return 1;
} else
return 0;
fd->surf_file);
}
+void SIMIX_pre_file_rename(smx_simcall_t simcall, smx_file_t fd, const char* new_name)
+{
+ return SIMIX_file_rename(simcall->issuer, fd, new_name);
+}
+
+void SIMIX_file_rename(smx_process_t process, smx_file_t fd, const char* new_name)
+{
+ smx_host_t host = process->smx_host;
+ return surf_workstation_model->extension.workstation.rename(host,
+ fd->surf_file, new_name);
+}
+
+
sg_storage_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, const char* name)
{
return SIMIX_storage_get_free_size(simcall->issuer, name);