3 * Copyright (C) 2009 Codethink Ltd.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * John Carr <john.carr@unrouted.co.uk>
25 [CCode (cprefix = "fuse_", cheader_filename = "fuse/fuse.h")]
27 [CCode (cname = "struct fuse_file_info")]
28 public struct FileInfo {
32 public uint direct_io;
33 public uint keep_cache;
37 public uint64 lock_owner;
40 [CCode (cname = "struct fuse")]
44 [CCode (cname = "struct fuse_context")]
45 public struct Context {
53 [CCode (cname = "fuse_fill_dir_t")]
54 public static delegate int FillDir (void* buf, string name, Stat? st, off_t offset);
56 public static delegate int GetAttr (string path, Stat* st);
57 public static delegate int Access (string path, int mask);
58 public static delegate int ReadLink (string path, char* buf, size_t size);
59 public static delegate int ReadDir (string path, void* buf, FillDir filler, off_t offset, FileInfo fi);
60 public static delegate int MkNod (string path, mode_t mode, dev_t rdev);
61 public static delegate int MkDir (string path, mode_t mode);
62 public static delegate int Unlink (string path);
63 public static delegate int RmDir (string path);
64 public static delegate int Symlink (string from, string to);
65 public static delegate int Rename (string from, string to);
66 public static delegate int Link (string from, string to);
67 public static delegate int Chmod (string path, mode_t mode);
68 public static delegate int Chown (string path, uid_t uid, gid_t gid);
69 public static delegate int Truncate (string path, off_t size);
70 public static delegate int Utimens (string path, timespec[] ts);
71 public static delegate int Open (string path, FileInfo fi);
72 public static delegate int Read (string path, char* buf, size_t size, off_t offset, FileInfo fi);
73 public static delegate int Write (string path, char* buf, size_t size, off_t offset, FileInfo fi);
74 public static delegate int StatFs (string path, statvfs *stbuf);
75 public static delegate int Release (string path, FileInfo fi);
76 public static delegate int Fsync (string path, int isdatasync, FileInfo fi);
78 public static delegate int SetXAttr (string path, string name, char* value, size_t size, int flags);
79 public static delegate int GetXAttr (string path, string name, char* value, size_t size);
80 public static delegate int ListXAttr (string path, char* list, size_t size);
81 public static delegate int RemoveXAttr (string path, string name);
83 [CCode (cname = "struct fuse_operations")]
84 public struct Operations {
85 public GetAttr getattr;
87 public ReadLink readlink;
88 public ReadDir readdir;
91 public Symlink symlink;
98 public Truncate truncate;
99 public Utimens utimens;
103 public StatFs statfs;
104 public Release release;
106 public SetXAttr setxattr;
107 public GetXAttr getxattr;
108 public ListXAttr listxattr;
109 public RemoveXAttr removexattr;
112 public int main ([CCode (array_length_pos = 0.9)] string[] args, Operations oper, void *user_data);
113 public Context get_context ();