diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse.h | 50 | ||||
-rw-r--r-- | include/fuse_compat.h | 28 |
2 files changed, 42 insertions, 36 deletions
diff --git a/include/fuse.h b/include/fuse.h index 076b030..8d2c274 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -285,7 +285,7 @@ struct fuse_context { int fuse_main(int argc, char *argv[], const struct fuse_operations *op); */ #define fuse_main(argc, argv, op) \ - __fuse_main(argc, argv, op, sizeof(*(op))) + fuse_main_real(argc, argv, op, sizeof(*(op))) /* ----------------------------------------------------------- * * More detailed API * @@ -399,8 +399,8 @@ int fuse_is_lib_option(const char *opt); * * Do not call this directly, use fuse_main() */ -int __fuse_main(int argc, char *argv[], const struct fuse_operations *op, - size_t op_size); +int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op, + size_t op_size); /* ----------------------------------------------------------- * * Advanced API for event handling, don't worry about this... * @@ -413,29 +413,29 @@ struct fuse_cmd; typedef void (*fuse_processor_t)(struct fuse *, struct fuse_cmd *, void *); /** This is the part of fuse_main() before the event loop */ -struct fuse *__fuse_setup(int argc, char *argv[], - const struct fuse_operations *op, size_t op_size, +struct fuse *fuse_setup(int argc, char *argv[], + const struct fuse_operations *op, size_t op_size, char **mountpoint, int *multithreaded, int *fd); /** This is the part of fuse_main() after the event loop */ -void __fuse_teardown(struct fuse *fuse, int fd, char *mountpoint); +void fuse_teardown(struct fuse *fuse, int fd, char *mountpoint); /** Read a single command. If none are read, return NULL */ -struct fuse_cmd *__fuse_read_cmd(struct fuse *f); +struct fuse_cmd *fuse_read_cmd(struct fuse *f); /** Process a single command */ -void __fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd); +void fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd); /** Multi threaded event loop, which calls the custom command processor function */ -int __fuse_loop_mt(struct fuse *f, fuse_processor_t proc, void *data); +int fuse_loop_mt_proc(struct fuse *f, fuse_processor_t proc, void *data); /** Return the exited flag, which indicates if fuse_exit() has been called */ -int __fuse_exited(struct fuse* f); +int fuse_exited(struct fuse* f); /** Set function which can be used to get the current context */ -void __fuse_set_getcontext_func(struct fuse_context *(*func)(void)); +void fuse_set_getcontext_func(struct fuse_context *(*func)(void)); /* ----------------------------------------------------------- * * Compatibility stuff * @@ -443,26 +443,32 @@ void __fuse_set_getcontext_func(struct fuse_context *(*func)(void)); #if FUSE_USE_VERSION == 21 || FUSE_USE_VERSION == 11 # include <fuse_compat.h> -# define fuse_dirfil_t _fuse_dirfil_t_compat +# define fuse_dirfil_t fuse_dirfil_t_compat +# define __fuse_read_cmd fuse_read_cmd +# define __fuse_process_cmd fuse_process_cmd +# define __fuse_loop_mt fuse_loop_mt_proc # undef fuse_main # undef FUSE_MINOR_VERSION # undef FUSE_MAJOR_VERSION # if FUSE_USE_VERSION == 21 # define FUSE_MAJOR_VERSION 2 # define FUSE_MINOR_VERSION 1 -# define fuse_operations _fuse_operations_compat2 -# define fuse_main _fuse_main_compat2 -# define fuse_new _fuse_new_compat2 -# define __fuse_setup _fuse_setup_compat2 +# define fuse_operations fuse_operations_compat2 +# define fuse_main fuse_main_compat2 +# define fuse_new fuse_new_compat2 +# define __fuse_setup fuse_setup_compat2 +# define __fuse_teardown fuse_teardown +# define __fuse_exited fuse_exited +# define __fuse_set_getcontext_func fuse_set_getcontext_func # else # define FUSE_MAJOR_VERSION 1 # define FUSE_MINOR_VERSION 1 -# define fuse_statfs _fuse_statfs_compat1 -# define fuse_operations _fuse_operations_compat1 -# define fuse_main _fuse_main_compat1 -# define fuse_new _fuse_new_compat1 -# define fuse_mount _fuse_mount_compat1 -# define FUSE_DEBUG _FUSE_DEBUG_COMPAT1 +# define fuse_statfs fuse_statfs_compat1 +# define fuse_operations fuse_operations_compat1 +# define fuse_main fuse_main_compat1 +# define fuse_new fuse_new_compat1 +# define fuse_mount fuse_mount_compat1 +# define FUSE_DEBUG FUSE_DEBUG_COMPAT1 # endif #elif FUSE_USE_VERSION < 22 # error Compatibility with API version other than 21 and 11 not supported diff --git a/include/fuse_compat.h b/include/fuse_compat.h index 7ec9a29..33fc46a 100644 --- a/include/fuse_compat.h +++ b/include/fuse_compat.h @@ -9,11 +9,11 @@ /* these definitions provide source compatibility to prior versions. Do not include this file directly! */ -typedef int (*_fuse_dirfil_t_compat) (fuse_dirh_t h, const char *name, int type); -struct _fuse_operations_compat2 { +typedef int (*fuse_dirfil_t_compat) (fuse_dirh_t h, const char *name, int type); +struct fuse_operations_compat2 { int (*getattr) (const char *, struct stat *); int (*readlink) (const char *, char *, size_t); - int (*getdir) (const char *, fuse_dirh_t, _fuse_dirfil_t_compat); + int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t_compat); int (*mknod) (const char *, mode_t, dev_t); int (*mkdir) (const char *, mode_t); int (*unlink) (const char *); @@ -38,13 +38,13 @@ struct _fuse_operations_compat2 { int (*removexattr) (const char *, const char *); }; -int _fuse_main_compat2(int argc, char *argv[], const struct _fuse_operations_compat2 *op); +int fuse_main_compat2(int argc, char *argv[], const struct fuse_operations_compat2 *op); -struct fuse *_fuse_new_compat2(int fd, const char *opts, const struct _fuse_operations_compat2 *op); +struct fuse *fuse_new_compat2(int fd, const char *opts, const struct fuse_operations_compat2 *op); -struct fuse *_fuse_setup_compat2(int argc, char *argv[], const struct _fuse_operations_compat2 *op, char **mountpoint, int *multithreaded, int *fd); +struct fuse *fuse_setup_compat2(int argc, char *argv[], const struct fuse_operations_compat2 *op, char **mountpoint, int *multithreaded, int *fd); -struct _fuse_statfs_compat1 { +struct fuse_statfs_compat1 { long block_size; long blocks; long blocks_free; @@ -53,10 +53,10 @@ struct _fuse_statfs_compat1 { long namelen; }; -struct _fuse_operations_compat1 { +struct fuse_operations_compat1 { int (*getattr) (const char *, struct stat *); int (*readlink) (const char *, char *, size_t); - int (*getdir) (const char *, fuse_dirh_t, _fuse_dirfil_t_compat); + int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t_compat); int (*mknod) (const char *, mode_t, dev_t); int (*mkdir) (const char *, mode_t); int (*unlink) (const char *); @@ -71,15 +71,15 @@ struct _fuse_operations_compat1 { int (*open) (const char *, int); int (*read) (const char *, char *, size_t, off_t); int (*write) (const char *, const char *, size_t, off_t); - int (*statfs) (struct _fuse_statfs_compat1 *); + int (*statfs) (struct fuse_statfs_compat1 *); int (*release) (const char *, int); int (*fsync) (const char *, int); }; -#define _FUSE_DEBUG_COMPAT1 (1 << 1) +#define FUSE_DEBUG_COMPAT1 (1 << 1) -int _fuse_mount_compat1(const char *mountpoint, const char *args[]); +int fuse_mount_compat1(const char *mountpoint, const char *args[]); -struct fuse *_fuse_new_compat1(int fd, int flags, const struct _fuse_operations_compat1 *op); +struct fuse *fuse_new_compat1(int fd, int flags, const struct fuse_operations_compat1 *op); -void _fuse_main_compat1(int argc, char *argv[], const struct _fuse_operations_compat1 *op); +void fuse_main_compat1(int argc, char *argv[], const struct fuse_operations_compat1 *op); |