vala r2469 - in trunk: . vapi



Author: juergbi
Date: Fri Feb 20 20:13:34 2009
New Revision: 2469
URL: http://svn.gnome.org/viewvc/vala?rev=2469&view=rev

Log:
2009-02-20  JÃrg Billeter  <j bitron ch>

	* vapi/Makefile.am:
	* vapi/fuse.deps:
	* vapi/fuse.vapi:
	* vapi/posix.vapi:

	Add FUSE bindings, patch by John Carr, fixes bug 571187


Added:
   trunk/vapi/fuse.deps
   trunk/vapi/fuse.vapi
Modified:
   trunk/ChangeLog
   trunk/vapi/Makefile.am
   trunk/vapi/posix.vapi

Modified: trunk/vapi/Makefile.am
==============================================================================
--- trunk/vapi/Makefile.am	(original)
+++ trunk/vapi/Makefile.am	Fri Feb 20 20:13:34 2009
@@ -12,6 +12,8 @@
 	curses.vapi \
 	dbus-glib-1.vapi \
 	enchant.vapi \
+	fuse.deps \
+	fuse.vapi \
 	gconf-2.0.vapi \
 	glib-2.0.vapi \
 	gdk-2.0.deps \

Added: trunk/vapi/fuse.deps
==============================================================================
--- (empty file)
+++ trunk/vapi/fuse.deps	Fri Feb 20 20:13:34 2009
@@ -0,0 +1 @@
+posix

Added: trunk/vapi/fuse.vapi
==============================================================================
--- (empty file)
+++ trunk/vapi/fuse.vapi	Fri Feb 20 20:13:34 2009
@@ -0,0 +1,114 @@
+/* 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>
+ */
+
+using Posix;
+
+[CCode (cprefix = "fuse_", cheader_filename = "fuse/fuse.h")]
+namespace Fuse {
+	[CCode (cname = "struct fuse_file_info")]
+	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")]
+	public struct Fuse {
+	}
+
+	[CCode (cname = "struct fuse_context")]
+	public struct Context {
+		Fuse fuse;
+		uid_t uid;
+		gid_t gid;
+		/*pid_t pid;*/
+		void *private_data;
+	}
+
+	[CCode (cname = "fuse_fill_dir_t")]
+	public static delegate int FillDir (void* buf, string name, stat? st, off_t offset);
+
+	public static delegate int GetAttr (string path, stat* st);
+	public static delegate int Access (string path, int mask);
+	public static delegate int ReadLink (string path, char* buf, size_t size);
+	public static delegate int ReadDir (string path, void* buf, FillDir filler, off_t offset, FileInfo fi);
+	public static delegate int MkNod (string path, mode_t mode, dev_t rdev);
+	public static delegate int MkDir (string path, mode_t mode);
+	public static delegate int Unlink (string path);
+	public static delegate int RmDir (string path);
+	public static delegate int Symlink (string from, string to);
+	public static delegate int Rename (string from, string to);
+	public static delegate int Link (string from, string to);
+	public static delegate int Chmod (string path, mode_t mode);
+	public static delegate int Chown (string path, uid_t uid, gid_t gid);
+	public static delegate int Truncate (string path, off_t size);
+	public static delegate int Utimens (string path, timespec[2] ts);
+	public static delegate int Open (string path, FileInfo fi);
+	public static delegate int Read (string path, char* buf, size_t size, off_t offset, FileInfo fi);
+	public static delegate int Write (string path, char* buf, size_t size, off_t offset, FileInfo fi);
+	public static delegate int StatFs (string path, statvfs *stbuf);
+	public static delegate int Release (string path, FileInfo fi);
+	public static delegate int Fsync (string path, int isdatasync, FileInfo fi);
+
+	public static delegate int SetXAttr (string path, string name, char* value, size_t size, int flags);
+	public static delegate int GetXAttr (string path, string name, char* value, size_t size);
+	public static delegate int ListXAttr (string path, char* list, size_t size);
+	public static delegate int RemoveXAttr (string path, string name);
+
+	[CCode (cname = "struct fuse_operations")]
+	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 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 ();
+}

Modified: trunk/vapi/posix.vapi
==============================================================================
--- trunk/vapi/posix.vapi	(original)
+++ trunk/vapi/posix.vapi	Fri Feb 20 20:13:34 2009
@@ -503,6 +503,183 @@
 	[CCode (cheader_filename = "sys/socket.h")]
 	public int socket (int domain, int type, int protocol);
 
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFMT;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFBLK;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFCHR;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFIFO;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFREG;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFDIR;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFLNK;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IFSOCK;
+
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IRWXU;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IRUSR;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IWUSR;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IXUSR;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IRWXG;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IRGRP;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IWGRP;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IXGRP;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IRWXO;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IROTH;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IWOTH;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_IXOTH;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_ISUID;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_ISGID;
+	[CCode (cheader_filename = "sys/stat.h")]
+	public const mode_t S_ISVTX;
+
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISBLK (mode_t mode);
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISCHR (mode_t mode);
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISDIR (mode_t mode);
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISFIFO (mode_t mode);
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISREG (mode_t mode);
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISLNK (mode_t mode);
+	[CCode (cheader_filename = "sys/stat.h")]
+	public bool S_ISSOCK (mode_t mode);
+
+	[CCode (cheader_filename = "sys/stat.h", cname = "struct stat")]
+	public struct stat {
+		public dev_t st_dev;
+		public ino_t st_ino;
+		public mode_t st_mode;
+		public nlink_t st_nlink;
+		public uid_t st_uid;
+		public gid_t st_gid;
+		public dev_t st_rdev;
+		public size_t st_size;
+		public time_t st_atime;
+		public time_t st_mtime;
+		public time_t st_ctime;
+		public blksize_t st_blksize;
+		public blkcnt_t st_blocks;
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/statvfs.h")]
+	public struct fsblkcnt_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/statvfs.h")]
+	public struct fsfilcnt_t {
+	}
+
+	[CCode (cheader_filename = "sys/statvfs.h", cname = "struct statvfs")]
+	public struct statvfs {
+		public ulong f_bsize;
+		public ulong f_frsize;
+		public fsblkcnt_t f_blocks;
+		public fsblkcnt_t f_bfree;
+		public fsblkcnt_t f_bavail;
+		public fsfilcnt_t f_files;
+		public fsfilcnt_t f_ffree;
+		public fsfilcnt_t f_favail;
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct off_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct uid_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct gid_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct mode_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct dev_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct ino_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct nlink_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct blksize_t {
+	}
+
+	[SimpleType]
+	[IntegerType (rank = 9)]
+	[CCode (cheader_filename = "sys/types.h")]
+	public struct blkcnt_t {
+	}
+
+	[CCode (cheader_filename = "time.h")]
+	public struct tm {
+		public int tm_sec;
+		public int tm_min;
+		public int tm_hour;
+		public int tm_mday;
+		public int tm_mon;
+		public int tm_year;
+		public int tm_wday;
+		public int tm_yday;
+		public int tm_isdt;
+	}
+
+	[CCode (cheader_filename = "time.h")]
+	public struct timespec {
+		time_t tv_sec;
+		long tv_nsec;
+	}
+
 	[CCode (cheader_filename = "unistd.h")]
 	public int close (int fd);
 	[CCode (cheader_filename = "unistd.h")]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]