Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / include / simgrid / plugins / file_system.h
1 /* Copyright (c) 2017. 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 SIMGRID_PLUGINS_FILE_SYSTEM_H_
8 #define SIMGRID_PLUGINS_FILE_SYSTEM_H_
9
10 #include <simgrid/forward.h>
11 #include <xbt/base.h>
12
13 SG_BEGIN_DECL()
14
15 XBT_PUBLIC(void) sg_storage_file_system_init();
16 XBT_PUBLIC(sg_file_t) sg_file_open(const char* fullpath, void* data);
17 XBT_PUBLIC(sg_size_t) sg_file_read(sg_file_t fd, sg_size_t size);
18 XBT_PUBLIC(sg_size_t) sg_file_write(sg_file_t fd, sg_size_t size);
19 XBT_PUBLIC(void) sg_file_close(sg_file_t fd);
20
21 XBT_PUBLIC(const char*) sg_file_get_name(sg_file_t fd);
22 XBT_PUBLIC(sg_size_t) sg_file_get_size(sg_file_t fd);
23 XBT_PUBLIC(void) sg_file_dump(sg_file_t fd);
24 XBT_PUBLIC(void*) sg_file_get_data(sg_file_t fd);
25 XBT_PUBLIC(void) sg_file_set_data(sg_file_t fd, void* data);
26 XBT_PUBLIC(void) sg_file_seek(sg_file_t fd, sg_offset_t offset, int origin);
27 XBT_PUBLIC(sg_size_t) sg_file_tell(sg_file_t fd);
28 XBT_PUBLIC(void) sg_file_move(sg_file_t fd, const char* fullpath);
29 XBT_PUBLIC(void) sg_file_unlink(sg_file_t fd);
30 XBT_PUBLIC(int) sg_file_rcopy(sg_file_t file, sg_host_t host, const char* fullpath);
31 XBT_PUBLIC(int) sg_file_rmove(sg_file_t file, sg_host_t host, const char* fullpath);
32
33 XBT_PUBLIC(void*) sg_storage_get_data(sg_storage_t storage);
34 XBT_PUBLIC(void) sg_storage_set_data(sg_storage_t storage, void* data);
35 XBT_PUBLIC(sg_size_t) sg_storage_get_size_free(sg_storage_t st);
36 XBT_PUBLIC(sg_size_t) sg_storage_get_size_used(sg_storage_t st);
37 XBT_PUBLIC(sg_size_t) sg_storage_get_size(sg_storage_t st);
38 XBT_PUBLIC(xbt_dict_t) sg_storage_get_content(sg_storage_t storage);
39
40 XBT_PUBLIC(xbt_dict_t) sg_host_get_storage_content(sg_host_t host);
41
42 #define MSG_file_open(fullpath, data) sg_file_open(fullpath, data)
43 #define MSG_file_read(fd, size) sg_file_read(fd, size)
44 #define MSG_file_write(fd, size) sg_file_write(fd, size)
45 #define MSG_file_close(fd) sg_file_close(fd)
46 #define MSG_file_get_name(fd) sg_file_get_name(fd)
47 #define MSG_file_get_size(fd) sg_file_get_size(fd)
48 #define MSG_file_dump(fd) sg_file_dump(fd)
49 #define MSG_file_get_data(fd) sg_file_get_data(fd)
50 #define MSG_file_set_data(fd, data) sg_file_set_data(fd, data)
51 #define MSG_file_seek(fd, offset, origin) sg_file_seek(fd, offset, origin)
52 #define MSG_file_tell(fd) sg_file_tell(fd)
53 #define MSG_file_move(fd, fullpath) sg_file_get_size(fd, fullpath)
54 #define MSG_file_unlink(fd) sg_file_unlink(fd)
55 #define MSG_file_rcopy(file, host, fullpath) sg_file_rcopy(file, host, fullpath)
56 #define MSG_file_rmove(file, host, fullpath) sg_file_rmove(file, host, fullpath)
57
58 #define MSG_storage_file_system_init() sg_storage_file_system_init()
59 #define MSG_storage_get_free_size(st) sg_storage_get_size_free(st)
60 #define MSG_storage_get_used_size(st) sg_storage_get_size_used(st)
61 #define MSG_storage_get_size(st) sg_storage_get_size(st)
62 #define MSG_storage_get_content(st) sg_storage_get_content(st)
63
64 #define MSG_host_get_storage_content(st) sg_host_get_storage_content(st)
65
66 SG_END_DECL()
67
68 #endif