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_encode.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pb_encode.h') diff --git a/pb_encode.h b/pb_encode.h index d9e0336a..04bdabee 100644 --- a/pb_encode.h +++ b/pb_encode.h @@ -32,6 +32,10 @@ extern "C" { */ bool pb_encode(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); +/* Same as pb_encode, but prepends the length of the message as a varint. + * Corresponds to writeDelimitedTo() in Google's protobuf API. + */ +bool pb_encode_delimited(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); /************************************** * Functions for manipulating streams * -- cgit 1.2.3-korg