From: Jürg Billeter Date: Tue, 16 Dec 2008 20:22:02 +0000 (+0000) Subject: Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867 X-Git-Tag: VALA_0_5_3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db9cd7397162b8df35caf2dcb71229286b9dbdde;p=thirdparty%2Fvala.git Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867 2008-12-16 Jürg Billeter * gobject/valaccodebasemodule.vala: * vapi/glib-2.0.vapi: Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867 svn path=/trunk/; revision=2186 --- diff --git a/ChangeLog b/ChangeLog index ddc904d7d..079d561fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-16 Jürg Billeter + + * gobject/valaccodebasemodule.vala: + * vapi/glib-2.0.vapi: + + Fix GByteArray binding, patch by Evan Nemerson, fixes bug 561867 + 2008-12-16 Jürg Billeter * vapi/packages/gdk-pixbuf-2.0/: diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala index 691fdcb08..b94c76d7c 100644 --- a/gobject/valaccodebasemodule.vala +++ b/gobject/valaccodebasemodule.vala @@ -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; diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index f57dbdcdb..9fb16767d 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -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 */