blob: b825deebffef533c187918e04c3b77e0937a18cc [file] [log] [blame]
bigbiff bigbiff9c754052013-01-09 09:09:08 -05001/*
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 Mower523a0592015-12-13 11:31:00 -060012#include "fuse_lowlevel.h"
13
bigbiff bigbiff9c754052013-01-09 09:09:08 -050014struct 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 Mower523a0592015-12-13 11:31:00 -060027 int (*truncate) (const char *, loff_t);
bigbiff bigbiff9c754052013-01-09 09:09:08 -050028 int (*utime) (const char *, struct utimbuf *);
29 int (*open) (const char *, struct fuse_file_info *);
Matt Mower523a0592015-12-13 11:31:00 -060030 int (*read) (const char *, char *, size_t, loff_t,
bigbiff bigbiff9c754052013-01-09 09:09:08 -050031 struct fuse_file_info *);
Matt Mower523a0592015-12-13 11:31:00 -060032 int (*write) (const char *, const char *, size_t, loff_t,
bigbiff bigbiff9c754052013-01-09 09:09:08 -050033 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 Mower523a0592015-12-13 11:31:00 -060043 int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t,
bigbiff bigbiff9c754052013-01-09 09:09:08 -050044 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 Mower523a0592015-12-13 11:31:00 -060051 int (*ftruncate) (const char *, loff_t, struct fuse_file_info *);
bigbiff bigbiff9c754052013-01-09 09:09:08 -050052 int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
53};
54
55struct fuse *fuse_new_compat25(int fd, struct fuse_args *args,
56 const struct fuse_operations_compat25 *op,
57 size_t op_size);
58
59int fuse_main_real_compat25(int argc, char *argv[],
60 const struct fuse_operations_compat25 *op,
61 size_t op_size);
62
63struct 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
68void fuse_teardown_compat22(struct fuse *fuse, int fd, char *mountpoint);
69
Dees_Troye34c1332013-02-06 19:13:00 +000070#if !defined(__FreeBSD__) && !defined(__NetBSD__)
bigbiff bigbiff9c754052013-01-09 09:09:08 -050071#include <sys/statfs.h>
72
73struct 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 Mower523a0592015-12-13 11:31:00 -060086 int (*truncate) (const char *, loff_t);
bigbiff bigbiff9c754052013-01-09 09:09:08 -050087 int (*utime) (const char *, struct utimbuf *);
88 int (*open) (const char *, struct fuse_file_info_compat *);
Matt Mower523a0592015-12-13 11:31:00 -060089 int (*read) (const char *, char *, size_t, loff_t,
bigbiff bigbiff9c754052013-01-09 09:09:08 -050090 struct fuse_file_info_compat *);
Matt Mower523a0592015-12-13 11:31:00 -060091 int (*write) (const char *, const char *, size_t, loff_t,
bigbiff bigbiff9c754052013-01-09 09:09:08 -050092 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 Mower523a0592015-12-13 11:31:00 -0600102 int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t,
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500103 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
110struct fuse *fuse_new_compat22(int fd, const char *opts,
111 const struct fuse_operations_compat22 *op,
112 size_t op_size);
113
114struct 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
119int fuse_main_real_compat22(int argc, char *argv[],
120 const struct fuse_operations_compat22 *op,
121 size_t op_size);
122
123typedef int (*fuse_dirfil_t_compat) (fuse_dirh_t h, const char *name, int type);
124struct 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 Mower523a0592015-12-13 11:31:00 -0600137 int (*truncate) (const char *, loff_t);
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500138 int (*utime) (const char *, struct utimbuf *);
139 int (*open) (const char *, int);
Matt Mower523a0592015-12-13 11:31:00 -0600140 int (*read) (const char *, char *, size_t, loff_t);
141 int (*write) (const char *, const char *, size_t, loff_t);
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500142 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
153int fuse_main_compat2(int argc, char *argv[],
154 const struct fuse_operations_compat2 *op);
155
156struct fuse *fuse_new_compat2(int fd, const char *opts,
157 const struct fuse_operations_compat2 *op);
158
159struct fuse *fuse_setup_compat2(int argc, char *argv[],
160 const struct fuse_operations_compat2 *op,
161 char **mountpoint, int *multithreaded, int *fd);
162
163struct 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
172struct 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 Mower523a0592015-12-13 11:31:00 -0600185 int (*truncate) (const char *, loff_t);
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500186 int (*utime) (const char *, struct utimbuf *);
187 int (*open) (const char *, int);
Matt Mower523a0592015-12-13 11:31:00 -0600188 int (*read) (const char *, char *, size_t, loff_t);
189 int (*write) (const char *, const char *, size_t, loff_t);
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500190 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
197struct fuse *fuse_new_compat1(int fd, int flags,
198 const struct fuse_operations_compat1 *op);
199
200void fuse_main_compat1(int argc, char *argv[],
201 const struct fuse_operations_compat1 *op);
202
Dees_Troye34c1332013-02-06 19:13:00 +0000203#endif /* __FreeBSD__ || __NetBSD__ */