summaryrefslogtreecommitdiff
path: root/vapi/fuse.vapi
blob: 5b40288f3564e2dd2389328dc941b15e92bae2b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/* fuse.vapi
 *
 * Copyright (C) 2009  Codethink Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	John Carr <john.carr@unrouted.co.uk>
 */

[CCode (cprefix = "fuse_", cheader_filename = "fuse/fuse.h")]
namespace Fuse {
	[CCode (cname = "struct fuse_file_info", has_type_id = false)]
	public struct FileInfo {
		public int flags;
		public ulong fh_old;
		public int writepage;
		public uint direct_io;
		public uint keep_cache;
		public uint flush;
		public uint padding;
		public uint64 fh;
		public uint64 lock_owner;
	}

	[CCode (cname = "struct fuse", has_type_id = false)]
	public struct Fuse {
	}

	[CCode (cname = "struct fuse_context", has_type_id = false)]
	public struct Context {
		Fuse fuse;
		Posix.uid_t uid;
		Posix.gid_t gid;
		Posix.pid_t pid;
		void *private_data;
	}

	[CCode (cname = "fuse_fill_dir_t", has_target = false)]
	public delegate int FillDir (void* buf, string name, Posix.Stat? st, Posix.off_t offset);

	[CCode (has_target = false, has_typedef = false)]
	public delegate int GetAttr (string path, Posix.Stat* st);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Access (string path, int mask);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int ReadLink (string path, char* buf, size_t size);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int ReadDir (string path, void* buf, FillDir filler, Posix.off_t offset, ref FileInfo fi);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int MkNod (string path, Posix.mode_t mode, Posix.dev_t rdev);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int MkDir (string path, Posix.mode_t mode);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Unlink (string path);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int RmDir (string path);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Symlink (string from, string to);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Rename (string from, string to);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Link (string from, string to);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Chmod (string path, Posix.mode_t mode);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Chown (string path, Posix.uid_t uid, Posix.gid_t gid);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Truncate (string path, Posix.off_t size);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Utimens (string path, Posix.timespec[] ts);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Create(string path, Posix.mode_t mode, ref FileInfo fi);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Open (string path, ref FileInfo fi);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Read (string path, char* buf, size_t size, Posix.off_t offset, ref FileInfo fi);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Write (string path, char* buf, size_t size, Posix.off_t offset, ref FileInfo fi);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int StatFs (string path, Posix.statvfs *stbuf);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Release (string path, ref FileInfo fi);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int Fsync (string path, int isdatasync, ref FileInfo fi);

	[CCode (has_target = false, has_typedef = false)]
	public delegate int SetXAttr (string path, string name, char* value, size_t size, int flags);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int GetXAttr (string path, string name, char* value, size_t size);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int ListXAttr (string path, char* list, size_t size);
	[CCode (has_target = false, has_typedef = false)]
	public delegate int RemoveXAttr (string path, string name);

	[CCode (cname = "struct fuse_operations", has_type_id = false)]
	public struct Operations {
		public GetAttr getattr;
		public Access access;
		public ReadLink readlink;
		public ReadDir readdir;
		public MkNod mknod;
		public MkDir mkdir;
		public Symlink symlink;
		public Unlink unlink;
		public RmDir rmdir;
		public Rename rename;
		public Link link;
		public Chmod chmod;
		public Chown chown;
		public Truncate truncate;
		public Utimens utimens;
		public Create create;
		public Open open;
		public Read read;
		public Write write;
		public StatFs statfs;
		public Release release;
		public Fsync fsync;
		public SetXAttr setxattr;
		public GetXAttr getxattr;
		public ListXAttr listxattr;
		public RemoveXAttr removexattr;
	}

	public int main ([CCode (array_length_pos = 0.9)] string[] args, Operations oper, void *user_data);
	public Context? get_context ();
}