Merge branch 'master' into gregoa
[gregoa/zavai.git] / src / libomhacks.vapi
index b244fdef17d42cc00f28d9c652a4beecd925fbad..83434f3afb4943485eb5694a301a82215c2ede7c 100644 (file)
@@ -1,16 +1,55 @@
-[CCode (lower_case_cprefix="", cprefix="", cheader_filename="omhacks/all.h")]
+[CCode (cprefix="", cheader_filename="omhacks/all.h")]
 namespace Omhacks
 {
-       namespace Screen
-       {
-               namespace Brightness
-               {
-                       [CCode (cname = "om_screen_brightness_get")]
-                       public int get();
-                       [CCode (cname = "om_screen_brightness_get_max")]
-                       public int get_max();
-                       [CCode (cname = "om_screen_brightness_set")]
-                       public int set(int val);
-               }
-       }       
+    [CCode (cname = "struct om_led", cheader_filename = "omhacks/led.h", destroy_function = "")]
+    public struct Led
+    {
+        public char name[255];
+        public string dir;
+        public int dir_len;
+        public int brightness;
+        public char trigger[255];
+        public int delay_on;
+        public int delay_off;
+
+        [CCode (cname = "om_led_init")]
+        public int init(string name);
+        [CCode (cname = "om_led_get")]
+        public int get();
+        [CCode (cname = "om_led_set")]
+        public int set();
+    }
+
+    namespace Screen
+    {
+        namespace Brightness
+        {
+            [CCode (cname = "om_screen_brightness_get")]
+            public int get();
+            [CCode (cname = "om_screen_brightness_get_max")]
+            public int get_max();
+            [CCode (cname = "om_screen_brightness_set")]
+            public int set(int val);
+        }
+    }
+
+    namespace UEvent
+    {
+        [CCode (cname = "struct om_uevent", cheader_filename = "omhacks/uevent.h", destroy_function = "")]
+        public struct Event
+        {
+            public string buffer;
+            size_t buflen;
+            weak string action;
+            weak string devpath;
+            weak string[] envp;
+        }
+
+        [CCode (cname = "om_uevent_open")]
+        public int open();
+        [CCode (cname = "om_uevent_read")]
+        public int read(int sock, ref Event ou);
+        [CCode (cname = "om_uevent_parse")]
+        public int parse(ref Event ou);
+    }
 }