Commit db9cd739 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

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

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
parent 9e4a0ac9
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/:
......
......@@ -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;
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment