bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 1 | /* |
| 2 | FUSE: Filesystem in Userspace |
| 3 | Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> |
| 4 | |
| 5 | This program can be distributed under the terms of the GNU LGPLv2. |
| 6 | See the file COPYING.LIB. |
| 7 | */ |
| 8 | |
| 9 | /* these definitions provide source compatibility to prior versions. |
| 10 | Do not include this file directly! */ |
| 11 | |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 12 | #include "fuse_lowlevel.h" |
| 13 | |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 14 | struct fuse_operations_compat25 { |
| 15 | int (*getattr) (const char *, struct stat *); |
| 16 | int (*readlink) (const char *, char *, size_t); |
| 17 | int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t); |
| 18 | int (*mknod) (const char *, mode_t, dev_t); |
| 19 | int (*mkdir) (const char *, mode_t); |
| 20 | int (*unlink) (const char *); |
| 21 | int (*rmdir) (const char *); |
| 22 | int (*symlink) (const char *, const char *); |
| 23 | int (*rename) (const char *, const char *); |
| 24 | int (*link) (const char *, const char *); |
| 25 | int (*chmod) (const char *, mode_t); |
| 26 | int (*chown) (const char *, uid_t, gid_t); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 27 | int (*truncate) (const char *, loff_t); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 28 | int (*utime) (const char *, struct utimbuf *); |
| 29 | int (*open) (const char *, struct fuse_file_info *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 30 | int (*read) (const char *, char *, size_t, loff_t, |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 31 | struct fuse_file_info *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 32 | int (*write) (const char *, const char *, size_t, loff_t, |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 33 | struct fuse_file_info *); |
| 34 | int (*statfs) (const char *, struct statvfs *); |
| 35 | int (*flush) (const char *, struct fuse_file_info *); |
| 36 | int (*release) (const char *, struct fuse_file_info *); |
| 37 | int (*fsync) (const char *, int, struct fuse_file_info *); |
| 38 | int (*setxattr) (const char *, const char *, const char *, size_t, int); |
| 39 | int (*getxattr) (const char *, const char *, char *, size_t); |
| 40 | int (*listxattr) (const char *, char *, size_t); |
| 41 | int (*removexattr) (const char *, const char *); |
| 42 | int (*opendir) (const char *, struct fuse_file_info *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 43 | int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t, |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 44 | struct fuse_file_info *); |
| 45 | int (*releasedir) (const char *, struct fuse_file_info *); |
| 46 | int (*fsyncdir) (const char *, int, struct fuse_file_info *); |
| 47 | void *(*init) (void); |
| 48 | void (*destroy) (void *); |
| 49 | int (*access) (const char *, int); |
| 50 | int (*create) (const char *, mode_t, struct fuse_file_info *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 51 | int (*ftruncate) (const char *, loff_t, struct fuse_file_info *); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 52 | int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *); |
| 53 | }; |
| 54 | |
| 55 | struct fuse *fuse_new_compat25(int fd, struct fuse_args *args, |
| 56 | const struct fuse_operations_compat25 *op, |
| 57 | size_t op_size); |
| 58 | |
| 59 | int fuse_main_real_compat25(int argc, char *argv[], |
| 60 | const struct fuse_operations_compat25 *op, |
| 61 | size_t op_size); |
| 62 | |
| 63 | struct fuse *fuse_setup_compat25(int argc, char *argv[], |
| 64 | const struct fuse_operations_compat25 *op, |
| 65 | size_t op_size, char **mountpoint, |
| 66 | int *multithreaded, int *fd); |
| 67 | |
| 68 | void fuse_teardown_compat22(struct fuse *fuse, int fd, char *mountpoint); |
| 69 | |
Dees_Troy | e34c133 | 2013-02-06 19:13:00 +0000 | [diff] [blame] | 70 | #if !defined(__FreeBSD__) && !defined(__NetBSD__) |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 71 | #include <sys/statfs.h> |
| 72 | |
| 73 | struct fuse_operations_compat22 { |
| 74 | int (*getattr) (const char *, struct stat *); |
| 75 | int (*readlink) (const char *, char *, size_t); |
| 76 | int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t); |
| 77 | int (*mknod) (const char *, mode_t, dev_t); |
| 78 | int (*mkdir) (const char *, mode_t); |
| 79 | int (*unlink) (const char *); |
| 80 | int (*rmdir) (const char *); |
| 81 | int (*symlink) (const char *, const char *); |
| 82 | int (*rename) (const char *, const char *); |
| 83 | int (*link) (const char *, const char *); |
| 84 | int (*chmod) (const char *, mode_t); |
| 85 | int (*chown) (const char *, uid_t, gid_t); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 86 | int (*truncate) (const char *, loff_t); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 87 | int (*utime) (const char *, struct utimbuf *); |
| 88 | int (*open) (const char *, struct fuse_file_info_compat *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 89 | int (*read) (const char *, char *, size_t, loff_t, |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 90 | struct fuse_file_info_compat *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 91 | int (*write) (const char *, const char *, size_t, loff_t, |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 92 | struct fuse_file_info_compat *); |
| 93 | int (*statfs) (const char *, struct statfs *); |
| 94 | int (*flush) (const char *, struct fuse_file_info_compat *); |
| 95 | int (*release) (const char *, struct fuse_file_info_compat *); |
| 96 | int (*fsync) (const char *, int, struct fuse_file_info_compat *); |
| 97 | int (*setxattr) (const char *, const char *, const char *, size_t, int); |
| 98 | int (*getxattr) (const char *, const char *, char *, size_t); |
| 99 | int (*listxattr) (const char *, char *, size_t); |
| 100 | int (*removexattr) (const char *, const char *); |
| 101 | int (*opendir) (const char *, struct fuse_file_info_compat *); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 102 | int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t, |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 103 | struct fuse_file_info_compat *); |
| 104 | int (*releasedir) (const char *, struct fuse_file_info_compat *); |
| 105 | int (*fsyncdir) (const char *, int, struct fuse_file_info_compat *); |
| 106 | void *(*init) (void); |
| 107 | void (*destroy) (void *); |
| 108 | }; |
| 109 | |
| 110 | struct fuse *fuse_new_compat22(int fd, const char *opts, |
| 111 | const struct fuse_operations_compat22 *op, |
| 112 | size_t op_size); |
| 113 | |
| 114 | struct fuse *fuse_setup_compat22(int argc, char *argv[], |
| 115 | const struct fuse_operations_compat22 *op, |
| 116 | size_t op_size, char **mountpoint, |
| 117 | int *multithreaded, int *fd); |
| 118 | |
| 119 | int fuse_main_real_compat22(int argc, char *argv[], |
| 120 | const struct fuse_operations_compat22 *op, |
| 121 | size_t op_size); |
| 122 | |
| 123 | typedef int (*fuse_dirfil_t_compat) (fuse_dirh_t h, const char *name, int type); |
| 124 | struct fuse_operations_compat2 { |
| 125 | int (*getattr) (const char *, struct stat *); |
| 126 | int (*readlink) (const char *, char *, size_t); |
| 127 | int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t_compat); |
| 128 | int (*mknod) (const char *, mode_t, dev_t); |
| 129 | int (*mkdir) (const char *, mode_t); |
| 130 | int (*unlink) (const char *); |
| 131 | int (*rmdir) (const char *); |
| 132 | int (*symlink) (const char *, const char *); |
| 133 | int (*rename) (const char *, const char *); |
| 134 | int (*link) (const char *, const char *); |
| 135 | int (*chmod) (const char *, mode_t); |
| 136 | int (*chown) (const char *, uid_t, gid_t); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 137 | int (*truncate) (const char *, loff_t); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 138 | int (*utime) (const char *, struct utimbuf *); |
| 139 | int (*open) (const char *, int); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 140 | int (*read) (const char *, char *, size_t, loff_t); |
| 141 | int (*write) (const char *, const char *, size_t, loff_t); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 142 | int (*statfs) (const char *, struct statfs *); |
| 143 | int (*flush) (const char *); |
| 144 | int (*release) (const char *, int); |
| 145 | int (*fsync) (const char *, int); |
| 146 | int (*setxattr) (const char *, const char *, const char *, |
| 147 | size_t, int); |
| 148 | int (*getxattr) (const char *, const char *, char *, size_t); |
| 149 | int (*listxattr) (const char *, char *, size_t); |
| 150 | int (*removexattr) (const char *, const char *); |
| 151 | }; |
| 152 | |
| 153 | int fuse_main_compat2(int argc, char *argv[], |
| 154 | const struct fuse_operations_compat2 *op); |
| 155 | |
| 156 | struct fuse *fuse_new_compat2(int fd, const char *opts, |
| 157 | const struct fuse_operations_compat2 *op); |
| 158 | |
| 159 | struct fuse *fuse_setup_compat2(int argc, char *argv[], |
| 160 | const struct fuse_operations_compat2 *op, |
| 161 | char **mountpoint, int *multithreaded, int *fd); |
| 162 | |
| 163 | struct fuse_statfs_compat1 { |
| 164 | long block_size; |
| 165 | long blocks; |
| 166 | long blocks_free; |
| 167 | long files; |
| 168 | long files_free; |
| 169 | long namelen; |
| 170 | }; |
| 171 | |
| 172 | struct fuse_operations_compat1 { |
| 173 | int (*getattr) (const char *, struct stat *); |
| 174 | int (*readlink) (const char *, char *, size_t); |
| 175 | int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t_compat); |
| 176 | int (*mknod) (const char *, mode_t, dev_t); |
| 177 | int (*mkdir) (const char *, mode_t); |
| 178 | int (*unlink) (const char *); |
| 179 | int (*rmdir) (const char *); |
| 180 | int (*symlink) (const char *, const char *); |
| 181 | int (*rename) (const char *, const char *); |
| 182 | int (*link) (const char *, const char *); |
| 183 | int (*chmod) (const char *, mode_t); |
| 184 | int (*chown) (const char *, uid_t, gid_t); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 185 | int (*truncate) (const char *, loff_t); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 186 | int (*utime) (const char *, struct utimbuf *); |
| 187 | int (*open) (const char *, int); |
Matt Mower | 523a059 | 2015-12-13 11:31:00 -0600 | [diff] [blame] | 188 | int (*read) (const char *, char *, size_t, loff_t); |
| 189 | int (*write) (const char *, const char *, size_t, loff_t); |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 190 | int (*statfs) (struct fuse_statfs_compat1 *); |
| 191 | int (*release) (const char *, int); |
| 192 | int (*fsync) (const char *, int); |
| 193 | }; |
| 194 | |
| 195 | #define FUSE_DEBUG_COMPAT1 (1 << 1) |
| 196 | |
| 197 | struct fuse *fuse_new_compat1(int fd, int flags, |
| 198 | const struct fuse_operations_compat1 *op); |
| 199 | |
| 200 | void fuse_main_compat1(int argc, char *argv[], |
| 201 | const struct fuse_operations_compat1 *op); |
| 202 | |
Dees_Troy | e34c133 | 2013-02-06 19:13:00 +0000 | [diff] [blame] | 203 | #endif /* __FreeBSD__ || __NetBSD__ */ |