Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

Commit

Permalink
msgpack: Fixes for 'Unpacker' and 'Unpacked'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arteymix committed Aug 16, 2016
1 parent 1e0ee48 commit c345a3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions msgpack.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ();
Expand Down

0 comments on commit c345a3a

Please sign in to comment.