From bb985e99274b537ee662d630b02664a3825d8829 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Sat, 6 Jul 2013 16:16:00 +0300 Subject: Add pb_decode_delimited and pb_encode_delimited wrapper functions. Update issue 74 Status: FixedInGit --- pb_decode.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pb_decode.h') diff --git a/pb_decode.h b/pb_decode.h index 85efa212..3da3f763 100644 --- a/pb_decode.h +++ b/pb_decode.h @@ -43,6 +43,12 @@ bool pb_decode(pb_istream_t *stream, const pb_field_t fields[], void *dest_struc */ bool pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); +/* Same as pb_decode, except expects the stream to start with the message size + * encoded as varint. Corresponds to parseDelimitedFrom() in Google's + * protobuf API. + */ +bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + /************************************** * Functions for manipulating streams * -- cgit 1.2.3-korg