1 /* Copyright (c) 2007-2010, 2012-2014. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef _SIMIX_IO_PRIVATE_H
8 #define _SIMIX_IO_PRIVATE_H
10 #include "simgrid/simix.h"
11 #include "smx_smurf_private.h"
13 /** @brief Storage datatype */
14 typedef struct s_smx_storage_priv {
15 void *data; /**< @brief user data */
16 } s_smx_storage_priv_t;
19 static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){
20 return xbt_lib_get_level(storage, SIMIX_STORAGE_LEVEL);
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_get_data(smx_simcall_t simcall,smx_file_t fd);
26 void SIMIX_pre_file_set_data(smx_simcall_t simcall, smx_file_t fd, void *data);
27 void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size);
28 void SIMIX_pre_file_write(smx_simcall_t simcall,smx_file_t fd, sg_size_t size);
29 void SIMIX_pre_file_open(smx_simcall_t simcall, const char* mount,
31 void SIMIX_pre_file_close(smx_simcall_t simcall, smx_file_t fd);
32 int SIMIX_pre_file_unlink(smx_simcall_t simcall, smx_file_t fd);
33 void SIMIX_pre_file_ls(smx_simcall_t simcall,
34 const char* mount, const char* path);
35 sg_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
36 sg_size_t SIMIX_pre_file_tell(smx_simcall_t simcall, smx_file_t fd);
37 xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
38 int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_size_t offset, int origin);
39 void SIMIX_pre_storage_file_rename(smx_simcall_t simcall,smx_storage_t storage, const char* src, const char* dest);
41 void* SIMIX_file_get_data(smx_file_t fd);
42 void SIMIX_file_set_data(smx_file_t fd, void *data);
43 smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size);
44 smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size);
45 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage,
47 smx_action_t SIMIX_file_close(smx_process_t process, smx_file_t fd);
48 int SIMIX_file_unlink(smx_process_t process, smx_file_t fd);
49 smx_action_t SIMIX_file_ls(smx_process_t process, const char *mount,
51 sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
52 sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
53 xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
54 int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int origin);
56 void SIMIX_storage_file_rename(smx_process_t process, smx_storage_t storage, const char* src, const char* dest);
57 sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,const char* name);
58 sg_size_t SIMIX_storage_get_free_size(smx_process_t process,const char* name);
60 sg_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall,const char* name);
61 sg_size_t SIMIX_storage_get_used_size(smx_process_t process,const char* name);
63 xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
64 xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t, smx_storage_t);
66 void SIMIX_pre_storage_set_data(smx_simcall_t, smx_storage_t, void*);
67 void* SIMIX_pre_storage_get_data(smx_simcall_t, smx_storage_t);
69 xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
70 xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);
72 const char* SIMIX_pre_storage_get_name(smx_simcall_t simcall, smx_storage_t storage);
74 void SIMIX_post_io(smx_action_t action);
75 void SIMIX_io_destroy(smx_action_t action);
76 void SIMIX_io_finish(smx_action_t action);