From: Evan Nemerson Date: Sat, 23 Oct 2010 07:57:03 +0000 (-0700) Subject: gio-2.0: use uint8[] for buffers instead of void* X-Git-Tag: 0.11.1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02abf1661fd5fcec9600ca2d1726c660b8ea59a9;p=thirdparty%2Fvala.git gio-2.0: use uint8[] for buffers instead of void* --- diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi index 542e8ef74..da9fb6d0c 100644 --- a/vapi/gio-2.0.vapi +++ b/vapi/gio-2.0.vapi @@ -75,8 +75,9 @@ namespace GLib { public virtual async ssize_t fill_async (ssize_t count, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; public size_t get_available (); public size_t get_buffer_size (); - public size_t peek (void* buffer, size_t offset, size_t count); - public void* peek_buffer (out size_t count); + public size_t peek ([CCode (array_length_type = "gsize", array_length_pos = 2.9)] uint8[] buffer, size_t offset = 0); + [CCode (array_length_type = "gsize")] + public unowned uint8[] peek_buffer (); public int read_byte (GLib.Cancellable? cancellable = null) throws GLib.Error; public void set_buffer_size (size_t size); [CCode (type = "GInputStream*", has_construct_function = false)] @@ -854,11 +855,10 @@ namespace GLib { public virtual bool close_fn (GLib.Cancellable? cancellable = null) throws GLib.Error; public bool has_pending (); public bool is_closed (); - public ssize_t read (void* buffer, size_t count, GLib.Cancellable? cancellable = null) throws GLib.Error; - public bool read_all (void* buffer, size_t count, out size_t bytes_read, GLib.Cancellable? cancellable = null) throws GLib.Error; - public virtual async ssize_t read_async (void* buffer, size_t count, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; - [NoWrapper] - public virtual ssize_t read_fn (void* buffer, size_t count, GLib.Cancellable? cancellable = null) throws GLib.Error; + [CCode (vfunc_name = "read_fn")] + public virtual ssize_t read ([CCode (array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.Error; + public bool read_all ([CCode (array_length_type = "gsize")] uint8[] buffer, out size_t bytes_read, GLib.Cancellable? cancellable = null) throws GLib.Error; + public virtual async ssize_t read_async ([CCode (array_length_type = "gsize")] uint8[] buffer, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; public bool set_pending () throws GLib.Error; public virtual ssize_t skip (size_t count, GLib.Cancellable? cancellable = null) throws GLib.Error; public virtual async ssize_t skip_async (size_t count, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; @@ -866,25 +866,27 @@ namespace GLib { [Compact] [CCode (cheader_filename = "gio/gio.h")] public class InputVector { - public void* buffer; - public size_t size; + [CCode (array_length_cname = "size", array_length_type = "gsize")] + public uint8[] buffer; } [CCode (cheader_filename = "gio/gio.h")] public class MemoryInputStream : GLib.InputStream, GLib.Seekable { [CCode (type = "GInputStream*", has_construct_function = false)] public MemoryInputStream (); - public void add_data (void* data, ssize_t len, GLib.DestroyNotify? destroy); + public void add_data ([CCode (array_length_type = "gsize")] owned uint8[] data, GLib.DestroyNotify? destroy); [CCode (type = "GInputStream*", has_construct_function = false)] - public MemoryInputStream.from_data (void* data, ssize_t len, GLib.DestroyNotify? destroy); + public MemoryInputStream.from_data ([CCode (array_length_type = "gsize")] owned uint8[] data, GLib.DestroyNotify? destroy); } [CCode (cheader_filename = "gio/gio.h")] public class MemoryOutputStream : GLib.OutputStream, GLib.Seekable { [CCode (type = "GOutputStream*", has_construct_function = false)] - public MemoryOutputStream (void* data, size_t size, GLib.ReallocFunc realloc_function, GLib.DestroyNotify? destroy_function); - public void* get_data (); + public MemoryOutputStream ([CCode (array_length_type = "gsize")] owned uint8[] data, GLib.ReallocFunc? realloc_function, GLib.DestroyNotify? destroy_function); + [CCode (array_length = false)] + public unowned uint8[] get_data (); public size_t get_data_size (); public size_t get_size (); - public void* steal_data (); + [CCode (array_length = false)] + public uint8[] steal_data (); public void* data { get; construct; } public ulong data_size { get; } [NoAccessorMethod] @@ -973,17 +975,16 @@ namespace GLib { public bool set_pending () throws GLib.Error; public virtual ssize_t splice (GLib.InputStream source, GLib.OutputStreamSpliceFlags flags, GLib.Cancellable? cancellable = null) throws GLib.Error; public virtual async ssize_t splice_async (GLib.InputStream source, GLib.OutputStreamSpliceFlags flags, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; - public ssize_t write (void* buffer, size_t count, GLib.Cancellable? cancellable = null) throws GLib.Error; - public bool write_all (void* buffer, size_t count, out size_t bytes_written, GLib.Cancellable? cancellable = null) throws GLib.Error; - public virtual async ssize_t write_async (void* buffer, size_t count, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; - [NoWrapper] - public virtual ssize_t write_fn (void* buffer, size_t count, GLib.Cancellable? cancellable = null) throws GLib.Error; + [CCode (vfunc_name = "write_fn")] + public virtual ssize_t write ([CCode (array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.Error; + public bool write_all ([CCode (array_length_type = "gsize")] uint8[] buffer, out size_t bytes_written, GLib.Cancellable? cancellable = null) throws GLib.Error; + public virtual async ssize_t write_async ([CCode (array_length_type = "gsize")] uint8[] buffer, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error; } [Compact] [CCode (cheader_filename = "gio/gio.h")] public class OutputVector { - public void* buffer; - public size_t size; + [CCode (array_length_cname = "size", array_length_type = "gsize")] + public uint8[] buffer; } [CCode (cheader_filename = "gio/gio.h")] public class Permission : GLib.Object { @@ -1287,13 +1288,13 @@ namespace GLib { public class SocketControlMessage : GLib.Object { [CCode (has_construct_function = false)] protected SocketControlMessage (); - public virtual unowned GLib.SocketControlMessage deserialize (int level, int type, size_t size, void* data); + public virtual GLib.SocketControlMessage deserialize (int level, int type, [CCode (array_length_type = "gsize", array_length_pos = 2.9)] uint8[] data); public virtual int get_level (); public int get_msg_type (); public virtual size_t get_size (); [NoWrapper] public virtual int get_type (); - public virtual void serialize (void* data); + public virtual void serialize ([CCode (array_length = false)] uint8[] data); } [CCode (cheader_filename = "gio/gio.h")] public class SocketListener : GLib.Object { @@ -1539,7 +1540,7 @@ namespace GLib { } [CCode (cheader_filename = "gio/gio.h")] public interface Converter : GLib.Object { - public abstract GLib.ConverterResult convert (void* inbuf, size_t inbuf_size, void* outbuf, size_t outbuf_size, GLib.ConverterFlags flags, out size_t bytes_read, out size_t bytes_written) throws GLib.Error; + public abstract GLib.ConverterResult convert ([CCode (array_length_type = "gsize")] uint8[] inbuf, [CCode (array_length_type = "gsize")] uint8[] outbuf, GLib.ConverterFlags flags, out size_t bytes_read, out size_t bytes_written) throws GLib.Error; public abstract void reset (); } [CCode (cheader_filename = "gio/gio.h")] diff --git a/vapi/packages/gio-2.0/gio-2.0.metadata b/vapi/packages/gio-2.0/gio-2.0.metadata index f86760018..d444f2f13 100644 --- a/vapi/packages/gio-2.0/gio-2.0.metadata +++ b/vapi/packages/gio-2.0/gio-2.0.metadata @@ -12,13 +12,21 @@ g_app_launch_context_get_startup_notify_id.files type_arguments="File" GAsyncReadyCallback.source_object nullable="1" g_async_initable_new_async transfer_ownership="1" g_async_initable_new_async.cancellable nullable="1" -g_buffered_input_stream_peek_buffer.count is_out="1" +g_buffered_input_stream_peek.buffer type_name="uint8" is_array="1" array_length_pos="2.9" array_length_type="gsize" +g_buffered_input_stream_peek.count hidden="1" +g_buffered_input_stream_peek.offset default_value="0" +g_buffered_input_stream_peek_buffer type_name="uint8" is_array="1" array_length_type="gsize" +g_buffered_input_stream_peek_buffer.count hidden="1" g_content_type_from_mime_type transfer_ownership="1" g_content_type_get_* transfer_ownership="1" g_content_type_guess* transfer_ownership="1" g_content_type_guess.data_size hidden="1" g_content_type_guess.result_uncertain is_out="1" g_content_types_get_registered type_arguments="string" transfer_ownership="1" +g_converter_convert.inbuf type_name="uint8" is_array="1" array_length_type="gsize" +g_converter_convert.inbuf_size hidden="1" +g_converter_convert.outbuf type_name="uint8" is_array="1" array_length_type="gsize" +g_converter_convert.outbuf_size hidden="1" g_converter_convert.bytes_read is_out="1" g_converter_convert.bytes_written is_out="1" g_data_input_stream_read_line nullable="1" transfer_ownership="1" @@ -115,13 +123,25 @@ g_icon_to_string transfer_ownership="1" g_inet_address_to_string transfer_ownership="1" g_inet_address_to_bytes type_name="uint8" is_array="1" no_array_length="1" g_initable_new.cancellable nullable="1" +g_input_stream_read virtual="1" vfunc_name="read_fn" +g_input_stream_read_fn hidden="1" +g_input_stream_read*.buffer type_name="uint8" is_array="1" array_length_type="gsize" +g_input_stream_read*.count hidden="1" g_input_stream_read_all.bytes_read is_out="1" +GInputVector.buffer type_name="uint8" is_array="1" weak="0" array_length_type="gsize" array_length_cname="size" +GInputVector.size hidden="1" GIOErrorEnum rename_to="IOError" errordomain="1" g_io_extension_point_get_extensions type_arguments="IOExtension" g_io_modules_load_all_in_directory type_arguments="unowned TypeModule" transfer_ownership="1" g_loadable_icon_load_async.cancellable nullable="1" -g_memory_input_stream_add_data.destroy nullable="1" -g_memory_input_stream_new_from_data.destroy nullable="1" +g_memory_input_stream_*_data.data type_name="uint8" is_array="1" transfer_ownership="1" array_length_type="gsize" +g_memory_input_stream_*_data.len hidden="1" +g_memory_input_stream_*_data.destroy nullable="1" +g_memory_output_stream_new.data type_name="uint8" is_array="1" transfer_ownership="1" array_length_type="gsize" +g_memory_output_stream_new.size hidden="1" +g_memory_output_stream_new.realloc_function nullable="1" +g_memory_output_stream_get_data type_name="uint8" is_array="1" no_array_length="1" +g_memory_output_stream_steal_data type_name="uint8" is_array="1" no_array_length="1" transfer_ownership="1" g_mount_eject async="1" g_mount_eject_with_operation async="1" g_mount_guess_content_type async="1" @@ -129,7 +149,13 @@ g_mount_remount async="1" g_mount_unmount async="1" g_mount_unmount_with_operation async="1" GMountOperation::reply has_emitter="1" +g_output_stream_write virtual="1" vfunc_name="write_fn" +g_output_stream_write*.buffer type_name="uint8" is_array="1" array_length_type="gsize" +g_output_stream_write*.count hidden="1" +g_output_stream_write_fn hidden="1" g_output_stream_write_all.bytes_written is_out="1" +GOutputVector.buffer type_name="uint8" is_array="1" weak="0" array_length_type="gsize" array_length_cname="size" +GOutputVector.size hidden="1" g_resolver_free_addresses hidden="1" g_resolver_free_targets hidden="1" g_resolver_lookup_by_name transfer_ownership="1" type_arguments="InetAddress" @@ -141,6 +167,10 @@ g_seekable_truncate_fn hidden="1" g_settings_get ellipsis="1" sentinel="" g_settings_set ellipsis="1" sentinel="" g_socket_create_source type_name="SocketSource" transfer_ownership="1" +g_socket_control_message_deserialize transfer_ownership="1" +g_socket_control_message_deserialize.data type_name="uint8" is_array="1" array_length_type="gsize" array_length_pos="2.9" +g_socket_control_message_deserialize.size hidden="1" +g_socket_control_message_serialize.data type_name="uint8" is_array="1" no_array_length="1" g_socket_listener_add_address.source_object nullable="1" g_socket_listener_add_inet_port.source_object nullable="1" g_socket_listener_add_socket.source_object nullable="1"