]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gio-2.0: MemoryIn/OutputStream, use a default destroy-function for uint8[] data
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 28 Oct 2015 12:55:55 +0000 (13:55 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 28 Oct 2015 12:59:46 +0000 (13:59 +0100)
vapi/gio-2.0.vapi
vapi/metadata/Gio-2.0-custom.vala
vapi/metadata/Gio-2.0.metadata

index 6ac0b0b3daac9c6c43fac0dc9c911a20d0006904..79cdab3deff17c011ec85bc96b4ccf40d904dc42 100644 (file)
@@ -1405,16 +1405,16 @@ namespace GLib {
                [CCode (has_construct_function = false, type = "GInputStream*")]
                public MemoryInputStream ();
                public void add_bytes (GLib.Bytes bytes);
-               public void add_data ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gssize")] owned uint8[] data, GLib.DestroyNotify? destroy);
+               public void add_data ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gssize")] owned uint8[] data, GLib.DestroyNotify? destroy = GLib.g_free);
                [CCode (has_construct_function = false, type = "GInputStream*")]
                public MemoryInputStream.from_bytes (GLib.Bytes bytes);
                [CCode (has_construct_function = false, type = "GInputStream*")]
-               public MemoryInputStream.from_data ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gssize")] owned uint8[] data, GLib.DestroyNotify? destroy);
+               public MemoryInputStream.from_data ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gssize")] owned uint8[] data, GLib.DestroyNotify? destroy = GLib.g_free);
        }
        [CCode (cheader_filename = "gio/gio.h")]
        public class MemoryOutputStream : GLib.OutputStream, GLib.PollableOutputStream, GLib.Seekable {
                [CCode (has_construct_function = false, type = "GOutputStream*")]
-               public MemoryOutputStream ([CCode (array_length_type = "gsize")] owned uint8[]? data, GLib.ReallocFunc? realloc_function, GLib.DestroyNotify? destroy_function);
+               public MemoryOutputStream ([CCode (array_length_type = "gsize")] owned uint8[]? data, GLib.ReallocFunc? realloc_function = GLib.g_realloc, GLib.DestroyNotify? destroy_function = GLib.g_free);
                [CCode (array_length = false)]
                public unowned uint8[] get_data ();
                public size_t get_data_size ();
@@ -2418,7 +2418,7 @@ namespace GLib {
                public void set_flags (GLib.TlsPasswordFlags flags);
                public void set_value ([CCode (array_length_cname = "length", array_length_pos = 1.1, array_length_type = "gssize", type = "const guchar*")] uint8[] value);
                [CCode (vfunc_name = "set_value")]
-               public virtual void set_value_full ([CCode (array_length_cname = "length", array_length_pos = 1.5, array_length_type = "gssize", type = "guchar*")] owned uint8[] value, GLib.DestroyNotify? notify = GLib.free);
+               public virtual void set_value_full ([CCode (array_length_cname = "length", array_length_pos = 1.5, array_length_type = "gssize", type = "guchar*")] owned uint8[] value, GLib.DestroyNotify? notify = GLib.g_free);
                public void set_warning (string warning);
                public string description { get; set; }
                public GLib.TlsPasswordFlags flags { get; set; }
@@ -3828,6 +3828,8 @@ namespace GLib {
        [CCode (cheader_filename = "gio/gio.h")]
        [Deprecated (replacement = "File.hash", since = "vala-0.16")]
        public static GLib.HashFunc file_hash;
+       [CCode (cheader_filename = "glib.h", cname = "g_realloc")]
+       public static GLib.ReallocFunc g_realloc;
        [CCode (cheader_filename = "gio/gio.h")]
        [Deprecated (replacement = "FileAttribute.ACCESS_CAN_DELETE", since = "vala-0.16")]
        public const string FILE_ATTRIBUTE_ACCESS_CAN_DELETE;
index 3a8692d2fcb7306471c1eb27a2be91ae80d46753..7c43724ac5f0b31c873f965c7b77a9da0612d0a8 100644 (file)
@@ -1,4 +1,7 @@
 namespace GLib {
+       [CCode (cheader_filename = "glib.h", cname = "g_realloc")]
+       public static GLib.ReallocFunc g_realloc;
+
        [CCode (cheader_filename = "gio/gio.h")]
        namespace Bus {
                public async GLib.DBusConnection get (GLib.BusType bus_type, GLib.Cancellable? cancellable = null) throws GLib.IOError;
@@ -100,7 +103,7 @@ namespace GLib {
 
        public class MemoryOutputStream : GLib.OutputStream {
                [CCode (has_construct_function = false, type = "GOutputStream*")]
-               public MemoryOutputStream ([CCode (array_length_type = "gsize")] owned uint8[]? data, GLib.ReallocFunc? realloc_function, GLib.DestroyNotify? destroy_function);
+               public MemoryOutputStream ([CCode (array_length_type = "gsize")] owned uint8[]? data, GLib.ReallocFunc? realloc_function = GLib.g_realloc, GLib.DestroyNotify? destroy_function = GLib.g_free);
        }
 
        [CCode (cheader_filename = "gio/gio.h", type_id = "g_native_socket_address_get_type ()")]
@@ -175,7 +178,7 @@ namespace GLib {
 
        public class TlsPassword : GLib.Object {
                [CCode (vfunc_name = "set_value")]
-               public virtual void set_value_full ([CCode (array_length_cname = "length", array_length_pos = 1.5, array_length_type = "gssize", type = "guchar*")] owned uint8[] value, GLib.DestroyNotify? notify = GLib.free);
+               public virtual void set_value_full ([CCode (array_length_cname = "length", array_length_pos = 1.5, array_length_type = "gssize", type = "guchar*")] owned uint8[] value, GLib.DestroyNotify? notify = GLib.g_free);
        }
 
        public class VolumeMonitor : GLib.Object {
index 1c2eb7708f80415336636d5076d4710f7a123927..2a52f62c61544b653ca03d4f4006ce6c4e8d6ce4 100644 (file)
@@ -143,6 +143,10 @@ InputStream
 ListModel
   .get_item#virtual_method skip
   .get_item#method skip=false abstract
+MemoryInputStream
+  .add_data.destroy default=GLib.g_free
+MemoryInputStream
+  .new_from_data.destroy default=GLib.g_free
 MemoryOutputStream
   .get_data type="unowned uint8[]"
   .steal_data type="uint8[]"