summaryrefslogtreecommitdiff
path: root/libfusepp/fuseapp.h
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2012-07-27 15:07:38 +0000
committerrandomdan <randomdan@localhost>2012-07-27 15:07:38 +0000
commit066840e4d1cd1b4a210e17c16d6a40a389a632a8 (patch)
tree8dffcd9468467cff12b70c129e240a50e7c25285 /libfusepp/fuseapp.h
parentMigrate all stuff to stricter compilations/links and C++0x builds (diff)
downloadnetfs-066840e4d1cd1b4a210e17c16d6a40a389a632a8.tar.bz2
netfs-066840e4d1cd1b4a210e17c16d6a40a389a632a8.tar.xz
netfs-066840e4d1cd1b4a210e17c16d6a40a389a632a8.zip
Fix compilation against various versions of fuse library
Usage C++0x to remove lots of code duplication in wrappers Move code for FuseAppBase into it's own folder
Diffstat (limited to 'libfusepp/fuseapp.h')
-rw-r--r--libfusepp/fuseapp.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/libfusepp/fuseapp.h b/libfusepp/fuseapp.h
new file mode 100644
index 0000000..c823721
--- /dev/null
+++ b/libfusepp/fuseapp.h
@@ -0,0 +1,54 @@
+#ifndef FUSEAPP_H
+#define FUSEAPP_H
+
+#define FUSE_USE_VERSION 26
+#include <fuse.h>
+#include <exception>
+
+class FuseAppBase {
+ public:
+ FuseAppBase();
+ virtual ~FuseAppBase() = 0;
+ virtual void * init (struct fuse_conn_info * info);
+ virtual int opt_parse(void *, const char * arg, int key, struct fuse_args *);
+ virtual int access(const char *, int);
+ virtual int chmod(const char *, mode_t);
+ virtual int chown(const char *, uid_t, gid_t);
+ virtual int create(const char *, mode_t, struct fuse_file_info *);
+ virtual int fgetattr(const char *, struct stat *, struct fuse_file_info *);
+ virtual int flush(const char *, struct fuse_file_info *);
+ virtual int fsync(const char *, int, struct fuse_file_info *);
+ virtual int fsyncdir(const char *, int, struct fuse_file_info *);
+ virtual int ftruncate(const char *, off_t, struct fuse_file_info *);
+ virtual int getattr(const char *, struct stat *);
+ virtual int getxattr(const char *, const char *, char *, size_t);
+ virtual int link(const char *, const char *);
+ virtual int listxattr(const char *, char *, size_t);
+ virtual int mkdir(const char *, mode_t);
+ virtual int mknod(const char *, mode_t, dev_t);
+ virtual int open(const char *, struct fuse_file_info *);
+ virtual int opendir(const char *, struct fuse_file_info *);
+ virtual int read(const char *, char *, size_t, off_t, struct fuse_file_info *);
+ virtual int readdir(const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *);
+ virtual int readlink(const char *, char *, size_t);
+ virtual int release(const char *, struct fuse_file_info *);
+ virtual int releasedir(const char *, struct fuse_file_info *);
+ virtual int removexattr(const char *, const char *);
+ virtual int rename(const char *, const char *);
+ virtual int rmdir(const char *);
+ virtual int setxattr(const char *, const char *, const char *, size_t, int);
+ virtual int statfs(const char *, struct statvfs *);
+ virtual int symlink(const char *, const char *);
+ virtual int truncate(const char *, off_t);
+ virtual int unlink(const char *);
+ virtual int write(const char *, const char *, size_t, off_t, struct fuse_file_info *);
+ virtual int lock(const char *, struct fuse_file_info *, int cmd, struct flock *);
+ virtual int utimens(const char *, const struct timespec tv[2]);
+ virtual int bmap(const char *, size_t blocksize, uint64_t *idx);
+ virtual int onError(const std::exception & err) throw();
+
+ static int run(int &, char ** &, FuseAppBase *);
+};
+
+#endif
+