[vala/wip/gio-2.0: 10/10] gio-2.0: Keep GLib.Socket API compatible with gio < 2.48



commit 27d1fcdb8e7afa28aeed71fee4021ada946b9939
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Sep 16 20:54:27 2016 +0200

    gio-2.0: Keep GLib.Socket API compatible with gio < 2.48
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769222

 vapi/gio-2.0.vapi              |   27 ++++++++++++++++++++++-----
 vapi/metadata/Gio-2.0.metadata |   12 ++++++++----
 2 files changed, 30 insertions(+), 9 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index 8bda780..9a16fd7 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -2342,9 +2342,12 @@ namespace GLib {
                public bool bind (GLib.SocketAddress address, bool allow_reuse) throws GLib.Error;
                public bool check_connect_result () throws GLib.Error;
                public bool close () throws GLib.Error;
+               public GLib.IOCondition condition_check (GLib.IOCondition condition);
                [Version (since = "2.32")]
                public bool condition_timed_wait (GLib.IOCondition condition, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
+               public bool condition_wait (GLib.IOCondition condition, GLib.Cancellable? cancellable = null) 
throws GLib.IOError;
                public bool connect (GLib.SocketAddress address, GLib.Cancellable? cancellable = null) throws 
GLib.Error;
+               public GLib.SocketSource create_source (GLib.IOCondition condition, GLib.Cancellable? 
cancellable = null);
                [CCode (has_construct_function = false)]
                public Socket.from_fd (int fd) throws GLib.Error;
                [Version (since = "2.32")]
@@ -2382,10 +2385,14 @@ namespace GLib {
                public ssize_t receive ([CCode (array_length_cname = "size", array_length_pos = 1.5, 
array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.Error;
                public ssize_t receive_from (out GLib.SocketAddress address, [CCode (array_length_cname = 
"size", array_length_pos = 2.5, array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = 
null) throws GLib.Error;
                public ssize_t receive_message (out GLib.SocketAddress? address, [CCode (array_length_cname = 
"num_vectors", array_length_pos = 2.5)] GLib.InputVector[] vectors, [CCode (array_length_cname = 
"num_messages", array_length_pos = 3.5)] out GLib.SocketControlMessage[]? messages, ref int flags, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
+               [Version (since = "2.48")]
+               public int receive_messages ([CCode (array_length_cname = "num_messages", array_length_pos = 
1.5, array_length_type = "guint")] GLib.InputMessage[] messages, int flags, GLib.Cancellable? cancellable = 
null) throws GLib.Error;
                [Version (since = "2.26")]
                public ssize_t receive_with_blocking ([CCode (array_length_cname = "size", array_length_pos = 
1.5, array_length_type = "gsize")] uint8[] buffer, bool blocking, GLib.Cancellable? cancellable = null) 
throws GLib.Error;
                public ssize_t send ([CCode (array_length_cname = "size", array_length_pos = 1.5, 
array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.Error;
                public ssize_t send_message (GLib.SocketAddress? address, [CCode (array_length_cname = 
"num_vectors", array_length_pos = 2.5)] GLib.OutputVector[] vectors, [CCode (array_length_cname = 
"num_messages", array_length_pos = 3.5)] GLib.SocketControlMessage[]? messages, int flags, GLib.Cancellable? 
cancellable = null) throws GLib.Error;
+               [Version (since = "2.44")]
+               public int send_messages ([CCode (array_length_cname = "num_messages", array_length_pos = 
1.5, array_length_type = "guint")] GLib.OutputMessage[] messages, int flags, GLib.Cancellable? cancellable = 
null) throws GLib.Error;
                public ssize_t send_to (GLib.SocketAddress? address, [CCode (array_length_cname = "size", 
array_length_pos = 2.5, array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) 
throws GLib.Error;
                [Version (since = "2.26")]
                public ssize_t send_with_blocking ([CCode (array_length_cname = "size", array_length_pos = 
1.5, array_length_type = "gsize")] uint8[] buffer, bool blocking, GLib.Cancellable? cancellable = null) 
throws GLib.Error;
@@ -3203,11 +3210,21 @@ namespace GLib {
        [CCode (cheader_filename = "gio/gio.h", type_cname = "GDatagramBasedInterface", type_id = 
"g_datagram_based_get_type ()")]
        [Version (since = "2.48")]
        public interface DatagramBased : GLib.Object {
-               public abstract GLib.IOCondition condition_check (GLib.IOCondition condition);
-               public abstract bool condition_wait (GLib.IOCondition condition, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
-               public abstract GLib.Source create_source (GLib.IOCondition condition, GLib.Cancellable? 
cancellable = null);
-               public abstract int receive_messages ([CCode (array_length_cname = "num_messages", 
array_length_pos = 1.5, array_length_type = "guint")] GLib.InputMessage[] messages, int flags, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
-               public abstract int send_messages ([CCode (array_length_cname = "num_messages", 
array_length_pos = 1.5, array_length_type = "guint")] GLib.OutputMessage[] messages, int flags, int64 
timeout, GLib.Cancellable? cancellable = null) throws GLib.Error;
+               public GLib.IOCondition condition_check (GLib.IOCondition condition);
+               public bool condition_wait (GLib.IOCondition condition, int64 timeout, GLib.Cancellable? 
cancellable = null) throws GLib.Error;
+               public GLib.Source create_source (GLib.IOCondition condition, GLib.Cancellable? cancellable = 
null);
+               [CCode (vfunc_name = "condition_check")]
+               public virtual GLib.IOCondition datagram_condition_check (GLib.IOCondition condition);
+               [CCode (vfunc_name = "condition_wait")]
+               public virtual bool datagram_condition_wait (GLib.IOCondition condition, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
+               [CCode (vfunc_name = "create_source")]
+               public virtual GLib.Source datagram_create_source (GLib.IOCondition condition, 
GLib.Cancellable? cancellable = null);
+               [CCode (vfunc_name = "receive_messages")]
+               public virtual int datagram_receive_messages ([CCode (array_length_cname = "num_messages", 
array_length_pos = 1.5, array_length_type = "guint")] GLib.InputMessage[] messages, int flags, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
+               [CCode (vfunc_name = "send_messages")]
+               public virtual int datagram_send_messages ([CCode (array_length_cname = "num_messages", 
array_length_pos = 1.5, array_length_type = "guint")] GLib.OutputMessage[] messages, int flags, int64 
timeout, GLib.Cancellable? cancellable = null) throws GLib.Error;
+               public int receive_messages ([CCode (array_length_cname = "num_messages", array_length_pos = 
1.5, array_length_type = "guint")] GLib.InputMessage[] messages, int flags, int64 timeout, GLib.Cancellable? 
cancellable = null) throws GLib.Error;
+               public int send_messages ([CCode (array_length_cname = "num_messages", array_length_pos = 
1.5, array_length_type = "guint")] GLib.OutputMessage[] messages, int flags, int64 timeout, GLib.Cancellable? 
cancellable = null) throws GLib.Error;
        }
        [CCode (cheader_filename = "gio/gio.h", type_id = "g_drive_get_type ()")]
        public interface Drive : GLib.Object {
diff --git a/vapi/metadata/Gio-2.0.metadata b/vapi/metadata/Gio-2.0.metadata
index c408469..1257ce3 100644
--- a/vapi/metadata/Gio-2.0.metadata
+++ b/vapi/metadata/Gio-2.0.metadata
@@ -79,6 +79,12 @@ Cancellable
   .source_new skip=false type="GLib.CancellableSource"
 Credentials
   .get_native skip=false
+DatagramBased
+  .condition_check#virtual_method virtual name="datagram_condition_check"
+  .condition_wait#virtual_method virtual name="datagram_condition_wait"
+  .create_source#virtual_method virtual name="datagram_create_source"
+  .receive_messages#virtual_method virtual name="datagram_receive_messages"
+  .send_messages#virtual_method virtual name="datagram_send_messages"
 DataInputStream
   .read_* throws="GLib.IOError"
   .read_line* nullable
@@ -201,10 +207,8 @@ SimpleAsyncResult
   .new_error skip
   .new_from_error skip
 Socket
-  .condition_wait skip
-  .create_source skip
-  .receive_messages skip
-  .send_messages skip
+  .condition_wait throws="GLib.IOError"
+  .create_source skip=false type="GLib.SocketSource"
 SocketControlMessage
   .serialize.data type="uint8[]"
 SocketListener


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]