aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h37
-rw-r--r--include/linux/fuse.h100
2 files changed, 137 insertions, 0 deletions
diff --git a/include/fuse.h b/include/fuse.h
new file mode 100644
index 0000000..6b1a151
--- /dev/null
+++ b/include/fuse.h
@@ -0,0 +1,37 @@
+/*
+ FUSE: Filesystem in Userspace
+ Copyright (C) 2001 Miklos Szeredi (mszeredi@inf.bme.hu)
+
+ This program can be distributed under the terms of the GNU GPL.
+ See the file COPYING.
+*/
+
+/* This file defines the library interface of FUSE */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+struct fuse;
+struct fuse_dh;
+
+typedef int (*dirfiller_t) (struct fuse_dh *, const char *, int type);
+
+
+struct fuse_operations {
+ int (*getattr) (const char *path, struct stat *stbuf);
+ int (*readlink) (const char *path, char *buf, size_t size);
+ int (*mknod) (const char *path, int mode, int rdev);
+ int (*getdir) (const char *path, struct fuse_dh *h, dirfiller_t filler);
+};
+
+struct fuse *fuse_new();
+
+int fuse_mount(struct fuse *f, const char *dir);
+
+void fuse_set_operations(struct fuse *f, const struct fuse_operations *op);
+
+void fuse_loop(struct fuse *f);
+
+int fuse_unmount(struct fuse *f);
+
+void fuse_destroy(struct fuse *f);
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
new file mode 100644
index 0000000..fb3aca0
--- /dev/null
+++ b/include/linux/fuse.h
@@ -0,0 +1,100 @@
+/*
+ FUSE: Filesystem in Userspace
+ Copyright (C) 2001 Miklos Szeredi (mszeredi@inf.bme.hu)
+
+ This program can be distributed under the terms of the GNU GPL.
+ See the file COPYING.
+*/
+
+/* This file defines the kernel interface of FUSE */
+
+
+#define FUSE_MOUNT_VERSION 1
+
+struct fuse_mount_data {
+ int version;
+ int fd;
+};
+
+#define FUSE_ROOT_INO 1
+
+struct fuse_attr {
+ unsigned short mode;
+ unsigned short nlink;
+ unsigned short uid;
+ unsigned short gid;
+ unsigned short rdev;
+ unsigned long long size;
+ unsigned long blksize;
+ unsigned long blocks;
+ unsigned long atime;
+ unsigned long mtime;
+ unsigned long ctime;
+};
+
+enum fuse_opcode {
+ FUSE_LOOKUP = 1,
+ FUSE_FORGET,
+ FUSE_GETATTR,
+ FUSE_READLINK,
+ FUSE_GETDIR,
+ FUSE_MKNOD,
+};
+
+/* Conservative buffer size for the client */
+#define FUSE_MAX_IN 8192
+
+struct fuse_lookup_out {
+ unsigned long ino;
+ struct fuse_attr attr;
+};
+
+struct fuse_getattr_out {
+ struct fuse_attr attr;
+};
+
+struct fuse_getdir_out {
+ int fd;
+ void *file; /* Used by kernel only */
+};
+
+struct fuse_mknod_in {
+ unsigned short mode;
+ unsigned short rdev;
+ char name[1];
+};
+
+struct fuse_mknod_out {
+ unsigned long ino;
+ struct fuse_attr attr;
+};
+
+struct fuse_in_header {
+ int unique;
+ enum fuse_opcode opcode;
+ unsigned long ino;
+};
+
+struct fuse_out_header {
+ int unique;
+ int result;
+};
+
+struct fuse_dirent {
+ unsigned long ino;
+ unsigned short namelen;
+ unsigned char type;
+ char name[256];
+};
+
+#define FUSE_NAME_OFFSET ((unsigned int) ((struct fuse_dirent *) 0)->name)
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(long) - 1) & ~(sizeof(long) - 1))
+#define FUSE_DIRENT_SIZE(d) \
+ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
+
+/*
+ * Local Variables:
+ * indent-tabs-mode: t
+ * c-basic-offset: 8
+ * End:
+ */