Fuse.Problem
|
The file contains all the fuse callbacks implemented. More...
#include <errno.h>
#include <fcntl.h>
#include <fuse.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
Go to the source code of this file.
Macros | |
#define | _FILE_OFFSET_BITS 64 |
#define | FUSE_USE_VERSION 30 |
#define | _XOPEN_SOURCE 500 |
Functions | |
void | fpr_init (const char *path) |
initializer for the fuse.problem filesystem More... | |
void | fpr_destroy () |
destroyer for the fuse.problem filesystem. More... | |
int | fpr_getattr (const char *path, struct stat *stbuf) |
getattr callback for fuse.problem More... | |
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 More... | |
int | fpr_open (const char *path, struct fuse_file_info *fi) |
open file operation More... | |
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 More... | |
int | fpr_write (const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fi) |
write callback More... | |
int | fpr_truncate (const char *path, off_t size) |
truncate a file (fix it to zero when overwritten) More... | |
Variables | |
void * | problem |
The file contains all the fuse callbacks implemented.
The file contains all the fuse callbacks implemented
void fpr_destroy | ( | ) |
destroyer for the fuse.problem filesystem.
Destroys the fuse Problem class
int fpr_getattr | ( | const char * | path, |
struct stat * | stbuf | ||
) |
getattr callback for fuse.problem
The getattr callback should fill a stat struct that contains the times for the different files and access attributes. This is a callback. This function is exported in C
path | the path of the inode that is stat |
stbuf | the struct stat that must be filled |
void fpr_init | ( | const char * | path | ) |
initializer for the fuse.problem filesystem
This function creates a new pointer for the fuse problem that will be used throughout the library. This function is exported in C
path | path of the shared library that contains the shared object |
int fpr_open | ( | const char * | path, |
struct fuse_file_info * | fi | ||
) |
open file operation
The function sets the direct_io flag to one. This changes the behaviour in reading for the filesystem. Return 0 if the file exists, while -ENOENT when file does not exist. This function is exported in C
path | the path of the file to be opened |
fi | the fuse struct that contains info for the file |
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
This callback calls the Problem<FP>::read method and returns exactly the data into buf. Theread operation guarantees the direct I/O flag set to true. This function is exported in C
path | the path of the file |
buf | the buffer in which data will be called |
size | maximum size writable |
offset | offset for reading |
fi | struct of the file from fuse |
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
Fills recursively the stat struct that contains the access informations and the contained file system. This is a callback. This function is exported in C
path | the current file path |
buf | an internal buffer required by the callback |
filler | |
offset | |
fi |
int fpr_truncate | ( | const char * | path, |
off_t | size | ||
) |
truncate a file (fix it to zero when overwritten)
Function called before a write. It is necessary to guarantee that write operation will be performed. It is almost a dummy function that returns zero when succeed and -ENOENT when the file does not exist. This function is exported in C
path | file to be truncated |
offset | size (unused) return 0 or -ENOENT |
int fpr_write | ( | const char * | path, |
const char * | buf, | ||
size_t | size, | ||
off_t | offset, | ||
struct fuse_file_info * | fi | ||
) |
write callback
The write callback calls the problem write opeation and it is used to get the data to be parsed. When a write is called, it also fires an update operation with a re-evaluation of all functions. This function is exported in C
path | the path of the file to be written |
buf | the buffer that will be written |
size | the size of data to be written (unused) |
offset | offset of the data to be written (unused) |
fi | struct of fuse filesystem |
void* problem |
external global variable that contains the problem lib path