diff options
Diffstat (limited to 'libfusepp')
-rw-r--r-- | libfusepp/Jamfile.jam | 5 | ||||
-rw-r--r-- | libfusepp/fuseAppBase.cpp (renamed from libfusepp/fuseapp.cpp) | 8 | ||||
-rw-r--r-- | libfusepp/fuseAppBase.h (renamed from libfusepp/fuseapp.h) | 10 |
3 files changed, 11 insertions, 12 deletions
diff --git a/libfusepp/Jamfile.jam b/libfusepp/Jamfile.jam deleted file mode 100644 index 1ba4a26..0000000 --- a/libfusepp/Jamfile.jam +++ /dev/null @@ -1,5 +0,0 @@ -project - : usage-requirements - <include>. - ; - diff --git a/libfusepp/fuseapp.cpp b/libfusepp/fuseAppBase.cpp index 1a6494a..a1ea491 100644 --- a/libfusepp/fuseapp.cpp +++ b/libfusepp/fuseAppBase.cpp @@ -1,4 +1,4 @@ -#include "fuseapp.h" +#include "fuseAppBase.h" #include <errno.h> #include <assert.h> #include <stdio.h> @@ -184,7 +184,7 @@ int FuseAppBase::fallocate(const char *, int, off_t, off_t, struct fuse_file_inf } int FuseAppBase::onError(const std::exception & e) throw() { - fprintf(stderr, "Unknown exception calling (what: %s)\n", e.what()); + fprintf(stderr, "Unknown exception (what: %s)\n", e.what()); return -ENOSYS; } @@ -198,12 +198,12 @@ void FuseAppBase::fuseDestroy(void *) } struct fuse_args -FuseAppBase::runint(int & argc, char** & argv, FuseAppBase * fa) +FuseAppBase::runint(int & argc, char** & argv) { struct fuse_opt fuse_opts[] = { { NULL, 0, 0 } }; - fuseApp = fa; + fuseApp = this; struct fuse_args args = FUSE_ARGS_INIT(argc, argv); if (fuse_opt_parse(&args, fuseApp, fuse_opts, fuseCall<void *, const char *, int, struct fuse_args *>::helper<&FuseAppBase::opt_parse>) == -1) { diff --git a/libfusepp/fuseapp.h b/libfusepp/fuseAppBase.h index a320d36..d76fbff 100644 --- a/libfusepp/fuseapp.h +++ b/libfusepp/fuseAppBase.h @@ -56,11 +56,14 @@ class FuseAppBase { virtual int fallocate(const char *, int, off_t, off_t, struct fuse_file_info *); virtual int onError(const std::exception & err) throw(); + virtual int fuse_opt_parse(struct fuse_args *args, void *data, const struct fuse_opt opts[], fuse_opt_proc_t proc) = 0; + virtual int main(int &, char **, const struct fuse_operations *) = 0; + #define GetHelper(func) getHelper<&FuseAppBase::func>(typeid(&FuseAppBase::func) != typeid(&FuseApp::func)) template <typename FuseApp> static int run(int & argc, char** & argv, FuseApp * fa) { - auto args = runint(argc, argv, fa); + auto args = fa->runint(argc, argv); struct fuse_operations operations = { fuseCall<const char *, struct stat *>::GetHelper(getattr), fuseCall<const char *, char *, size_t>::GetHelper(readlink), @@ -119,10 +122,11 @@ class FuseAppBase { #endif #endif }; - return fuse_main(args.argc, args.argv, &operations, fa); + return fa->main(args.argc, args.argv, &operations); } + struct fuse_args runint(int &, char ** &); + private: - static struct fuse_args runint(int &, char ** &, FuseAppBase *); static void * fuseInit(struct fuse_conn_info *conn); static void fuseDestroy(void *); |