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.

155 lines
6.7 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_lowlevel_ops_compat25 {
  10. void (*init) (void *userdata);
  11. void (*destroy) (void *userdata);
  12. void (*lookup) (fuse_req_t req, fuse_ino_t parent, const char *name);
  13. void (*forget) (fuse_req_t req, fuse_ino_t ino, unsigned long nlookup);
  14. void (*getattr) (fuse_req_t req, fuse_ino_t ino,
  15. struct fuse_file_info *fi);
  16. void (*setattr) (fuse_req_t req, fuse_ino_t ino, struct stat *attr,
  17. int to_set, struct fuse_file_info *fi);
  18. void (*readlink) (fuse_req_t req, fuse_ino_t ino);
  19. void (*mknod) (fuse_req_t req, fuse_ino_t parent, const char *name,
  20. mode_t mode, dev_t rdev);
  21. void (*mkdir) (fuse_req_t req, fuse_ino_t parent, const char *name,
  22. mode_t mode);
  23. void (*unlink) (fuse_req_t req, fuse_ino_t parent, const char *name);
  24. void (*rmdir) (fuse_req_t req, fuse_ino_t parent, const char *name);
  25. void (*symlink) (fuse_req_t req, const char *link, fuse_ino_t parent,
  26. const char *name);
  27. void (*rename) (fuse_req_t req, fuse_ino_t parent, const char *name,
  28. fuse_ino_t newparent, const char *newname);
  29. void (*link) (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent,
  30. const char *newname);
  31. void (*open) (fuse_req_t req, fuse_ino_t ino,
  32. struct fuse_file_info *fi);
  33. void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,
  34. struct fuse_file_info *fi);
  35. void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,
  36. size_t size, off_t off, struct fuse_file_info *fi);
  37. void (*flush) (fuse_req_t req, fuse_ino_t ino,
  38. struct fuse_file_info *fi);
  39. void (*release) (fuse_req_t req, fuse_ino_t ino,
  40. struct fuse_file_info *fi);
  41. void (*fsync) (fuse_req_t req, fuse_ino_t ino, int datasync,
  42. struct fuse_file_info *fi);
  43. void (*opendir) (fuse_req_t req, fuse_ino_t ino,
  44. struct fuse_file_info *fi);
  45. void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,
  46. struct fuse_file_info *fi);
  47. void (*releasedir) (fuse_req_t req, fuse_ino_t ino,
  48. struct fuse_file_info *fi);
  49. void (*fsyncdir) (fuse_req_t req, fuse_ino_t ino, int datasync,
  50. struct fuse_file_info *fi);
  51. void (*statfs) (fuse_req_t req);
  52. void (*setxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,
  53. const char *value, size_t size, int flags);
  54. void (*getxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,
  55. size_t size);
  56. void (*listxattr) (fuse_req_t req, fuse_ino_t ino, size_t size);
  57. void (*removexattr) (fuse_req_t req, fuse_ino_t ino, const char *name);
  58. void (*access) (fuse_req_t req, fuse_ino_t ino, int mask);
  59. void (*create) (fuse_req_t req, fuse_ino_t parent, const char *name,
  60. mode_t mode, struct fuse_file_info *fi);
  61. };
  62. struct fuse_session *fuse_lowlevel_new_compat25(struct fuse_args *args,
  63. const struct fuse_lowlevel_ops_compat25 *op,
  64. size_t op_size, void *userdata);
  65. size_t fuse_dirent_size(size_t namelen);
  66. char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf,
  67. off_t off);
  68. #if !defined(__FreeBSD__) && !defined(__NetBSD__)
  69. #include <sys/statfs.h>
  70. struct fuse_lowlevel_ops_compat {
  71. void (*init) (void *userdata);
  72. void (*destroy) (void *userdata);
  73. void (*lookup) (fuse_req_t req, fuse_ino_t parent, const char *name);
  74. void (*forget) (fuse_req_t req, fuse_ino_t ino, unsigned long nlookup);
  75. void (*getattr) (fuse_req_t req, fuse_ino_t ino,
  76. struct fuse_file_info_compat *fi);
  77. void (*setattr) (fuse_req_t req, fuse_ino_t ino, struct stat *attr,
  78. int to_set, struct fuse_file_info_compat *fi);
  79. void (*readlink) (fuse_req_t req, fuse_ino_t ino);
  80. void (*mknod) (fuse_req_t req, fuse_ino_t parent, const char *name,
  81. mode_t mode, dev_t rdev);
  82. void (*mkdir) (fuse_req_t req, fuse_ino_t parent, const char *name,
  83. mode_t mode);
  84. void (*unlink) (fuse_req_t req, fuse_ino_t parent, const char *name);
  85. void (*rmdir) (fuse_req_t req, fuse_ino_t parent, const char *name);
  86. void (*symlink) (fuse_req_t req, const char *link, fuse_ino_t parent,
  87. const char *name);
  88. void (*rename) (fuse_req_t req, fuse_ino_t parent, const char *name,
  89. fuse_ino_t newparent, const char *newname);
  90. void (*link) (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent,
  91. const char *newname);
  92. void (*open) (fuse_req_t req, fuse_ino_t ino,
  93. struct fuse_file_info_compat *fi);
  94. void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,
  95. struct fuse_file_info_compat *fi);
  96. void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,
  97. size_t size, off_t off, struct fuse_file_info_compat *fi);
  98. void (*flush) (fuse_req_t req, fuse_ino_t ino,
  99. struct fuse_file_info_compat *fi);
  100. void (*release) (fuse_req_t req, fuse_ino_t ino,
  101. struct fuse_file_info_compat *fi);
  102. void (*fsync) (fuse_req_t req, fuse_ino_t ino, int datasync,
  103. struct fuse_file_info_compat *fi);
  104. void (*opendir) (fuse_req_t req, fuse_ino_t ino,
  105. struct fuse_file_info_compat *fi);
  106. void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,
  107. struct fuse_file_info_compat *fi);
  108. void (*releasedir) (fuse_req_t req, fuse_ino_t ino,
  109. struct fuse_file_info_compat *fi);
  110. void (*fsyncdir) (fuse_req_t req, fuse_ino_t ino, int datasync,
  111. struct fuse_file_info_compat *fi);
  112. void (*statfs) (fuse_req_t req);
  113. void (*setxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,
  114. const char *value, size_t size, int flags);
  115. void (*getxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,
  116. size_t size);
  117. void (*listxattr) (fuse_req_t req, fuse_ino_t ino, size_t size);
  118. void (*removexattr) (fuse_req_t req, fuse_ino_t ino, const char *name);
  119. void (*access) (fuse_req_t req, fuse_ino_t ino, int mask);
  120. void (*create) (fuse_req_t req, fuse_ino_t parent, const char *name,
  121. mode_t mode, struct fuse_file_info_compat *fi);
  122. };
  123. int fuse_reply_statfs_compat(fuse_req_t req, const struct statfs *stbuf);
  124. int fuse_reply_open_compat(fuse_req_t req,
  125. const struct fuse_file_info_compat *fi);
  126. struct fuse_session *fuse_lowlevel_new_compat(const char *opts,
  127. const struct fuse_lowlevel_ops_compat *op,
  128. size_t op_size, void *userdata);
  129. #endif /* __FreeBSD__ || __NetBSD__ */
  130. struct fuse_chan_ops_compat24 {
  131. int (*receive)(struct fuse_chan *ch, char *buf, size_t size);
  132. int (*send)(struct fuse_chan *ch, const struct iovec iov[],
  133. size_t count);
  134. void (*destroy)(struct fuse_chan *ch);
  135. };
  136. struct fuse_chan *fuse_chan_new_compat24(struct fuse_chan_ops_compat24 *op,
  137. int fd, size_t bufsize, void *data);
  138. int fuse_chan_receive(struct fuse_chan *ch, char *buf, size_t size);
  139. struct fuse_chan *fuse_kern_chan_new(int fd);