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.

196 lines
7.4 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 (*mknod) (const char *, mode_t, dev_t);
  13. int (*mkdir) (const char *, mode_t);
  14. int (*unlink) (const char *);
  15. int (*rmdir) (const char *);
  16. int (*symlink) (const char *, const char *);
  17. int (*rename) (const char *, const char *);
  18. int (*link) (const char *, const char *);
  19. int (*chmod) (const char *, mode_t);
  20. int (*chown) (const char *, uid_t, gid_t);
  21. int (*truncate) (const char *, off_t);
  22. int (*utime) (const char *, struct utimbuf *);
  23. int (*open) (const char *, struct fuse_file_info *);
  24. int (*read) (const char *, char *, size_t, off_t,
  25. struct fuse_file_info *);
  26. int (*write) (const char *, const char *, size_t, off_t,
  27. struct fuse_file_info *);
  28. int (*statfs) (const char *, struct statvfs *);
  29. int (*flush) (const char *, struct fuse_file_info *);
  30. int (*release) (const char *, struct fuse_file_info *);
  31. int (*fsync) (const char *, int, struct fuse_file_info *);
  32. int (*setxattr) (const char *, const char *, const char *, size_t, int);
  33. int (*getxattr) (const char *, const char *, char *, size_t);
  34. int (*listxattr) (const char *, char *, size_t);
  35. int (*removexattr) (const char *, const char *);
  36. int (*opendir) (const char *, struct fuse_file_info *);
  37. int (*readdir) (const char *, void *, off_t,
  38. struct fuse_file_info *);
  39. int (*releasedir) (const char *, struct fuse_file_info *);
  40. int (*fsyncdir) (const char *, int, struct fuse_file_info *);
  41. void *(*init) (void);
  42. void (*destroy) (void *);
  43. int (*access) (const char *, int);
  44. int (*create) (const char *, mode_t, struct fuse_file_info *);
  45. int (*ftruncate) (const char *, off_t, struct fuse_file_info *);
  46. int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
  47. };
  48. struct fuse *fuse_new_compat25(int fd, struct fuse_args *args,
  49. const struct fuse_operations_compat25 *op,
  50. size_t op_size);
  51. int fuse_main_real_compat25(int argc, char *argv[],
  52. const struct fuse_operations_compat25 *op,
  53. size_t op_size);
  54. struct fuse *fuse_setup_compat25(int argc, char *argv[],
  55. const struct fuse_operations_compat25 *op,
  56. size_t op_size, char **mountpoint,
  57. int *multithreaded, int *fd);
  58. void fuse_teardown_compat22(struct fuse *fuse, int fd, char *mountpoint);
  59. #if !defined(__FreeBSD__) && !defined(__NetBSD__)
  60. #include <sys/statfs.h>
  61. struct fuse_operations_compat22 {
  62. int (*getattr) (const char *, struct stat *);
  63. int (*readlink) (const char *, char *, size_t);
  64. int (*mknod) (const char *, mode_t, dev_t);
  65. int (*mkdir) (const char *, mode_t);
  66. int (*unlink) (const char *);
  67. int (*rmdir) (const char *);
  68. int (*symlink) (const char *, const char *);
  69. int (*rename) (const char *, const char *);
  70. int (*link) (const char *, const char *);
  71. int (*chmod) (const char *, mode_t);
  72. int (*chown) (const char *, uid_t, gid_t);
  73. int (*truncate) (const char *, off_t);
  74. int (*utime) (const char *, struct utimbuf *);
  75. int (*open) (const char *, struct fuse_file_info_compat *);
  76. int (*read) (const char *, char *, size_t, off_t,
  77. struct fuse_file_info_compat *);
  78. int (*write) (const char *, const char *, size_t, off_t,
  79. struct fuse_file_info_compat *);
  80. int (*statfs) (const char *, struct statfs *);
  81. int (*flush) (const char *, struct fuse_file_info_compat *);
  82. int (*release) (const char *, struct fuse_file_info_compat *);
  83. int (*fsync) (const char *, int, struct fuse_file_info_compat *);
  84. int (*setxattr) (const char *, const char *, const char *, size_t, int);
  85. int (*getxattr) (const char *, const char *, char *, size_t);
  86. int (*listxattr) (const char *, char *, size_t);
  87. int (*removexattr) (const char *, const char *);
  88. int (*opendir) (const char *, struct fuse_file_info_compat *);
  89. int (*readdir) (const char *, void *, off_t,
  90. struct fuse_file_info_compat *);
  91. int (*releasedir) (const char *, struct fuse_file_info_compat *);
  92. int (*fsyncdir) (const char *, int, struct fuse_file_info_compat *);
  93. void *(*init) (void);
  94. void (*destroy) (void *);
  95. };
  96. struct fuse *fuse_new_compat22(int fd, const char *opts,
  97. const struct fuse_operations_compat22 *op,
  98. size_t op_size);
  99. struct fuse *fuse_setup_compat22(int argc, char *argv[],
  100. const struct fuse_operations_compat22 *op,
  101. size_t op_size, char **mountpoint,
  102. int *multithreaded, int *fd);
  103. int fuse_main_real_compat22(int argc, char *argv[],
  104. const struct fuse_operations_compat22 *op,
  105. size_t op_size);
  106. struct fuse_operations_compat2 {
  107. int (*getattr) (const char *, struct stat *);
  108. int (*readlink) (const char *, char *, size_t);
  109. int (*mknod) (const char *, mode_t, dev_t);
  110. int (*mkdir) (const char *, mode_t);
  111. int (*unlink) (const char *);
  112. int (*rmdir) (const char *);
  113. int (*symlink) (const char *, const char *);
  114. int (*rename) (const char *, const char *);
  115. int (*link) (const char *, const char *);
  116. int (*chmod) (const char *, mode_t);
  117. int (*chown) (const char *, uid_t, gid_t);
  118. int (*truncate) (const char *, off_t);
  119. int (*utime) (const char *, struct utimbuf *);
  120. int (*open) (const char *, int);
  121. int (*read) (const char *, char *, size_t, off_t);
  122. int (*write) (const char *, const char *, size_t, off_t);
  123. int (*statfs) (const char *, struct statfs *);
  124. int (*flush) (const char *);
  125. int (*release) (const char *, int);
  126. int (*fsync) (const char *, int);
  127. int (*setxattr) (const char *, const char *, const char *,
  128. size_t, int);
  129. int (*getxattr) (const char *, const char *, char *, size_t);
  130. int (*listxattr) (const char *, char *, size_t);
  131. int (*removexattr) (const char *, const char *);
  132. };
  133. int fuse_main_compat2(int argc, char *argv[],
  134. const struct fuse_operations_compat2 *op);
  135. struct fuse *fuse_new_compat2(int fd, const char *opts,
  136. const struct fuse_operations_compat2 *op);
  137. struct fuse *fuse_setup_compat2(int argc, char *argv[],
  138. const struct fuse_operations_compat2 *op,
  139. char **mountpoint, int *multithreaded, int *fd);
  140. struct fuse_statfs_compat1 {
  141. long block_size;
  142. long blocks;
  143. long blocks_free;
  144. long files;
  145. long files_free;
  146. long namelen;
  147. };
  148. struct fuse_operations_compat1 {
  149. int (*getattr) (const char *, struct stat *);
  150. int (*readlink) (const char *, char *, size_t);
  151. int (*mknod) (const char *, mode_t, dev_t);
  152. int (*mkdir) (const char *, mode_t);
  153. int (*unlink) (const char *);
  154. int (*rmdir) (const char *);
  155. int (*symlink) (const char *, const char *);
  156. int (*rename) (const char *, const char *);
  157. int (*link) (const char *, const char *);
  158. int (*chmod) (const char *, mode_t);
  159. int (*chown) (const char *, uid_t, gid_t);
  160. int (*truncate) (const char *, off_t);
  161. int (*utime) (const char *, struct utimbuf *);
  162. int (*open) (const char *, int);
  163. int (*read) (const char *, char *, size_t, off_t);
  164. int (*write) (const char *, const char *, size_t, off_t);
  165. int (*statfs) (struct fuse_statfs_compat1 *);
  166. int (*release) (const char *, int);
  167. int (*fsync) (const char *, int);
  168. };
  169. #define FUSE_DEBUG_COMPAT1 (1 << 1)
  170. struct fuse *fuse_new_compat1(int fd, int flags,
  171. const struct fuse_operations_compat1 *op);
  172. void fuse_main_compat1(int argc, char *argv[],
  173. const struct fuse_operations_compat1 *op);
  174. #endif /* __FreeBSD__ || __NetBSD__ */