You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
7.8 KiB

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