Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
improve a bit the documentation of popping, and align code with doc
[simgrid.git] / src / simix / smx_io_private.h
1 /* Copyright (c) 2007-2010, 2012-2014. 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 "simgrid/simix.h"
11 #include "smx_smurf_private.h"
12
13 /** @brief Storage datatype */
14 typedef struct s_smx_storage_priv {
15   void *data;              /**< @brief user data */
16 } s_smx_storage_priv_t;
17
18
19 static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){
20   return (smx_storage_priv_t) xbt_lib_get_level(storage, SIMIX_STORAGE_LEVEL);
21 }
22
23 smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data);
24 void SIMIX_storage_destroy(void *s);
25 void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, smx_host_t host);
26 void SIMIX_pre_file_write(smx_simcall_t simcall,smx_file_t fd, sg_size_t size, smx_host_t host);
27 void SIMIX_pre_file_open(smx_simcall_t simcall, const char* fullpath, smx_host_t host);
28 void SIMIX_pre_file_close(smx_simcall_t simcall, smx_file_t fd, smx_host_t host);
29 int SIMIX_pre_file_unlink(smx_simcall_t simcall, smx_file_t fd, smx_host_t host);
30 sg_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
31 sg_size_t SIMIX_pre_file_tell(smx_simcall_t simcall, smx_file_t fd);
32 xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
33 int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
34 int SIMIX_pre_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
35 smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host);
36 smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host);
37 smx_action_t SIMIX_file_open(smx_process_t process, const char* fullpath, smx_host_t host);
38 smx_action_t SIMIX_file_close(smx_process_t process, smx_file_t fd, smx_host_t host);
39 int SIMIX_file_unlink(smx_process_t process, smx_file_t fd, smx_host_t host);
40 sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
41 sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
42 xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
43 int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin);
44 int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath);
45
46 sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,smx_storage_t storage);
47 sg_size_t SIMIX_storage_get_free_size(smx_process_t process,smx_storage_t storage);
48
49 sg_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall,smx_storage_t storage);
50 sg_size_t SIMIX_storage_get_used_size(smx_process_t process,smx_storage_t storage);
51
52 xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
53 xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t, smx_storage_t);
54
55 xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
56 xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);
57
58 const char* SIMIX_pre_storage_get_name(smx_simcall_t simcall, smx_storage_t storage);
59 const char* SIMIX_pre_storage_get_host(smx_simcall_t simcall, smx_storage_t storage);
60 void SIMIX_post_io(smx_action_t action);
61 void SIMIX_io_destroy(smx_action_t action);
62 void SIMIX_io_finish(smx_action_t action);
63
64 // pre prototypes
65
66 #endif