aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-04-12 09:33:22 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-04-12 09:33:22 -0700
commitacd0e6469a7270339119a4e350f73ba71a2903eb (patch)
tree2e806bb7099bcc7a5db418366c13583c7df84ec1 /include
parent6c94a9f5b66e733ce455c1ddceb2f92be162cf0b (diff)
Improved documentation of fuse_context.private_data
In particular, don't call it "user_data" in one place and "private_data" elsewhere. Changing the name of the variable in the prototype should not affect backwards compatibility. Fixes: #155.
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 6bba1ce..754303f 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -517,9 +517,10 @@ struct fuse_operations {
/**
* Initialize filesystem
*
- * The return value will passed in the private_data field of
- * fuse_context to all file operations and as a parameter to the
- * destroy() method.
+ * The return value will passed in the `private_data` field of
+ * `struct fuse_context` to all file operations, and as a
+ * parameter to the destroy() method. It overrides the initial
+ * value provided to fuse_main() / fuse_new().
*/
void *(*init) (struct fuse_conn_info *conn,
struct fuse_config *cfg);
@@ -529,7 +530,7 @@ struct fuse_operations {
*
* Called on filesystem exit.
*/
- void (*destroy) (void *);
+ void (*destroy) (void *private_data);
/**
* Check file access permissions
@@ -767,17 +768,19 @@ struct fuse_context {
* @param argc the argument counter passed to the main() function
* @param argv the argument vector passed to the main() function
* @param op the file system operation
- * @param user_data user data supplied in the context during the init() method
+ * @param private_data Initial value for the `private_data`
+ * field of `struct fuse_context`. May be overriden by the
+ * `struct fuse_operations.init` handler.
* @return 0 on success, nonzero on failure
*
* Example usage, see hello.c
*/
/*
int fuse_main(int argc, char *argv[], const struct fuse_operations *op,
- void *user_data);
+ void *private_data);
*/
-#define fuse_main(argc, argv, op, user_data) \
- fuse_main_real(argc, argv, op, sizeof(*(op)), user_data)
+#define fuse_main(argc, argv, op, private_data) \
+ fuse_main_real(argc, argv, op, sizeof(*(op)), private_data)
/* ----------------------------------------------------------- *
* More detailed API *
@@ -805,11 +808,13 @@ struct fuse_context {
* @param args argument vector
* @param op the filesystem operations
* @param op_size the size of the fuse_operations structure
- * @param user_data user data supplied in the context during the init() method
+ * @param private_data Initial value for the `private_data`
+ * field of `struct fuse_context`. May be overriden by the
+ * `struct fuse_operations.init` handler.
* @return the created FUSE handle
*/
struct fuse *fuse_new(struct fuse_args *args, const struct fuse_operations *op,
- size_t op_size, void *user_data);
+ size_t op_size, void *private_data);
/**
* Mount a FUSE file system.
@@ -944,7 +949,7 @@ int fuse_interrupted(void);
* Do not call this directly, use fuse_main()
*/
int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
- size_t op_size, void *user_data);
+ size_t op_size, void *private_data);
/**
* Start the cleanup thread when using option "remember".
@@ -1082,11 +1087,13 @@ int fuse_notify_poll(struct fuse_pollhandle *ph);
*
* @param op the filesystem operations
* @param op_size the size of the fuse_operations structure
- * @param user_data user data supplied in the context during the init() method
+ * @param private_data Initial value for the `private_data`
+ * field of `struct fuse_context`. May be overriden by the
+ * `struct fuse_operations.init` handler.
* @return a new filesystem object
*/
struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
- void *user_data);
+ void *private_data);
/**
* Factory for creating filesystem objects