summaryrefslogtreecommitdiff
path: root/src/fuse_i.h
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2013-03-22 17:55:16 +0100
committerPino Toscano <toscano.pino@tiscali.it>2013-03-22 17:55:16 +0100
commit6ff1c4ce7e024833263a2cddba424bf5cb48ed42 (patch)
tree16c27a02f610c418acb6f9e144b4e5f2f6edb6ce /src/fuse_i.h
parentb1f475196174db8bc750b545f23449dd5859d965 (diff)
Create and use a fuse struct
Introduce a fuse struct and use it to hold a copy of the fuse_operation and their version, and the private data returned by init. * src/fuse_i.h (struct fuse): New. (fuse_ops25): Remove. (libfuse_fuse): New. (FUSE_OP_HAVE, FUSE_OP_CALL): Use libfuse_fuse. (fsys_privdata): Remove. * src/main.c (fuse_ops25): Remove. (libfuse_fuse): New. (fsys_privdata): Remove. (fuse_new): Create and fill a fuse struct. (fuse_loop): Reject null F instead of anything but FUSE_MAGIC. Set LIBFUSE_FUSE as F. (fuse_loop_mt_proc): Likewise. (fuse_demuxer): Use libfuse_fuse. (fuse_process_cmd): Reject null F instead of anything but FUSE_MAGIC. * src/netfs.c (refresh_context_struct): Use libfuse_fuse.
Diffstat (limited to 'src/fuse_i.h')
-rw-r--r--src/fuse_i.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/fuse_i.h b/src/fuse_i.h
index f4d49faca..922a64466 100644
--- a/src/fuse_i.h
+++ b/src/fuse_i.h
@@ -29,11 +29,19 @@
__FILE__ ":%d\nyou're welcome to put your effort to here.\n\n", \
__LINE__)
-/* pointer to the fuse_operations structure of this translator process */
-extern const struct fuse_operations *fuse_ops25;
+struct fuse {
+ int version;
+ union {
+ struct fuse_operations ops25;
+ } op;
+ void *private_data;
+};
-#define FUSE_OP_HAVE(a) (fuse_ops25->a != NULL)
-#define FUSE_OP_CALL(a,b...) (fuse_ops25->a(b))
+/* pointer to the fuse structure of this translator process */
+extern struct fuse *libfuse_fuse;
+
+#define FUSE_OP_HAVE(a) (libfuse_fuse->op.ops25.a != NULL)
+#define FUSE_OP_CALL(a,b...) (libfuse_fuse->op.ops25.a(b))
#define NN_INFO(dir) ((void *) &(dir)->nn->info.info25)
@@ -136,9 +144,6 @@ struct _libfuse_params {
extern struct _libfuse_params libfuse_params;
-/* the private data pointer returned from init() callback */
-extern void *fsys_privdata;
-
/* magic number, passed from fuse_mount to fuse_new */
#define FUSE_MAGIC ((int) 0x66757365)