add bzip2 binding, patch by Maciej Piechotka add bzip2
authorRaffaele Sandrini <raffaele@sandrini.ch>
Sun, 24 Feb 2008 13:01:17 +0000 (13:01 +0000)
committerRaffaele Sandrini <rasa@src.gnome.org>
Sun, 24 Feb 2008 13:01:17 +0000 (13:01 +0000)
2008-02-24  Raffaele Sandrini  <raffaele@sandrini.ch>

* vapi/bzlib.vapi: add bzip2 binding, patch by Maciej Piechotka
* vapi/Makefile.am: add bzip2

svn path=/trunk/; revision=1047

ChangeLog
vapi/Makefile.am
vapi/bzlib.vapi [new file with mode: 0644]

index f2f7eac..09e7214 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-02-24  Raffaele Sandrini  <raffaele@sandrini.ch>
 
+       * vapi/bzlib.vapi: add bzip2 binding, patch by Maciej Piechotka
+       * vapi/Makefile.am: add bzip2
+
+2008-02-24  Raffaele Sandrini  <raffaele@sandrini.ch>
+
        * doc/vala/interfaces.xml: add some interface documentation,
          patch by Johannes Schmid
 
index 23e7d67..6b42100 100644 (file)
@@ -10,6 +10,7 @@ gee-1.0.vapi: ../gee/gee.vapi
 
 dist_vapi_DATA = \
        atk.vapi \
+       bzlib.vapi \
        cairo.vapi \
        curses.vapi \
        dbus-glib-1.vapi \
diff --git a/vapi/bzlib.vapi b/vapi/bzlib.vapi
new file mode 100644 (file)
index 0000000..4d4bde0
--- /dev/null
@@ -0,0 +1,61 @@
+[CCode (cheader_filename = "bzlib.h")]
+namespace BZLib {
+    [CCode (cname = "int", cprefix = "BZ_")]
+    public enum Action {
+        RUN,
+        FLUSH,
+        FINISH
+    }
+    
+    [CCode (cname = "int", cprefix = "BZ_")]
+    public enum Status {
+        OK,
+        RUN_OK,
+        FLUSH_OK,
+        FINISH_OK,
+        STREAM_END,
+        SEQUENCE_ERROR,
+        MEM_ERROR,
+        DATA_ERROR,
+        DATA_ERROR_MAGICK,
+        IO_ERROR,
+        UNEXPECTED_EOF,
+        OUTBUFF_FULL,
+        CONFIG_ERROR
+    }
+    
+    //DO NOT HAVE Alloc NOR Free VARIABLES!!!
+    public delegate void *Alloc (void *opaque, int n, int m);
+    public delegate void Free (void *opaque, void *pointer);
+    
+    [CCode (cname = "bz_stream", free_function = "g_free")]
+    public class Stream {
+        public string next_in;
+        public uint avail_in;
+        public uint totoal_in_lo32;
+        public uint total_in_hi32;
+        public string next_out;
+        public uint avail_out;
+        public uint totoal_out_lo32;
+        public uint total_out_hi32;
+        public void *state;
+        //Set Alloc and Free to NULL!
+        [CCode (cname = "bzalloc")];
+        public Alloc alloc;
+        [CCode (cname = "bzfree")];
+        public Free free;
+        public void *opaque;
+        [CCode (cname = "BZ2_bzDecompressInit")]
+        public Status compress_init (int block_size_100k, int verbosity, int work_factor);
+        [CCode (cname = "BZ2_bzDecompress")]
+        public Status compress (Action action);
+        [CCode (cname = "BZ2_bzDecompressEnd")]
+        public Status compress_end ();
+        [CCode (cname = "BZ2_bzDecompressInit")]
+        public Status decompress_init (int verbosity, int small);
+        [CCode (cname = "BZ2_bzDecompress")]
+        public Status decompress ();
+        [CCode (cname = "BZ2_bzDecompressEnd")]
+        public Status decompress_end ();
+    }
+}