[vala-extra-vapis] msgpack: Fixes for 'Unpacker' and 'Unpacked'



commit c345a3a40fad47401f3a1c41f1d71a7ea4d0f9ae
Author: Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>
Date:   Mon Aug 15 22:59:02 2016 -0400

    msgpack: Fixes for 'Unpacker' and 'Unpacked'
    
    Add a constructor to 'Unpacked' to call 'msgpack_unpacked_init'.
    
    Let 'off' be 'null' by default in 'Unpacked.next'.
    
    Add 'buffer_consumed' to 'Unpacked' which has to be invoked once we
    write to 'buffer' with the number of bytes written.
    
    Make 'data' in 'Unpacker' return an unowned 'Object' since it is held by
    the unpacker.

 msgpack.vapi |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/msgpack.vapi b/msgpack.vapi
index c1481ef..c468de9 100644
--- a/msgpack.vapi
+++ b/msgpack.vapi
@@ -263,9 +263,11 @@ namespace MessagePack
        public struct Unpacked
        {
                MessagePack.Object data;
-               MessagePack.Zone release_zone ();
+               [CCode (cname = "msgpack_unpacked_init")]
+               public Unpacked ();
+               public MessagePack.Zone release_zone ();
                [CCode (cname = "msgpack_unpack_next")]
-               public MessagePack.UnpackReturn next ([CCode (array_length_type = "size_t")] uint8[] data, 
out size_t off);
+               public MessagePack.UnpackReturn next ([CCode (array_length_type = "size_t")] uint8[] data, 
out size_t? off = null);
        }
 
        public const size_t UNPACKER_INIT_BUFFER_SIZE;
@@ -287,9 +289,10 @@ namespace MessagePack
                        return buf;
                }
                public size_t buffer_capacity ();
+               public void buffer_consumed (size_t size);
                public UnpackReturn next (out MessagePack.Unpacked pac);
                public int execute ();
-               public MessagePack.Object data ();
+               public unowned MessagePack.Object data ();
                public MessagePack.Zone release_zone ();
                public void reset_zone ();
                public void reset ();


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