ICFS/sources/sourcefs.h
fedir 1ddbef6a65 Used the libfuse example as a foundation.
The main.c was completely replaced by one of the libfuse examples:
[passthrough_fh.c](https://github.com/libfuse/libfuse/blob/master/example/passthrough_fh.c)
. This choice is made based on that there is little point in spending
time on reinventing the wheel by reimplementing passthrough all over
again. Also, the [passthrough_hp.cc](https://github.com/libfuse/libfuse/blob/master/example/passthrough_hp.cc) wasn't used because it uses a vastly different and much more comlex API, even though the authors claim it to be faster.
2024-12-15 15:41:28 +01:00

37 lines
827 B
C

#ifndef SOURCEFS_H
#define SOURCEFS_H
#include <dirent.h>
#include <sys/stat.h>
/**
* Initializes the source file handling.
*
* @param root_path The root of the source files folder.
* @return 0 on success, -1 on failure.
*/
int source_init(const char *root_path);
/* All of the functions below are designed to behave exactly as their non-source
* counterparts. */
int source_stat(const char *restrict filename, struct stat *restrict statbuf);
struct dirent *source_readdir(DIR *dirp);
DIR *source_opendir(const char *filename);
int source_unlink(const char *filename);
int source_mkdir(const char *filename, mode_t mode);
int source_rmdir(const char *filename);
int source_symlink(const char *target, const char *linkpath);
int source_rename(const char *oldpath, const char *newpath);
#endif // !SOURCEFS_H