Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | FUSE: Filesystem in Userspace |
| 3 | Copyright (C) 2001 Miklos Szeredi (mszeredi@inf.bme.hu) |
| 4 | |
| 5 | This program can be distributed under the terms of the GNU GPL. |
| 6 | See the file COPYING. |
| 7 | */ |
| 8 | |
| 9 | /* This file defines the library interface of FUSE */ |
| 10 | |
| 11 | #include <sys/types.h> |
| 12 | #include <sys/stat.h> |
Miklos Szeredi | 5e18348 | 2001-10-31 14:52:35 +0000 | [diff] [blame] | 13 | #include <utime.h> |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 14 | |
| 15 | struct fuse; |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame^] | 16 | typedef struct fuse_dirhandle *fuse_dirh_t; |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 17 | |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame^] | 18 | typedef int (*fuse_dirfil_t) (fuse_dirh_t, const char *, int type); |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 19 | |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame^] | 20 | struct fuse_cred { |
| 21 | uid_t uid; |
| 22 | gid_t gid; |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 23 | }; |
| 24 | |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame^] | 25 | struct fuse_operations { |
| 26 | int (*getattr) (struct fuse_cred *, const char *, struct stat *); |
| 27 | int (*readlink) (struct fuse_cred *, const char *, char *, size_t); |
| 28 | int (*getdir) (struct fuse_cred *, const char *, fuse_dirh_t, fuse_dirfil_t); |
| 29 | int (*mknod) (struct fuse_cred *, const char *, mode_t, dev_t); |
| 30 | int (*mkdir) (struct fuse_cred *, const char *, mode_t); |
| 31 | int (*unlink) (struct fuse_cred *, const char *); |
| 32 | int (*rmdir) (struct fuse_cred *, const char *); |
| 33 | int (*symlink) (struct fuse_cred *, const char *, const char *); |
| 34 | int (*rename) (struct fuse_cred *, const char *, const char *); |
| 35 | int (*link) (struct fuse_cred *, const char *, const char *); |
| 36 | int (*chmod) (struct fuse_cred *, const char *, mode_t); |
| 37 | int (*chown) (struct fuse_cred *, const char *, uid_t, gid_t); |
| 38 | int (*truncate) (struct fuse_cred *, const char *, off_t); |
| 39 | int (*utime) (struct fuse_cred *, const char *, struct utimbuf *); |
| 40 | int (*open) (struct fuse_cred *, const char *, int); |
| 41 | int (*read) (struct fuse_cred *, const char *, char *, size_t, off_t); |
| 42 | int (*write) (struct fuse_cred *, const char *, const char *, size_t, off_t); |
| 43 | }; |
| 44 | |
| 45 | #define FUSE_MULTITHREAD (1 << 0) |
| 46 | |
| 47 | struct fuse *fuse_new(int flags); |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 48 | |
| 49 | int fuse_mount(struct fuse *f, const char *dir); |
| 50 | |
| 51 | void fuse_set_operations(struct fuse *f, const struct fuse_operations *op); |
| 52 | |
| 53 | void fuse_loop(struct fuse *f); |
| 54 | |
| 55 | int fuse_unmount(struct fuse *f); |
| 56 | |
| 57 | void fuse_destroy(struct fuse *f); |