Fuse.Problem
problemFuse.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* Copyright (c) 2017 - Matteo Ragni, University of Trento */
4 /* */
5 /* Permission is hereby granted, free of charge, to any person */
6 /* obtaining a copy of this software and associated documentation */
7 /* files (the "Software"), to deal in the Software without */
8 /* restriction, including without limitation the rights to use, */
9 /* copy, modify, merge, publish, distribute, sublicense, and/or sell */
10 /* copies of the Software, and to permit persons to whom the */
11 /* Software is furnished to do so, subject to the following */
12 /* conditions: */
13 /* */
14 /* The above copyright notice and this permission notice shall be */
15 /* included in all copies or substantial portions of the Software. */
16 /* */
17 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
18 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */
19 /* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */
20 /* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */
21 /* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */
22 /* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */
23 /* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */
24 /* OTHER DEALINGS IN THE SOFTWARE. */
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
35 #ifndef _FUSE_PROBLEM_FUSE_HH_
36 #define _FUSE_PROBLEM_FUSE_HH_
37 
38 #ifndef _FILE_OFFSET_BITS
39 #define _FILE_OFFSET_BITS 64
40 #endif
41 
42 #define FUSE_USE_VERSION 30
43 #ifndef _XOPEN_SOURCE
44 #define _XOPEN_SOURCE 500
45 #endif
46 
47 #include <errno.h>
48 #include <fcntl.h>
49 #include <fuse.h>
50 #include <stdlib.h>
51 #include <sys/stat.h>
52 #include <sys/time.h>
53 #include <sys/types.h>
54 #include <time.h>
55 #include <unistd.h>
56 
57 void * problem;
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
70 void fpr_init(const char * path);
76 void fpr_destroy();
88 int fpr_getattr(const char *path, struct stat *stbuf);
102 int fpr_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
103  off_t offset, struct fuse_file_info *fi);
115 int fpr_open(const char *path, struct fuse_file_info *fi);
130 int fpr_read(const char *path, char *buf, size_t size, off_t offset,
131  struct fuse_file_info *fi);
146 int fpr_write(const char *path, const char *buf, size_t size,
147  off_t offset, struct fuse_file_info *fi);
159 int fpr_truncate(const char *path, off_t size);
160 
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif /* _FUSE_PROBLEM_FUSE_HH_ */
void fpr_destroy()
destroyer for the fuse.problem filesystem.
void * problem
Definition: problemFuse.h:57
int fpr_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi)
read callback for getting file content
int fpr_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi)
fill the stat struct for the filesystem
int fpr_open(const char *path, struct fuse_file_info *fi)
open file operation
int fpr_write(const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fi)
write callback
int fpr_getattr(const char *path, struct stat *stbuf)
getattr callback for fuse.problem
void fpr_init(const char *path)
initializer for the fuse.problem filesystem
int fpr_truncate(const char *path, off_t size)
truncate a file (fix it to zero when overwritten)