]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867
authorJürg Billeter <j@bitron.ch>
Tue, 16 Dec 2008 20:22:02 +0000 (20:22 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 16 Dec 2008 20:22:02 +0000 (20:22 +0000)
2008-12-16  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodebasemodule.vala:
* vapi/glib-2.0.vapi:

Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867

svn path=/trunk/; revision=2186

ChangeLog
gobject/valaccodebasemodule.vala
vapi/glib-2.0.vapi

index ddc904d7d5b3622413b215ebcfac91f466cae8eb..079d561fd86b1389b08f8ddf3d2f52ae802328a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-16  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodebasemodule.vala:
+       * vapi/glib-2.0.vapi:
+
+       Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867
+
 2008-12-16  Jürg Billeter  <j@bitron.ch>
 
        * vapi/packages/gdk-pixbuf-2.0/:
index 691fdcb08395c453719cb23af087f657118db2a4..b94c76d7c23ebb602eada96bff50df1a2daf8663 100644 (file)
@@ -112,6 +112,7 @@ public class Vala.CCodeBaseModule : CCodeModule {
        public Class gslist_type;
        public TypeSymbol gstringbuilder_type;
        public TypeSymbol garray_type;
+       public TypeSymbol gbytearray_type;
        public DataType gquark_type;
        public Struct gvalue_type;
        public Struct mutex_type;
@@ -574,6 +575,7 @@ public class Vala.CCodeBaseModule : CCodeModule {
                gslist_type = (Class) glib_ns.scope.lookup ("SList");
                gstringbuilder_type = (TypeSymbol) glib_ns.scope.lookup ("StringBuilder");
                garray_type = (TypeSymbol) glib_ns.scope.lookup ("Array");
+               gbytearray_type = (TypeSymbol) glib_ns.scope.lookup ("ByteArray");
 
                gquark_type = new ValueType ((TypeSymbol) glib_ns.scope.lookup ("Quark"));
                gvalue_type = (Struct) glib_ns.scope.lookup ("Value");
@@ -1757,7 +1759,8 @@ public class Vala.CCodeBaseModule : CCodeModule {
                /* set freed references to NULL to prevent further use */
                var ccomma = new CCodeCommaExpression ();
 
-               if (type.data_type == gstringbuilder_type || type.data_type == garray_type) {
+               if (type.data_type == gstringbuilder_type
+                    || type.data_type == garray_type || type.data_type == gbytearray_type) {
                        ccall.add_argument (new CCodeConstant ("TRUE"));
                } else if (type is ArrayType) {
                        var array_type = (ArrayType) type;
index f57dbdcdb247ee85b4b601c608b595d1458c4a26..9fb16767dae1e8442a9bebe98c90b7b21821b46b 100644 (file)
@@ -3012,8 +3012,19 @@ namespace GLib {
        /* Byte Arrays */
 
        [Compact]
-       [CCode (free_function = "g_byte_array_free")]
+       [CCode (cprefix = "g_byte_array_", free_function = "g_byte_array_free")]
        public class ByteArray {
+               public ByteArray ();
+               [CCode (cname = "g_byte_array_sized_new")]
+               public ByteArray.sized (uint reserved_size);
+               public void append (uint8[] data);
+               public void prepend (uint8[] data);
+               public void remove_index (uint index);
+               public void remove_index_fast (uint index);
+               public void remove_range (uint index, uint length);
+               public void sort (CompareFunc compare_func);
+               public void sort_with_data (CompareDataFunc compare_func);
+               public void set_size (uint length);
        }
 
        /* N-ary Trees */