From 33c319c567f9735633c98671bb877a9af7304b2a Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 25 Feb 2004 09:19:29 +0000 Subject: [PATCH] added fuse_get() --- ChangeLog | 3 +++ include/fuse.h | 9 +++++++++ lib/helper.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7c39dd8..f2325b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * Clean up option parsing in fuse_main() + * Added fuse_get() function which returns the fuse object created + by fuse_main() + 2004-02-20 Miklos Szeredi * removed old way of mounting (fusermount mountpoint program) diff --git a/include/fuse.h b/include/fuse.h index 7fdcc6e..7a751ae 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -150,6 +150,15 @@ extern "C" { */ void fuse_main(int argc, char *argv[], const struct fuse_operations *op); +/* + * Returns the fuse object created by fuse_main() + * + * This is useful when fuse_get_context() is used. + * + * @return the fuse object + */ +struct fuse *fuse_get(void); + /* ----------------------------------------------------------- * * More detailed API * * ----------------------------------------------------------- */ diff --git a/lib/helper.c b/lib/helper.c index e06c01c..f2ed9b8 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -17,6 +17,11 @@ static struct fuse *fuse; +struct fuse *fuse_get(void) +{ + return fuse; +} + static void usage(char *progname) { fprintf(stderr, -- 2.30.2