Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make smx_file_t, surf_file_t and msg_file_t
authornavarro <navarro@caraja.(none)>
Thu, 29 Mar 2012 15:17:12 +0000 (17:17 +0200)
committernavarro <navarro@caraja.(none)>
Tue, 3 Apr 2012 13:16:25 +0000 (15:16 +0200)
14 files changed:
examples/msg/io/file.c
include/msg/datatypes.h
include/msg/msg.h
include/simix/datatypes.h
include/simix/simix.h
include/xbt/misc.h
src/include/surf/surf.h
src/msg/msg_io.c
src/simix/smx_io.c
src/simix/smx_io_private.h
src/simix/smx_smurf_private.h
src/simix/smx_user.c
src/surf/storage.c
src/surf/workstation.c

index d0bbc68..d63d941 100644 (file)
@@ -32,7 +32,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_file,
 
 int host(int argc, char *argv[])
 {
 
 int host(int argc, char *argv[])
 {
-  m_file_t file;
+  msg_file_t file;
   char* mount = bprintf("C:");
   size_t read,write;
   if(!strcmp(MSG_process_get_name(MSG_process_self()),"0"))
   char* mount = bprintf("C:");
   size_t read,write;
   if(!strcmp(MSG_process_get_name(MSG_process_self()),"0"))
index 5b171c1..8816397 100644 (file)
@@ -66,6 +66,21 @@ typedef struct m_task {
   @{ */
 typedef struct m_task *m_task_t;
 
   @{ */
 typedef struct m_task *m_task_t;
 
+/* ******************************** File ************************************ */
+
+typedef struct simdata_file *simdata_file_t;
+
+/** @brief File datatype
+    @ingroup m_datatypes_management_details */
+typedef struct msg_file {
+  char *name;                   /**< @brief file name */
+  simdata_file_t simdata;                /**< @brief simulator data  */
+  void *data;                   /**< @brief user data */
+} s_msg_file_t;
+/** @brief File datatype
+    @ingroup m_datatypes_management_details */
+typedef struct msg_file *msg_file_t;
+
 
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task *simdata_gpu_task_t;
 
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task *simdata_gpu_task_t;
index 89b94ff..2452e27 100644 (file)
@@ -38,10 +38,10 @@ XBT_PUBLIC(unsigned long int) MSG_get_sent_msg(void);
 
 
 /************************** File handling ***********************************/
 
 
 /************************** File handling ***********************************/
-XBT_PUBLIC(size_t) MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(size_t) MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(m_file_t) MSG_file_open(const char* storage, const char* path, const char* mode);
-XBT_PUBLIC(int) MSG_file_close(const char* storage, m_file_t fp);
+XBT_PUBLIC(size_t) MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, msg_file_t stream);
+XBT_PUBLIC(size_t) MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, msg_file_t stream);
+XBT_PUBLIC(msg_file_t) MSG_file_open(const char* storage, const char* path, const char* mode);
+XBT_PUBLIC(int) MSG_file_close(const char* storage, msg_file_t fp);
 XBT_PUBLIC(int) MSG_file_stat(const char* storage, int fd, void* buf);
 
 
 XBT_PUBLIC(int) MSG_file_stat(const char* storage, int fd, void* buf);
 
 
index 093cbbd..340bc1d 100644 (file)
@@ -46,6 +46,8 @@ typedef enum {
 
 typedef struct s_smx_timer* smx_timer_t;
 
 
 typedef struct s_smx_timer* smx_timer_t;
 
+/* ******************************** File ************************************ */
+typedef struct s_smx_file *smx_file_t;
 
 /* ******************************** Synchro ************************************ */
 typedef struct s_smx_mutex *smx_mutex_t;
 
 /* ******************************** Synchro ************************************ */
 typedef struct s_smx_mutex *smx_mutex_t;
index 8cfbd08..3c5919e 100644 (file)
@@ -244,10 +244,10 @@ XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem,
 XBT_PUBLIC(unsigned int) simcall_sem_acquire_any(xbt_dynar_t sems);
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
 XBT_PUBLIC(unsigned int) simcall_sem_acquire_any(xbt_dynar_t sems);
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
-XBT_PUBLIC(size_t) simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(size_t) simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(m_file_t) simcall_file_open(const char* storage, const char* path, const char* mode);
-XBT_PUBLIC(int) simcall_file_close(const char* storage, m_file_t fp);
+XBT_PUBLIC(size_t) simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+XBT_PUBLIC(size_t) simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+XBT_PUBLIC(smx_file_t) simcall_file_open(const char* storage, const char* path, const char* mode);
+XBT_PUBLIC(int) simcall_file_close(const char* storage, smx_file_t fp);
 XBT_PUBLIC(int) simcall_file_stat(const char* storage, int fd, void* buf);
 
 SG_END_DECL()
 XBT_PUBLIC(int) simcall_file_stat(const char* storage, int fd, void* buf);
 
 SG_END_DECL()
index a77a7fe..7d887b0 100644 (file)
@@ -218,16 +218,5 @@ XBT_PUBLIC(const char *) xbt_procname(void);
 
 #define XBT_BACKTRACE_SIZE 10   /* FIXME: better place? Do document */
 
 
 #define XBT_BACKTRACE_SIZE 10   /* FIXME: better place? Do document */
 
-/** @brief File datatype
-    @ingroup m_datatypes_management_details */
-typedef struct m_file {
-  char *name;                   /**< @brief file name */
-  void *content;                   /**< @brief user data */
-} s_m_file_t;
-/** @brief File datatype
-    @ingroup m_datatypes_management_details */
-typedef struct m_file *m_file_t;
-
-
 SG_END_DECL()
 #endif                          /* XBT_MISC_H */
 SG_END_DECL()
 #endif                          /* XBT_MISC_H */
index d8f73c5..8b7e323 100644 (file)
@@ -93,7 +93,7 @@ typedef struct surf_action {
 #ifdef HAVE_TRACING
   char *category;               /**< tracing category for categorized resource utilization monitoring */
 #endif
 #ifdef HAVE_TRACING
   char *category;               /**< tracing category for categorized resource utilization monitoring */
 #endif
-  void* file;        /**< m_file_t for storage model */
+  void* file;        /**< surf_file_t for storage model */
   size_t read_write;
 } s_surf_action_t;
 
   size_t read_write;
 } s_surf_action_t;
 
@@ -216,11 +216,17 @@ typedef struct surf_network_model_extension_public {
  *  Public functions specific to the Storage model.
  */
 
  *  Public functions specific to the Storage model.
  */
 
+typedef struct surf_file {
+  char *name;              /**< @brief host name if any */
+  void *simdata;
+  void *data;              /**< @brief user data */
+}s_surf_file_t, *surf_file_t;
+
 typedef struct surf_storage_model_extension_public {
   surf_action_t(*open) (void *storage, const char* path, const char* mode);
 typedef struct surf_storage_model_extension_public {
   surf_action_t(*open) (void *storage, const char* path, const char* mode);
-  surf_action_t(*close) (void *storage, m_file_t fp);
-  surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-  surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
+  surf_action_t(*close) (void *storage, surf_file_t fp);
+  surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
+  surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
   surf_action_t(*stat) (void *storage, int fd, void* buf);
   void* (*create_resource) (const char* id, const char* model,const char* type_id);
 } s_surf_model_extension_storage_t;
   surf_action_t(*stat) (void *storage, int fd, void* buf);
   void* (*create_resource) (const char* id, const char* model,const char* type_id);
 } s_surf_model_extension_storage_t;
@@ -251,9 +257,9 @@ typedef struct surf_workstation_model_extension_public {
   double (*get_link_bandwidth) (const void *link);                                         /**< Return the current bandwidth of a network link */
   double (*get_link_latency) (const void *link);                                           /**< Return the current latency of a network link */
   surf_action_t(*open) (void *workstation, const char* storage, const char* path, const char* mode);
   double (*get_link_bandwidth) (const void *link);                                         /**< Return the current bandwidth of a network link */
   double (*get_link_latency) (const void *link);                                           /**< Return the current latency of a network link */
   surf_action_t(*open) (void *workstation, const char* storage, const char* path, const char* mode);
-  surf_action_t(*close) (void *workstation, const char* storage, m_file_t fp);
-  surf_action_t(*read) (void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-  surf_action_t(*write) (void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
+  surf_action_t(*close) (void *workstation, const char* storage, surf_file_t fp);
+  surf_action_t(*read) (void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
+  surf_action_t(*write) (void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
   surf_action_t(*stat) (void *workstation, const char* storage, int fd, void* buf);
   int (*link_shared) (const void *link);
    xbt_dict_t(*get_properties) (const void *resource);
   surf_action_t(*stat) (void *workstation, const char* storage, int fd, void* buf);
   int (*link_shared) (const void *link);
    xbt_dict_t(*get_properties) (const void *resource);
index f689fe6..a9809ac 100644 (file)
@@ -8,9 +8,9 @@
 
 /** @addtogroup m_file_management
  *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="File" --> \endhtmlonly
 
 /** @addtogroup m_file_management
  *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="File" --> \endhtmlonly
- * (#m_file_t) and the functions for managing it.
+ * (#msg_file_t) and the functions for managing it.
  *
  *
- *  \see #m_file_t
+ *  \see #msg_file_t
  */
 
 /********************************* File **************************************/
  */
 
 /********************************* File **************************************/
@@ -25,9 +25,9 @@
  * \param stream to read
  * \return the number of items successfully read
  */
  * \param stream to read
  * \return the number of items successfully read
  */
-size_t MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb,  m_file_t stream)
+size_t MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb,  msg_file_t stream)
 {
 {
-  return simcall_file_read(storage, ptr, size, nmemb, (m_file_t)stream);
+  return simcall_file_read(storage, ptr, size, nmemb, (smx_file_t)stream);
 }
 
 /** \ingroup m_file_management
 }
 
 /** \ingroup m_file_management
@@ -40,9 +40,9 @@ size_t MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb,
  * \param stream to write
  * \return the number of items successfully write
  */
  * \param stream to write
  * \return the number of items successfully write
  */
-size_t MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+size_t MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, msg_file_t stream)
 {
 {
-  return simcall_file_write(storage, ptr, size, nmemb, (m_file_t)stream);
+  return simcall_file_write(storage, ptr, size, nmemb, (smx_file_t)stream);
 }
 
 /** \ingroup m_file_management
 }
 
 /** \ingroup m_file_management
@@ -60,11 +60,11 @@ size_t MSG_file_write(const char* storage, const void* ptr, size_t size, size_t
  *      a+     Open for reading and appending (writing at end of file).  The file is created if it does not exist.  The initial file position for  reading
  *             is at the beginning of the file, but output is always appended to the end of the file.
  *
  *      a+     Open for reading and appending (writing at end of file).  The file is created if it does not exist.  The initial file position for  reading
  *             is at the beginning of the file, but output is always appended to the end of the file.
  *
- * \return An #m_file_t associated to the file
+ * \return An #msg_file_t associated to the file
  */
  */
-m_file_t MSG_file_open(const char* storage, const char* path, const char* mode)
+msg_file_t MSG_file_open(const char* storage, const char* path, const char* mode)
 {
 {
-  return (m_file_t) simcall_file_open(storage, path, mode);
+  return (msg_file_t) simcall_file_open(storage, path, mode);
 }
 
 /** \ingroup m_file_management
 }
 
 /** \ingroup m_file_management
@@ -74,9 +74,9 @@ m_file_t MSG_file_open(const char* storage, const char* path, const char* mode)
  * \param fp is the file to close
  * \return 0 on success or 1 on error
  */
  * \param fp is the file to close
  * \return 0 on success or 1 on error
  */
-int MSG_file_close(const char* storage, m_file_t fp)
+int MSG_file_close(const char* storage, msg_file_t fp)
 {
 {
-  return simcall_file_close(storage, (m_file_t)fp);
+  return simcall_file_close(storage, (smx_file_t)fp);
 }
 
 /** \ingroup m_file_management
 }
 
 /** \ingroup m_file_management
index 209d825..53c76d9 100644 (file)
@@ -28,7 +28,7 @@ void SIMIX_pre_file_read(smx_simcall_t simcall)
   simcall->file_read.result = (action->io.surf_io)->read_write;
 }
 
   simcall->file_read.result = (action->io.surf_io)->read_write;
 }
 
-smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -48,7 +48,7 @@ smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* p
 #endif
 
   action->io.host = host;
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.read(host->host, storage, ptr, size, nmemb, stream),
+  action->io.surf_io = surf_workstation_model->extension.workstation.read(host->host, storage, ptr, size, nmemb, (surf_file_t)stream),
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -70,7 +70,7 @@ void SIMIX_pre_file_write(smx_simcall_t simcall)
   simcall->file_write.result = (action->io.surf_io)->read_write;
 }
 
   simcall->file_write.result = (action->io.surf_io)->read_write;
 }
 
-smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -90,7 +90,7 @@ smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const
 #endif
 
   action->io.host = host;
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.write(host->host, storage, ptr, size, nmemb, stream);
+  action->io.surf_io = surf_workstation_model->extension.workstation.write(host->host, storage, ptr, size, nmemb, (surf_file_t)stream);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -149,7 +149,7 @@ void SIMIX_pre_file_close(smx_simcall_t simcall)
   simcall->file_close.result = 0;
 }
 
   simcall->file_close.result = 0;
 }
 
-smx_action_t SIMIX_file_close(smx_process_t process ,const char* storage, m_file_t fp)
+smx_action_t SIMIX_file_close(smx_process_t process ,const char* storage, smx_file_t fp)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -169,7 +169,7 @@ smx_action_t SIMIX_file_close(smx_process_t process ,const char* storage, m_file
 #endif
 
   action->io.host = host;
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.close(host->host, storage, fp);
+  action->io.surf_io = surf_workstation_model->extension.workstation.close(host->host, storage, (surf_file_t)fp);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
index 861f6ea..83cd902 100644 (file)
 #include "simix/datatypes.h"
 #include "smx_smurf_private.h"
 
 #include "simix/datatypes.h"
 #include "smx_smurf_private.h"
 
+/** @brief File datatype */
+typedef struct s_smx_file {
+  char *name;              /**< @brief host name if any */
+  void *simdata;
+  void *data;              /**< @brief user data */
+} s_smx_file_t;
+
 void SIMIX_pre_file_read(smx_simcall_t simcall);
 void SIMIX_pre_file_write(smx_simcall_t simcall);
 void SIMIX_pre_file_open(smx_simcall_t simcall);
 void SIMIX_pre_file_close(smx_simcall_t simcall);
 void SIMIX_pre_file_stat(smx_simcall_t simcall);
 
 void SIMIX_pre_file_read(smx_simcall_t simcall);
 void SIMIX_pre_file_write(smx_simcall_t simcall);
 void SIMIX_pre_file_open(smx_simcall_t simcall);
 void SIMIX_pre_file_close(smx_simcall_t simcall);
 void SIMIX_pre_file_stat(smx_simcall_t simcall);
 
-smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
+smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage, const char* path, const char* mode);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage, const char* path, const char* mode);
-smx_action_t SIMIX_file_close(smx_process_t process, const char* storage, m_file_t fp);
+smx_action_t SIMIX_file_close(smx_process_t process, const char* storage, smx_file_t fp);
 smx_action_t SIMIX_file_stat(smx_process_t process, const char* storage, int fd, void* buf);
 
 void SIMIX_post_io(smx_action_t action);
 smx_action_t SIMIX_file_stat(smx_process_t process, const char* storage, int fd, void* buf);
 
 void SIMIX_post_io(smx_action_t action);
index d828e5b..07385e9 100644 (file)
@@ -512,7 +512,7 @@ typedef struct s_smx_simcall {
       void *ptr;
       size_t size;
       size_t nmemb;
       void *ptr;
       size_t size;
       size_t nmemb;
-      m_file_t stream;
+      smx_file_t stream;
       size_t result;
     } file_read;
 
       size_t result;
     } file_read;
 
@@ -521,7 +521,7 @@ typedef struct s_smx_simcall {
       const void *ptr;
       size_t size;
       size_t nmemb;
       const void *ptr;
       size_t size;
       size_t nmemb;
-      m_file_t stream;
+      smx_file_t stream;
       size_t result;
     } file_write;
 
       size_t result;
     } file_write;
 
@@ -529,12 +529,12 @@ typedef struct s_smx_simcall {
       const char* storage;
       const char* path;
       const char* mode;
       const char* storage;
       const char* path;
       const char* mode;
-      m_file_t result;
+      smx_file_t result;
     } file_open;
 
     struct {
       const char* storage;
     } file_open;
 
     struct {
       const char* storage;
-      m_file_t fp;
+      smx_file_t fp;
       int result;
     } file_close;
 
       int result;
     } file_close;
 
index c0957ba..9d90214 100644 (file)
@@ -1177,7 +1177,7 @@ int simcall_sem_get_capacity(smx_sem_t sem)
   return simcall->sem_get_capacity.result;
 }
 
   return simcall->sem_get_capacity.result;
 }
 
-size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1192,7 +1192,7 @@ size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nme
   return simcall->file_read.result;
 }
 
   return simcall->file_read.result;
 }
 
-size_t simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+size_t simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1207,7 +1207,7 @@ size_t simcall_file_write(const char* storage, const void* ptr, size_t size, siz
   return simcall->file_write.result;
 }
 
   return simcall->file_write.result;
 }
 
