add fanity vapi for testing
[gitlive] / fanotify / fanotify.vapi
diff --git a/fanotify/fanotify.vapi b/fanotify/fanotify.vapi
new file mode 100644 (file)
index 0000000..988b0fe
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ *
+ * Whats needed?
+ *
+ *
+ * fan_open() // returns file handle..
+ * fan_mark(... foler)
+ * fan_close(fh)
+ *
+ * // and a callback..
+ * ?/ jsu tdo it as a vapi?
+ * 
+  * vapi example
+ * https://github.com/apmasell/vapis/blob/master/transmission-2.0.vapi
+ * https://wiki.gnome.org/Projects/Vala/ManualBindings
+ */
+
+[CCode (cheader_filename = "sys/fanotify.h", lower_case_cprefix = "fanotify_", cprefix = "FAN_")]
+namespace Fanotify {
+
+    [CCode (cname = "int", cprefix = "FAN_", has_type_id = false)]
+    [Flags]
+    public enum  EventType {
+               ACCESS,
+               MODIFY,
+               ATTRIB,
+               CLOSE_WRITE,
+               CLOSE_NOWRITE,
+               OPEN,
+               MOVED_FROM,
+               MOVED_TO,
+               CREATE,
+               DELETE,
+               DELETE_SELF,
+               MOVE_SELF,
+               OPEN_EXEC,
+               Q_OVERFLOW,
+               FS_ERROR,
+               OPEN_PERM,
+               ACCESS_PERM,
+               OPEN_EXEC_PERM,
+               EVENT_ON_CHILD,
+               RENAME,
+               ONDIR,
+               CLOSE,
+               MOVE
+
+
+    }
+    [CCode (cname = "int", cprefix = "FAN_", has_type_id = false)]
+    [Flags]
+    public enum  InitFlag {
+        CLOEXEC,
+        NONBLOCK,
+        CLASS_NOTIF,
+        CLASS_CONTENT,
+        CLASS_PRE_CONTENT,
+               REPORT_FID,
+        REPORT_DIR_FID,
+        REPORT_NAME,
+        REPORT_TARGET_FID
+    }
+       
+    [CCode (cname = "int", cprefix = "FAN_MARK_", has_type_id = false)]
+    [Flags]
+    public enum  Mark {
+          ADD,
+          REMOVE,
+          DONT_FOLLOW,
+          ONLYDIR,
+          IGNORED_MASK,
+          IGNORED_SURV_MODIFY,
+          FLUSH,
+          EVICTABLE,
+          IGNORE,
+          
+          INODE,
+          MOUNT,
+          FILESYSTEM
+   }
+     
+       [CCode (cname = "struct fanotify_event_metadata", has_destroy_function = false, has_copy_function = false, has_type_id = false)]
+       public struct EventMetadata   {
+               [CCode (cname = "event_len")]
+        public uint32 event_len;
+        
+        [CCode (cname = "vers")]
+        public uint8 vers;    
+
+        [CCode (cname = "reserved")]
+        public uint8 reserved;
+            
+        [CCode (cname = "metadata_len")]
+        public uint16 metadata_len;
+        
+        [CCode (cname = "mask")]
+        public uint64 mask;    
+       
+        [CCode (cname = "fd")]
+        public uint32 fd;
+        
+        [CCode (cname = "pid")]
+        public uint32 pid;    
+       
+    }
+       [CCode (cname = "struct kernel_fsid_t", has_destroy_function = false, has_copy_function = false, has_type_id = false)]
+       public struct KernelFsid   {
+           [CCode (cname = "val")]
+        public int val[2];
+    }
+    
+    [CCode (cname = "struct fanotify_event_info_header", has_destroy_function = false, has_copy_function = false, has_type_id = false)]
+    public struct EventInfoHeader {
+        [CCode (cname = "info_type")]
+        public uint8 info_type;
+        
+       [CCode (cname = "pad")]
+        public uint8 pad;
+        
+       [CCode (cname = "len")]
+        public uint16  len;
+    }
+
+    [CCode (cname = "struct fanotify_event_info_fid", has_destroy_function = false, has_copy_function = false, has_type_id = false)]
+    public struct EventInfoFid  {
+        [CCode (cname = "hdr")]
+        public EventInfoHeader hdr;
+        [CCode (cname = "fsid")]
+        public  KernelFsid fsid;
+    
+        [CCode (cname = "handle")]
+        public uchar[] handle;
+    }
+
+         
+  
+       [CCode (cname = "fanotify_init")]
+       public int init (uint __flags, uint __event_f_flags);
+    
+    [CCode (cname = "fanotify_mark")]
+    public int  mark (int __fanotify_fd, uint __flags, uint64 __mask, int __dfd, string __pathname);        
+
+}
\ No newline at end of file