Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use new/delete for smx_process_arg_t
[simgrid.git] / src / simix / smx_io_private.h
1 /* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SIMIX_IO_PRIVATE_H
8 #define _SIMIX_IO_PRIVATE_H
9
10 #include <xbt/base.h>
11
12 #include "simgrid/simix.h"
13 #include "popping_private.h"
14
15 /** @brief Storage datatype */
16 typedef struct s_smx_storage_priv {
17   void *data;              /**< @brief user data */
18 } s_smx_storage_priv_t;
19
20
21 static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){
22   return (smx_storage_priv_t) xbt_lib_get_level(storage, SIMIX_STORAGE_LEVEL);
23 }
24
25 XBT_PRIVATE smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data);
26 XBT_PRIVATE void SIMIX_storage_destroy(void *s);
27 XBT_PRIVATE smx_synchro_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
28 XBT_PRIVATE smx_synchro_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
29 XBT_PRIVATE smx_synchro_t SIMIX_file_open(const char* fullpath, sg_host_t host);
30 XBT_PRIVATE smx_synchro_t SIMIX_file_close(smx_file_t fd, sg_host_t host);
31 XBT_PRIVATE int SIMIX_file_unlink(smx_file_t fd, sg_host_t host);
32 XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
33 XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
34 XBT_PRIVATE xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
35 XBT_PRIVATE int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin);
36 XBT_PRIVATE int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath);
37
38 XBT_PRIVATE sg_size_t SIMIX_storage_get_free_size(smx_process_t process, smx_storage_t storage);
39 XBT_PRIVATE sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t storage);
40
41 XBT_PRIVATE xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
42
43 XBT_PRIVATE void SIMIX_post_io(smx_synchro_t synchro);
44 XBT_PRIVATE void SIMIX_io_destroy(smx_synchro_t synchro);
45 XBT_PRIVATE void SIMIX_io_finish(smx_synchro_t synchro);
46
47 #endif