-m_file_t simcall_file_open(const char* storage, const char* path, const char* mode)
+smx_file_t simcall_file_open(const char* storage, const char* path, const char* mode)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1220,7 +1220,7 @@ m_file_t simcall_file_open(const char* storage, const char* path, const char* mo
   return simcall->file_open.result;
 }
 
   return simcall->file_open.result;
 }
 
-int simcall_file_close(const char* storage, m_file_t fp)
+int simcall_file_close(const char* storage, smx_file_t fp)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
index e926151..e59d0c7 100644 (file)
@@ -50,30 +50,30 @@ static surf_action_t storage_action_open(void *storage, const char* path, const
   xbt_dict_t content_dict = storage_type->content;
   content_t content = xbt_dict_get(content_dict,path);
 
   xbt_dict_t content_dict = storage_type->content;
   content_t content = xbt_dict_get(content_dict,path);
 
-  m_file_t file = xbt_new0(s_m_file_t,1);
+  surf_file_t file = xbt_new0(s_surf_file_t,1);
   file->name = xbt_strdup(path);
   file->name = xbt_strdup(path);
-  file->content = content;
+  file->simdata = content;
 
   surf_action_t action = storage_action_execute(storage,0, DEFAULT);
   action->file = (void *)file;
   return action;
 }
 
 
   surf_action_t action = storage_action_execute(storage,0, DEFAULT);
   action->file = (void *)file;
   return action;
 }
 
