Home | History | Annotate | Line # | Download | only in librefuse
fuse.h revision 1.35
      1  1.35      abs /* $NetBSD: fuse.h,v 1.35 2023/04/21 19:29:31 abs Exp $ */
      2  1.18  xtraeme 
      3   1.1      agc /*
      4   1.1      agc  * Copyright  2007 Alistair Crooks.  All rights reserved.
      5   1.1      agc  *
      6   1.1      agc  * Redistribution and use in source and binary forms, with or without
      7   1.1      agc  * modification, are permitted provided that the following conditions
      8   1.1      agc  * are met:
      9   1.1      agc  * 1. Redistributions of source code must retain the above copyright
     10   1.1      agc  *    notice, this list of conditions and the following disclaimer.
     11   1.1      agc  * 2. Redistributions in binary form must reproduce the above copyright
     12   1.1      agc  *    notice, this list of conditions and the following disclaimer in the
     13   1.1      agc  *    documentation and/or other materials provided with the distribution.
     14   1.1      agc  * 3. The name of the author may not be used to endorse or promote
     15   1.1      agc  *    products derived from this software without specific prior written
     16   1.1      agc  *    permission.
     17   1.1      agc  *
     18   1.1      agc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     19   1.1      agc  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     20   1.1      agc  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21   1.1      agc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     22   1.1      agc  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23   1.1      agc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
     24   1.1      agc  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25   1.1      agc  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     26   1.1      agc  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     27   1.1      agc  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     28   1.1      agc  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29   1.1      agc  */
     30   1.1      agc #ifndef FUSE_H_
     31  1.24      pho #define FUSE_H_	20211204
     32  1.16      agc 
     33  1.33      pho #include <fcntl.h>
     34  1.30      pho #include <fuse_opt.h>
     35  1.26      pho #include <refuse/buf.h>
     36  1.34      pho #include <refuse/chan.h>
     37  1.28      pho #include <refuse/legacy.h>
     38  1.27      pho #include <refuse/poll.h>
     39  1.25      pho #include <refuse/session.h>
     40  1.25      pho #include <sys/cdefs.h>
     41  1.25      pho #include <sys/stat.h>
     42  1.25      pho #include <sys/statvfs.h>
     43   1.1      agc #include <sys/types.h>
     44   1.1      agc #include <utime.h>
     45   1.1      agc 
     46  1.29      pho /* This used to be (maj) * 10 + (min) until FUSE 3.10, and then
     47  1.29      pho  * changed to (maj) * 100 + (min). We can't just use the "newer"
     48  1.29      pho  * definition because filesystems in the wild still use the older one
     49  1.29      pho  * in their FUSE_USE_VERSION request. */
     50  1.29      pho #define FUSE_MAKE_VERSION(maj, min)					\
     51  1.29      pho 	(((maj) > 3 || ((maj) == 3 && (min) >= 10))			\
     52  1.29      pho 	? (maj) * 100 + (min)						\
     53  1.29      pho 	: (maj) *  10 + (min))
     54  1.29      pho 
     55  1.29      pho /* The latest version of FUSE API currently provided by ReFUSE. This
     56  1.29      pho  * is an implementation detail. User code should not rely on this
     57  1.29      pho  * constant. */
     58  1.34      pho #define _REFUSE_MAJOR_VERSION_	3
     59  1.34      pho #define _REFUSE_MINOR_VERSION_	10
     60  1.24      pho 
     61  1.29      pho #define _REFUSE_VERSION_	FUSE_MAKE_VERSION(_REFUSE_MAJOR_VERSION_, _REFUSE_MINOR_VERSION_)
     62  1.24      pho 
     63  1.24      pho /* FUSE_USE_VERSION is expected to be defined by user code to
     64  1.24      pho  * determine the API to be used. Although defining this macro is
     65  1.24      pho  * mandatory in the original FUSE implementation, refuse hasn't
     66  1.24      pho  * required this so we only emit a warning if it's undefined. */
     67  1.24      pho #if defined(FUSE_USE_VERSION)
     68  1.29      pho #	if FUSE_USE_VERSION > _REFUSE_VERSION_
     69  1.24      pho #		warning "The requested API version is higher than the latest one supported by refuse."
     70  1.29      pho #	elif FUSE_USE_VERSION < 11
     71  1.29      pho #		warning "The requested API version is lower than the oldest one supported by refuse."
     72  1.24      pho #	endif
     73  1.24      pho #else
     74  1.29      pho #	if !defined(_REFUSE_IMPLEMENTATION_)
     75  1.29      pho #		warning "User code including <fuse.h> should define FUSE_USE_VERSION before including this header. Defaulting to the latest version."
     76  1.29      pho #		define FUSE_USE_VERSION	_REFUSE_VERSION_
     77  1.29      pho #	endif
     78  1.29      pho #endif
     79  1.29      pho 
     80  1.29      pho /* FUSE_VERSION is supposed to be the latest version of FUSE API
     81  1.29      pho  * supported by the library. However, due to the way how original FUSE
     82  1.29      pho  * is implemented, some filesystems set FUSE_USE_VERSION to some old
     83  1.29      pho  * one and then expect the actual API version exposed by the library
     84  1.29      pho  * to be something newer if FUSE_VERSION is higher than that. ReFUSE
     85  1.29      pho  * doesn't work that way, so this has to be always identical to
     86  1.29      pho  * FUSE_USE_VERSION.
     87  1.29      pho  */
     88  1.29      pho #if defined(FUSE_USE_VERSION)
     89  1.29      pho #	define FUSE_VERSION		FUSE_USE_VERSION
     90  1.29      pho #	define FUSE_MAJOR_VERSION	(FUSE_VERSION / 10)
     91  1.29      pho #	define FUSE_MINOR_VERSION	(FUSE_VERSION % 10)
     92  1.24      pho #endif
     93  1.24      pho 
     94   1.1      agc #ifdef __cplusplus
     95   1.1      agc extern "C" {
     96   1.1      agc #endif
     97   1.1      agc 
     98   1.4      agc struct fuse;
     99   1.4      agc 
    100   1.1      agc struct fuse_file_info {
    101   1.1      agc 	int32_t		flags;
    102  1.33      pho 	uint32_t	fh_old;			/* Removed as of FUSE 3.0. */
    103  1.33      pho 	int32_t		writepage:1;
    104   1.1      agc 	uint32_t	direct_io:1;
    105   1.1      agc 	uint32_t	keep_cache:1;
    106   1.1      agc 	uint32_t	flush:1;
    107  1.33      pho 	uint32_t	nonseekable:1;		/* Added on FUSE 2.8. */
    108  1.33      pho 	uint32_t	flock_release:1;	/* Added on FUSE 2.9. */
    109  1.33      pho 	uint32_t	cache_readdir:1;	/* Added on FUSE 3.5. */
    110  1.33      pho 	uint32_t	padding:26;
    111   1.1      agc 	uint64_t	fh;
    112  1.33      pho 	uint64_t	lock_owner;		/* Added on FUSE 2.6. */
    113  1.33      pho 	uint32_t	poll_events;		/* Added on FUSE 3.0. */
    114   1.1      agc };
    115   1.1      agc 
    116   1.1      agc struct fuse_conn_info {
    117  1.33      pho 	uint32_t	proto_major;
    118  1.33      pho 	uint32_t	proto_minor;
    119  1.33      pho 	uint32_t	async_read;		/* Removed as of FUSE 3.0. */
    120  1.33      pho 	uint32_t	max_write;
    121  1.33      pho 	uint32_t	max_read;		/* Added on FUSE 3.0. */
    122  1.33      pho 	uint32_t	max_readahead;
    123  1.33      pho 	uint32_t	capable;		/* Added on FUSE 2.8. */
    124  1.33      pho 	uint32_t	want;			/* Added on FUSE 2.8. */
    125  1.33      pho 	uint32_t	max_background;		/* Added on FUSE 3.0. */
    126  1.33      pho 	uint32_t	congestion_threshold;	/* Added on FUSE 3.0. */
    127  1.33      pho 	uint32_t	time_gran;		/* Added on FUSE 3.0. */
    128  1.33      pho 	uint32_t	reserved[22];
    129   1.1      agc };
    130   1.1      agc 
    131   1.3    pooka /* equivalent'ish of puffs_cc */
    132   1.3    pooka struct fuse_context {
    133   1.3    pooka 	struct fuse	*fuse;
    134   1.3    pooka 	uid_t		uid;
    135   1.3    pooka 	gid_t		gid;
    136   1.3    pooka 	pid_t		pid;
    137   1.3    pooka 	void		*private_data;
    138  1.33      pho 	mode_t		umask;			/* Added on FUSE 2.8. */
    139  1.33      pho };
    140  1.33      pho 
    141  1.33      pho /* Capability bits for fuse_conn_info.capable and
    142  1.33      pho  * fuse_conn_info.want */
    143  1.33      pho #define FUSE_CAP_ASYNC_READ		(1 << 0)
    144  1.33      pho #define FUSE_CAP_POSIX_LOCKS		(1 << 1)
    145  1.33      pho #define FUSE_CAP_ATOMIC_O_TRUNC		(1 << 3)
    146  1.33      pho #define FUSE_CAP_EXPORT_SUPPORT		(1 << 4)
    147  1.33      pho #define FUSE_CAP_BIG_WRITES		(1 << 5)	/* Removed as of FUSE 3.0. */
    148  1.33      pho #define FUSE_CAP_DONT_MASK		(1 << 6)
    149  1.33      pho #define FUSE_CAP_SPLICE_WRITE		(1 << 7)	/* Added on FUSE 3.0. */
    150  1.33      pho #define FUSE_CAP_SPLICE_MOVE		(1 << 8)	/* Added on FUSE 3.0. */
    151  1.33      pho #define FUSE_CAP_SPLICE_READ		(1 << 9)	/* Added on FUSE 3.0. */
    152  1.33      pho #define FUSE_CAP_FLOCK_LOCKS		(1 << 10)	/* Added on FUSE 3.0. */
    153  1.33      pho #define FUSE_CAP_IOCTL_DIR		(1 << 11)	/* Added on FUSE 3.0. */
    154  1.33      pho #define FUSE_CAP_AUTO_INVAL_DATA	(1 << 12)	/* Added on FUSE 3.0. */
    155  1.33      pho #define FUSE_CAP_READDIRPLUS		(1 << 13)	/* Added on FUSE 3.0. */
    156  1.33      pho #define FUSE_CAP_READDIRPLUS_AUTO	(1 << 14)	/* Added on FUSE 3.0. */
    157  1.33      pho #define FUSE_CAP_ASYNC_DIO		(1 << 15)	/* Added on FUSE 3.0. */
    158  1.33      pho #define FUSE_CAP_WRITEBACK_CACHE	(1 << 16)	/* Added on FUSE 3.0. */
    159  1.33      pho #define FUSE_CAP_NO_OPEN_SUPPORT	(1 << 17)	/* Added on FUSE 3.0. */
    160  1.33      pho #define FUSE_CAP_PARALLEL_DIROPS	(1 << 18)	/* Added on FUSE 3.0. */
    161  1.33      pho #define FUSE_CAP_POSIX_ACL		(1 << 19)	/* Added on FUSE 3.0. */
    162  1.33      pho #define FUSE_CAP_HANDLE_KILLPRIV	(1 << 20)	/* Added on FUSE 3.0. */
    163  1.33      pho #define FUSE_CAP_CACHE_SYMLINKS		(1 << 23)	/* Added on FUSE 3.10. */
    164  1.33      pho #define FUSE_CAP_NO_OPENDIR_SUPPORT	(1 << 24)	/* Added on FUSE 3.5. */
    165  1.33      pho 
    166  1.33      pho /* ioctl flags */
    167  1.33      pho #define FUSE_IOCTL_COMPAT	(1 << 0)
    168  1.33      pho #define FUSE_IOCTL_UNRESTRICTED	(1 << 1)
    169  1.33      pho #define FUSE_IOCTL_RETRY	(1 << 2)
    170  1.33      pho #define FUSE_IOCTL_DIR		(1 << 4)	/* Added on FUSE 2.9. */
    171  1.33      pho #define FUSE_IOCTL_MAX_IOV	256
    172  1.33      pho 
    173  1.33      pho /* readdir() flags, appeared on FUSE 3.0. */
    174  1.33      pho enum fuse_readdir_flags {
    175  1.33      pho 	FUSE_READDIR_PLUS	= (1 << 0),
    176  1.33      pho };
    177  1.33      pho enum fuse_fill_dir_flags {
    178  1.33      pho 	FUSE_FILL_DIR_PLUS	= (1 << 1),
    179  1.33      pho };
    180  1.33      pho 
    181  1.33      pho /* Configuration of the high-level API, appeared on FUSE 3.0. */
    182  1.33      pho struct fuse_config {
    183  1.33      pho 	int		set_gid;
    184  1.33      pho 	unsigned int	gid;
    185  1.33      pho 	int		set_uid;
    186  1.33      pho 	unsigned int	uid;
    187  1.33      pho 	int		set_mode;
    188  1.33      pho 	unsigned int	umask;
    189  1.33      pho 	double		entry_timeout;
    190  1.33      pho 	double		negative_timeout;
    191  1.33      pho 	double		attr_timeout;
    192  1.33      pho 	int		intr;
    193  1.33      pho 	int		intr_signal;
    194  1.33      pho 	int		remember;
    195  1.33      pho 	int		hard_remove;
    196  1.33      pho 	int		use_ino;
    197  1.33      pho 	int		readdir_ino;
    198  1.33      pho 	int		direct_io;
    199  1.33      pho 	int		kernel_cache;
    200  1.33      pho 	int		auto_cache;
    201  1.33      pho 	int		ac_attr_timeout_set;
    202  1.33      pho 	double		ac_attr_timeout;
    203  1.33      pho 	int		nullpath_ok;
    204  1.33      pho };
    205  1.33      pho 
    206  1.33      pho /* Configuration of fuse_loop_mt(), appeared on FUSE 3.2. */
    207  1.33      pho struct fuse_loop_config {
    208  1.33      pho 	int		clone_fd;
    209  1.33      pho 	unsigned int	max_idle_threads;
    210   1.3    pooka };
    211   1.3    pooka 
    212   1.1      agc /**
    213   1.1      agc  * Argument list
    214   1.1      agc  */
    215   1.1      agc struct fuse_args {
    216   1.1      agc 	int	argc;
    217   1.1      agc 	char	**argv;
    218   1.1      agc 	int	allocated;
    219   1.1      agc };
    220   1.1      agc 
    221   1.1      agc /**
    222   1.1      agc  * Initializer for 'struct fuse_args'
    223   1.1      agc  */
    224   1.1      agc #define FUSE_ARGS_INIT(argc, argv) { argc, argv, 0 }
    225   1.1      agc 
    226  1.31      pho /* Functions that have existed since the beginning and have never
    227  1.31      pho  * changed between API versions. */
    228   1.8    pooka int fuse_loop(struct fuse *);
    229   1.4      agc void fuse_exit(struct fuse *);
    230  1.32      pho struct fuse_context *fuse_get_context(void);
    231  1.32      pho 
    232  1.32      pho /* Print available library options. Appeared on FUSE 3.1. */
    233  1.32      pho void fuse_lib_help(struct fuse_args *args);
    234  1.31      pho 
    235  1.31      pho /* Daemonize the calling process. Appeared on FUSE 2.6.
    236  1.31      pho  *
    237  1.31      pho  * NOTE: This function used to have a wrong prototype in librefuse at
    238  1.31      pho  * the time when FUSE_H_ < 20211204. */
    239  1.31      pho int fuse_daemonize(int foreground) __RENAME(fuse_daemonize_rev1);
    240  1.31      pho 
    241  1.32      pho /* Check if a request has been interrupted. Appeared on FUSE 2.6. */
    242  1.32      pho int fuse_interrupted(void);
    243  1.32      pho 
    244  1.32      pho /* Invalidate cache for a given path. Appeared on FUSE 3.2. */
    245  1.32      pho int fuse_invalidate_path(struct fuse *fuse, const char *path);
    246  1.32      pho 
    247  1.32      pho /* Get the version number of the library. Appeared on FUSE 2.7. */
    248  1.23     maya int fuse_version(void);
    249   1.8    pooka 
    250  1.32      pho /* Get the version string of the library. Appeared on FUSE 3.0. */
    251  1.32      pho const char *fuse_pkgversion(void);
    252  1.32      pho 
    253  1.32      pho /* Get the current supplementary group IDs for the current request, or
    254  1.32      pho  * return -errno on failure. Appeared on FUSE 2.8. */
    255  1.32      pho int fuse_getgroups(int size, gid_t list[]);
    256  1.32      pho 
    257  1.32      pho /* Start the cleanup thread when using option "-oremember". Appeared
    258  1.32      pho  * on FUSE 2.9. */
    259  1.32      pho int fuse_start_cleanup_thread(struct fuse *fuse);
    260  1.32      pho 
    261  1.32      pho /* Stop the cleanup thread when using "-oremember". Appeared on FUSE
    262  1.32      pho  * 2.9. */
    263  1.32      pho void fuse_stop_cleanup_thread(struct fuse *fuse);
    264  1.32      pho 
    265  1.32      pho /* Iterate over cache removing stale entries, used in conjunction with
    266  1.32      pho  * "-oremember". Return the number of seconds until the next
    267  1.32      pho  * cleanup. Appeared on FUSE 2.9. */
    268  1.32      pho int fuse_clean_cache(struct fuse *fuse);
    269   1.1      agc 
    270  1.34      pho /* Generic implementation of fuse_main(). The exact type of "op" is
    271  1.34      pho  * determined by op_version. This is only an implementation detail:
    272  1.34      pho  * user code should never call this directly. */
    273  1.34      pho int __fuse_main(int argc, char* argv[],
    274  1.34      pho 		const void* op, int op_version, void* user_data);
    275  1.34      pho 
    276  1.34      pho /* NOTE: Compatibility headers are included
    277  1.34      pho  * unconditionally. Declarations in these headers all have a version
    278  1.34      pho  * postfix, and need to be aliased depending on FUSE_USE_VERSION. */
    279  1.34      pho #include <refuse/v11.h>
    280  1.34      pho #include <refuse/v21.h>
    281  1.34      pho #include <refuse/v22.h>
    282  1.34      pho #include <refuse/v23.h>
    283  1.34      pho #include <refuse/v25.h>
    284  1.34      pho #include <refuse/v26.h>
    285  1.34      pho #include <refuse/v28.h>
    286  1.34      pho #include <refuse/v29.h>
    287  1.34      pho #include <refuse/v30.h>
    288  1.34      pho #include <refuse/v32.h>
    289  1.34      pho #include <refuse/v34.h>
    290  1.34      pho #include <refuse/v35.h>
    291  1.34      pho #include <refuse/v38.h>
    292  1.34      pho 
    293  1.34      pho /* NOTE: refuse/fs.h relies on some typedef's in refuse/v*.h */
    294  1.34      pho #include <refuse/fs.h>
    295  1.34      pho 
    296  1.34      pho #define _MK_FUSE_OPERATIONS_(VER)	__CONCAT(fuse_operations_v,VER)
    297  1.34      pho 
    298  1.34      pho /* Version specific types and functions. */
    299  1.34      pho #if defined(FUSE_USE_VERSION)
    300  1.34      pho /* ===== FUSE 1.x ===== */
    301  1.34      pho #	if FUSE_USE_VERSION < 21
    302  1.34      pho 		/* Types */
    303  1.34      pho #		define _FUSE_OP_VERSION__	11 /* Implementation detail */
    304  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v11
    305  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    306  1.34      pho 		/* Functions */
    307  1.34      pho static __inline int
    308  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op) {
    309  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, NULL);
    310  1.34      pho }
    311  1.34      pho #		define fuse_mount		fuse_mount_v11
    312  1.34      pho #		define fuse_unmount		fuse_unmount_v11
    313  1.34      pho static __inline struct fuse *
    314  1.34      pho fuse_new(int fd, int flags, const struct fuse_operations *op) {
    315  1.34      pho     return fuse_new_v11(fd, flags, op, _FUSE_OP_VERSION__);
    316  1.34      pho }
    317  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    318  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    319  1.34      pho 
    320  1.34      pho /* ===== FUSE 2.1 ===== */
    321  1.34      pho #	elif FUSE_USE_VERSION == 21
    322  1.34      pho 		/* Types */
    323  1.34      pho #		define _FUSE_OP_VERSION__	21
    324  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v11
    325  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    326  1.34      pho 		/* Functions */
    327  1.34      pho static __inline int
    328  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op) {
    329  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, NULL);
    330  1.34      pho }
    331  1.34      pho #		define fuse_mount		fuse_mount_v21
    332  1.34      pho #		define fuse_unmount		fuse_unmount_v11
    333  1.34      pho static __inline struct fuse *
    334  1.34      pho fuse_new(int fd, const char *opts, const struct fuse_operations *op) {
    335  1.34      pho     return fuse_new_v21(fd, opts, op, _FUSE_OP_VERSION__, NULL);
    336  1.34      pho }
    337  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    338  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    339  1.34      pho 
    340  1.34      pho /* ===== FUSE 2.2 ===== */
    341  1.34      pho #	elif FUSE_USE_VERSION == 22
    342  1.34      pho 		/* Types */
    343  1.34      pho #		define _FUSE_OP_VERSION__	22
    344  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v22
    345  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    346  1.34      pho 		/* Functions */
    347  1.34      pho static __inline int
    348  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op) {
    349  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, NULL);
    350  1.34      pho }
    351  1.34      pho #		define fuse_mount		fuse_mount_v21
    352  1.34      pho #		define fuse_unmount		fuse_unmount_v11
    353  1.34      pho static __inline struct fuse *
    354  1.34      pho fuse_new(int fd, const char *opts, const struct fuse_operations *op) {
    355  1.34      pho     return fuse_new_v21(fd, opts, op, _FUSE_OP_VERSION__, NULL);
    356  1.34      pho }
    357  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    358  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    359  1.34      pho static __inline struct fuse *
    360  1.34      pho fuse_setup(int argc, char *argv[], const struct fuse_operations *op,
    361  1.34      pho 	   size_t op_size __attribute__((__unused__)),
    362  1.34      pho 	   char **mountpoint, int *multithreaded, int *fd) {
    363  1.34      pho     return fuse_setup_v22(argc, argv, op, _FUSE_OP_VERSION__,
    364  1.34      pho 			  mountpoint, multithreaded, fd);
    365  1.34      pho }
    366  1.34      pho #		define fuse_teardown		fuse_teardown_v22
    367  1.34      pho 
    368  1.34      pho /* ===== FUSE 2.3, 2.4 ===== */
    369  1.34      pho #	elif FUSE_USE_VERSION >= 23 && FUSE_USE_VERSION <= 24
    370  1.34      pho 		/* Types */
    371  1.34      pho #		define _FUSE_OP_VERSION__	23
    372  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v22
    373  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v23
    374  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    375  1.34      pho 		/* Functions */
    376  1.34      pho static __inline int
    377  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op) {
    378  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, NULL);
    379  1.34      pho }
    380  1.34      pho #		define fuse_mount		fuse_mount_v21
    381  1.34      pho #		define fuse_unmount		fuse_unmount_v11
    382  1.34      pho static __inline struct fuse *
    383  1.34      pho fuse_new(int fd, const char *opts, const struct fuse_operations *op,
    384  1.34      pho 	 size_t op_size __attribute__((__unused__))) {
    385  1.34      pho     return fuse_new_v21(fd, opts, op, _FUSE_OP_VERSION__, NULL);
    386  1.34      pho }
    387  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    388  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    389  1.34      pho static __inline struct fuse *
    390  1.34      pho fuse_setup(int argc, char *argv[], const struct fuse_operations *op,
    391  1.34      pho 	   size_t op_size __attribute__((__unused__)),
    392  1.34      pho 	   char **mountpoint, int *multithreaded, int *fd) {
    393  1.34      pho     return fuse_setup_v22(argc, argv, op, _FUSE_OP_VERSION__,
    394  1.34      pho 			  mountpoint, multithreaded, fd);
    395  1.34      pho }
    396  1.34      pho #		define fuse_teardown		fuse_teardown_v22
    397  1.34      pho 
    398  1.34      pho /* ===== FUSE 2.5 ===== */
    399  1.34      pho #	elif FUSE_USE_VERSION == 25
    400  1.34      pho 		/* Types */
    401  1.34      pho #		define _FUSE_OP_VERSION__	25
    402  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v22
    403  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v23
    404  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    405  1.34      pho 		/* Functions */
    406  1.34      pho static __inline int
    407  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op) {
    408  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, NULL);
    409  1.34      pho }
    410  1.34      pho #		define fuse_mount		fuse_mount_v25
    411  1.34      pho #		define fuse_unmount		fuse_unmount_v11
    412  1.34      pho static __inline struct fuse *
    413  1.34      pho fuse_new(int fd, struct fuse_args *args, const struct fuse_operations *op,
    414  1.34      pho 	 size_t op_size __attribute__((__unused__))) {
    415  1.34      pho     return fuse_new_v25(fd, args, op, _FUSE_OP_VERSION__, NULL);
    416  1.34      pho }
    417  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    418  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    419  1.34      pho static __inline struct fuse *
    420  1.34      pho fuse_setup(int argc, char *argv[], const struct fuse_operations *op,
    421  1.34      pho 	   size_t op_size __attribute__((__unused__)),
    422  1.34      pho 	   char **mountpoint, int *multithreaded, int *fd) {
    423  1.34      pho     return fuse_setup_v22(argc, argv, op, _FUSE_OP_VERSION__,
    424  1.34      pho 			  mountpoint, multithreaded, fd);
    425  1.34      pho }
    426  1.34      pho #		define fuse_teardown		fuse_teardown_v22
    427  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v25
    428  1.34      pho 
    429  1.34      pho /* ===== FUSE 2.6, 2.7 ===== */
    430  1.34      pho #	elif FUSE_USE_VERSION >= 26 && FUSE_USE_VERSION <= 27
    431  1.34      pho 		/* Types */
    432  1.34      pho #		define _FUSE_OP_VERSION__	26
    433  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v22
    434  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v23
    435  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    436  1.34      pho 		/* Functions */
    437  1.34      pho static __inline struct fuse_fs *
    438  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    439  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    440  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    441  1.34      pho }
    442  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v27
    443  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v27
    444  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v27
    445  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v27
    446  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v27
    447  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v27
    448  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v27
    449  1.34      pho #		define fuse_fs_init		fuse_fs_init_v27
    450  1.34      pho static __inline int
    451  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    452  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    453  1.34      pho }
    454  1.34      pho #		define fuse_mount		fuse_mount_v26
    455  1.34      pho #		define fuse_unmount		fuse_unmount_v26
    456  1.34      pho static __inline struct fuse *
    457  1.34      pho fuse_new(struct fuse_chan *ch, struct fuse_args *args,
    458  1.34      pho 	 const struct fuse_operations *op,
    459  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    460  1.34      pho     return fuse_new_v26(ch, args, op, _FUSE_OP_VERSION__, user_data);
    461  1.34      pho }
    462  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    463  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    464  1.34      pho static __inline struct fuse *
    465  1.34      pho fuse_setup(int argc, char *argv[], const struct fuse_operations *op,
    466  1.34      pho 	   size_t op_size __attribute__((__unused__)),
    467  1.34      pho 	   char **mountpoint, int *multithreaded, void *user_data) {
    468  1.34      pho     return fuse_setup_v26(argc, argv, op, _FUSE_OP_VERSION__,
    469  1.34      pho 			  mountpoint, multithreaded, user_data);
    470  1.34      pho }
    471  1.34      pho #		define fuse_teardown		fuse_teardown_v26
    472  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v25
    473  1.34      pho 
    474  1.34      pho /* ===== FUSE 2.8 ===== */
    475  1.34      pho #	elif FUSE_USE_VERSION == 28
    476  1.34      pho 		/* Types */
    477  1.34      pho #		define _FUSE_OP_VERSION__	28
    478  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v22
    479  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v23
    480  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    481  1.34      pho 		/* Functions */
    482  1.34      pho static __inline struct fuse_fs *
    483  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    484  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    485  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    486  1.34      pho }
    487  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v27
    488  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v27
    489  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v27
    490  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v27
    491  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v27
    492  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v27
    493  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v27
    494  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v28
    495  1.34      pho #		define fuse_fs_init		fuse_fs_init_v27
    496  1.34      pho static __inline int
    497  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    498  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    499  1.34      pho }
    500  1.34      pho #		define fuse_mount		fuse_mount_v26
    501  1.34      pho #		define fuse_unmount		fuse_unmount_v26
    502  1.34      pho static __inline struct fuse *
    503  1.34      pho fuse_new(struct fuse_chan *ch, struct fuse_args *args,
    504  1.34      pho 	 const struct fuse_operations *op,
    505  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    506  1.34      pho     return fuse_new_v26(ch, args, op, _FUSE_OP_VERSION__, user_data);
    507  1.34      pho }
    508  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    509  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    510  1.34      pho static __inline struct fuse *
    511  1.34      pho fuse_setup(int argc, char *argv[], const struct fuse_operations *op,
    512  1.34      pho 	   size_t op_size __attribute__((__unused__)),
    513  1.34      pho 	   char **mountpoint, int *multithreaded, void *user_data) {
    514  1.34      pho     return fuse_setup_v26(argc, argv, op, _FUSE_OP_VERSION__,
    515  1.34      pho 			  mountpoint, multithreaded, user_data);
    516  1.34      pho }
    517  1.34      pho #		define fuse_teardown		fuse_teardown_v26
    518  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v25
    519  1.34      pho 
    520  1.34      pho /* ===== FUSE 2.9 ===== */
    521  1.34      pho #	elif FUSE_USE_VERSION == 29
    522  1.34      pho 		/* Types */
    523  1.34      pho #		define _FUSE_OP_VERSION__	29
    524  1.34      pho #		define fuse_dirfil_t		fuse_dirfil_t_v22
    525  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v23
    526  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    527  1.34      pho 		/* Functions */
    528  1.34      pho static __inline struct fuse_fs *
    529  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    530  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    531  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    532  1.34      pho }
    533  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v27
    534  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v27
    535  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v27
    536  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v27
    537  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v27
    538  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v27
    539  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v27
    540  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v28
    541  1.34      pho #		define fuse_fs_init		fuse_fs_init_v27
    542  1.34      pho static __inline int
    543  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    544  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    545  1.34      pho }
    546  1.34      pho #		define fuse_mount		fuse_mount_v26
    547  1.34      pho #		define fuse_unmount		fuse_unmount_v26
    548  1.34      pho static __inline struct fuse *
    549  1.34      pho fuse_new(struct fuse_chan *ch, struct fuse_args *args,
    550  1.34      pho 	 const struct fuse_operations *op,
    551  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    552  1.34      pho     return fuse_new_v26(ch, args, op, _FUSE_OP_VERSION__, user_data);
    553  1.34      pho }
    554  1.34      pho #		define fuse_destroy		fuse_destroy_v11
    555  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v11
    556  1.34      pho static __inline struct fuse *
    557  1.34      pho fuse_setup(int argc, char *argv[], const struct fuse_operations *op,
    558  1.34      pho 	   size_t op_size __attribute__((__unused__)),
    559  1.34      pho 	   char **mountpoint, int *multithreaded, void *user_data) {
    560  1.34      pho     return fuse_setup_v26(argc, argv, op, _FUSE_OP_VERSION__,
    561  1.34      pho 			  mountpoint, multithreaded, user_data);
    562  1.34      pho }
    563  1.34      pho #		define fuse_teardown		fuse_teardown_v26
    564  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v25
    565  1.34      pho 
    566  1.34      pho /* ===== FUSE 3.0, 3.1 ===== */
    567  1.34      pho #	elif FUSE_USE_VERSION >= 30 && FUSE_USE_VERSION <= 31
    568  1.34      pho 		/* Types */
    569  1.34      pho #		define _FUSE_OP_VERSION__	30
    570  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v30
    571  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    572  1.34      pho 		/* Functions */
    573  1.34      pho static __inline struct fuse_fs *
    574  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    575  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    576  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    577  1.34      pho }
    578  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v30
    579  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v30
    580  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v30
    581  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v30
    582  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v30
    583  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v30
    584  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v30
    585  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v28
    586  1.34      pho #		define fuse_fs_init		fuse_fs_init_v30
    587  1.34      pho static __inline int
    588  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    589  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    590  1.34      pho }
    591  1.34      pho #		define fuse_mount		fuse_mount_v30
    592  1.34      pho #		define fuse_unmount		fuse_unmount_v30
    593  1.34      pho static __inline struct fuse *
    594  1.34      pho fuse_new(struct fuse_args *args, const struct fuse_operations *op,
    595  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    596  1.34      pho     return fuse_new_v30(args, op, _FUSE_OP_VERSION__, user_data);
    597  1.34      pho }
    598  1.34      pho #		define fuse_destroy		fuse_destroy_v30
    599  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v30
    600  1.34      pho 		/* fuse_setup(3) and fuse_teardown(3) have been removed as of FUSE 3.0. */
    601  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v30
    602  1.34      pho 
    603  1.34      pho /* ===== FUSE 3.2, 3.3 ===== */
    604  1.34      pho #	elif FUSE_USE_VERSION >= 32 && FUSE_USE_VERSION <= 33
    605  1.34      pho 		/* Types */
    606  1.34      pho #		define _FUSE_OP_VERSION__	30
    607  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v30
    608  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    609  1.34      pho 		/* Functions */
    610  1.34      pho static __inline struct fuse_fs *
    611  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    612  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    613  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    614  1.34      pho }
    615  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v30
    616  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v30
    617  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v30
    618  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v30
    619  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v30
    620  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v30
    621  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v30
    622  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v28
    623  1.34      pho #		define fuse_fs_init		fuse_fs_init_v30
    624  1.34      pho static __inline int
    625  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    626  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    627  1.34      pho }
    628  1.34      pho #		define fuse_mount		fuse_mount_v30
    629  1.34      pho #		define fuse_unmount		fuse_unmount_v30
    630  1.34      pho static __inline struct fuse *
    631  1.34      pho fuse_new(struct fuse_args *args, const struct fuse_operations *op,
    632  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    633  1.34      pho     return fuse_new_v30(args, op, _FUSE_OP_VERSION__, user_data);
    634  1.34      pho }
    635  1.34      pho #		define fuse_destroy		fuse_destroy_v30
    636  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v32
    637  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v30
    638  1.34      pho 
    639  1.34      pho /* ===== FUSE 3.4 ===== */
    640  1.35      abs #	elif FUSE_USE_VERSION == 34
    641  1.34      pho 		/* Types */
    642  1.34      pho #		define _FUSE_OP_VERSION__	34
    643  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v30
    644  1.34      pho 		/* Functions */
    645  1.34      pho static __inline struct fuse_fs *
    646  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    647  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    648  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    649  1.34      pho }
    650  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v30
    651  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v30
    652  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v30
    653  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v30
    654  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v30
    655  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v30
    656  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v30
    657  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v28
    658  1.34      pho #		define fuse_fs_init		fuse_fs_init_v30
    659  1.34      pho static __inline int
    660  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    661  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    662  1.34      pho }
    663  1.34      pho #		define fuse_mount		fuse_mount_v30
    664  1.34      pho #		define fuse_unmount		fuse_unmount_v30
    665  1.34      pho static __inline struct fuse *
    666  1.34      pho fuse_new(struct fuse_args *args, const struct fuse_operations *op,
    667  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    668  1.34      pho     return fuse_new_v30(args, op, _FUSE_OP_VERSION__, user_data);
    669  1.34      pho }
    670  1.34      pho #		define fuse_destroy		fuse_destroy_v30
    671  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v32
    672  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v30
    673  1.34      pho 
    674  1.34      pho /* ===== FUSE 3.5, 3.6, 3.7 ===== */
    675  1.34      pho #	elif FUSE_USE_VERSION >= 35 && FUSE_USE_VERSION <= 37
    676  1.34      pho 		/* Types */
    677  1.34      pho #		define _FUSE_OP_VERSION__	35
    678  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v30
    679  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    680  1.34      pho 		/* Functions */
    681  1.34      pho static __inline struct fuse_fs *
    682  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    683  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    684  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    685  1.34      pho }
    686  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v30
    687  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v30
    688  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v30
    689  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v30
    690  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v30
    691  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v30
    692  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v30
    693  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v35
    694  1.34      pho #		define fuse_fs_init		fuse_fs_init_v30
    695  1.34      pho static __inline int
    696  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    697  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    698  1.34      pho }
    699  1.34      pho #		define fuse_mount		fuse_mount_v30
    700  1.34      pho #		define fuse_unmount		fuse_unmount_v30
    701  1.34      pho static __inline struct fuse *
    702  1.34      pho fuse_new(struct fuse_args *args, const struct fuse_operations *op,
    703  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    704  1.34      pho     return fuse_new_v30(args, op, _FUSE_OP_VERSION__, user_data);
    705  1.34      pho }
    706  1.34      pho #		define fuse_destroy		fuse_destroy_v30
    707  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v32
    708  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v30
    709  1.34      pho 
    710  1.34      pho /* ===== FUSE 3.8, 3.9, 3.10 ===== */
    711  1.34      pho #	elif FUSE_USE_VERSION >= 38 && FUSE_USE_VERSION <= 310
    712  1.34      pho 		/* Types */
    713  1.34      pho #		define _FUSE_OP_VERSION__	38
    714  1.34      pho #		define fuse_fill_dir_t		fuse_fill_dir_t_v30
    715  1.34      pho #		define fuse_operations		_MK_FUSE_OPERATIONS_(_FUSE_OP_VERSION__)
    716  1.34      pho 		/* Functions */
    717  1.34      pho static __inline struct fuse_fs *
    718  1.34      pho fuse_fs_new(const struct fuse_operations *op,
    719  1.34      pho 	    size_t op_size __attribute__((__unused__)), void *user_data) {
    720  1.34      pho     return __fuse_fs_new(op, _FUSE_OP_VERSION__, user_data);
    721  1.34      pho }
    722  1.34      pho #		define fuse_fs_getattr		fuse_fs_getattr_v30
    723  1.34      pho #		define fuse_fs_rename		fuse_fs_rename_v30
    724  1.34      pho #		define fuse_fs_chmod		fuse_fs_chmod_v30
    725  1.34      pho #		define fuse_fs_chown		fuse_fs_chown_v30
    726  1.34      pho #		define fuse_fs_readdir		fuse_fs_readdir_v30
    727  1.34      pho #		define fuse_fs_truncate		fuse_fs_truncate_v30
    728  1.34      pho #		define fuse_fs_utimens		fuse_fs_utimens_v30
    729  1.34      pho #		define fuse_fs_ioctl		fuse_fs_ioctl_v35
    730  1.34      pho #		define fuse_fs_init		fuse_fs_init_v30
    731  1.34      pho static __inline int
    732  1.34      pho fuse_main(int argc, char *argv[], const struct fuse_operations *op, void* user_data) {
    733  1.34      pho     return __fuse_main(argc, argv, op, _FUSE_OP_VERSION__, user_data);
    734  1.34      pho }
    735  1.34      pho #		define fuse_mount		fuse_mount_v30
    736  1.34      pho #		define fuse_unmount		fuse_unmount_v30
    737  1.34      pho static __inline struct fuse *
    738  1.34      pho fuse_new(struct fuse_args *args, const struct fuse_operations *op,
    739  1.34      pho 	 size_t op_size __attribute__((__unused__)), void *user_data) {
    740  1.34      pho     return fuse_new_v30(args, op, _FUSE_OP_VERSION__, user_data);
    741  1.34      pho }
    742  1.34      pho #		define fuse_destroy		fuse_destroy_v30
    743  1.34      pho #		define fuse_loop_mt		fuse_loop_mt_v32
    744  1.34      pho #		define fuse_parse_cmdline	fuse_parse_cmdline_v30
    745  1.34      pho 
    746  1.34      pho #	endif
    747  1.34      pho #endif /* defined(FUSE_USE_VERSION) */
    748  1.34      pho 
    749   1.1      agc #ifdef __cplusplus
    750   1.1      agc }
    751   1.1      agc #endif
    752   1.1      agc 
    753   1.1      agc #endif
    754