-static surf_action_t storage_action_close(void *storage, m_file_t fp)
+static surf_action_t storage_action_close(void *storage, surf_file_t fp)
 {
   char *filename = fp->name;
   free(fp->name);
 {
   char *filename = fp->name;
   free(fp->name);
-  fp->content = NULL;
+  fp->simdata = NULL;
   xbt_free(fp);
   surf_action_t action = storage_action_execute(storage,0, DEFAULT);
   XBT_DEBUG("\tClose file '%s'",filename);
   return action;
 }
 
   xbt_free(fp);
   surf_action_t action = storage_action_execute(storage,0, DEFAULT);
   XBT_DEBUG("\tClose file '%s'",filename);
   return action;
 }
 
-static surf_action_t storage_action_read(void *storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t storage_action_read(void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   char *filename = stream->name;
 {
   char *filename = stream->name;
-  content_t content = (content_t)(stream->content);
+  content_t content = (content_t)(stream->simdata);
   XBT_DEBUG("\tRead file '%s' size '%Zu/%Zu'",filename,size,content->size);
   if(size > content->size)
     size = content->size;
   XBT_DEBUG("\tRead file '%s' size '%Zu/%Zu'",filename,size,content->size);
   if(size > content->size)
     size = content->size;
@@ -82,10 +82,10 @@ static surf_action_t storage_action_read(void *storage, void* ptr, size_t size,
   return action;
 }
 
   return action;
 }
 
-static surf_action_t storage_action_write(void *storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t storage_action_write(void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   char *filename = stream->name;
 {
   char *filename = stream->name;
-  content_t content = (content_t)(stream->content);
+  content_t content = (content_t)(stream->simdata);
   XBT_DEBUG("\tWrite file '%s' size '%Zu/%Zu'",filename,size,content->size);
 
   surf_action_t action = storage_action_execute(storage,size,WRITE);
   XBT_DEBUG("\tWrite file '%s' size '%Zu/%Zu'",filename,size,content->size);
 
   surf_action_t action = storage_action_execute(storage,size,WRITE);
index 0df7149..9cc7163 100644 (file)
@@ -311,7 +311,7 @@ static surf_action_t ws_action_open(void *workstation, const char* storage, cons
   return model->extension.storage.open(st, path, mode);
 }
 
   return model->extension.storage.open(st, path, mode);
 }
 
-static surf_action_t ws_action_close(void *workstation, const char* storage, m_file_t fp)
+static surf_action_t ws_action_close(void *workstation, const char* storage, surf_file_t fp)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name);
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name);
@@ -319,7 +319,7 @@ static surf_action_t ws_action_close(void *workstation, const char* storage, m_f
   return model->extension.storage.close(st, fp);
 }
 
   return model->extension.storage.close(st, fp);
 }
 
-static surf_action_t ws_action_read(void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t ws_action_read(void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("READ on disk '%s'",st->generic_resource.name);
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("READ on disk '%s'",st->generic_resource.name);
@@ -327,7 +327,7 @@ static surf_action_t ws_action_read(void *workstation, const char* storage, void
   return model->extension.storage.read(st, ptr, size, nmemb, stream);
 }
 
   return model->extension.storage.read(st, ptr, size, nmemb, stream);
 }
 
-static surf_action_t ws_action_write(void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t ws_action_write(void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("WRITE on disk '%s'",st->generic_resource.name);
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("WRITE on disk '%s'",st->generic_resource.name);