From dda1499a0eab41165c82277e630dd7050145448f Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 19 Jan 2010 10:28:51 -0800 Subject: Add status to the sink interfaces. --- src/upb_data.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/upb_data.h') diff --git a/src/upb_data.h b/src/upb_data.h index 2d2f402..cdb7af2 100644 --- a/src/upb_data.h +++ b/src/upb_data.h @@ -509,18 +509,24 @@ INLINE void upb_msg_clear(upb_msg *msg, upb_msgdef *md) { memset(msg->data, 0, md->set_flags_bytes); } -// A convenience function for parsing an entire protobuf all at once, without +// A convenience function for decoding an entire protobuf all at once, without // having to worry about setting up the appropriate objects. void upb_msg_decodestr(upb_msg *msg, upb_msgdef *md, upb_strptr str, upb_status *status); +// A convenience function for encoding an entire protobuf all at once. If an +// error occurs, the null string is returned and the status object contains +// the error. +void upb_msg_encodestr(upb_msg *msg, upb_msgdef *md, upb_strptr str, + upb_status *status); + /* upb_msgsrc *****************************************************************/ // A nonresumable, non-interruptable (but simple and fast) source for pushing // the data of a upb_msg to a upb_sink. void upb_msgsrc_produce(upb_msg *msg, upb_msgdef *md, upb_sink *sink, - bool reverse); + bool reverse, upb_status *status); /* upb_msgsink ****************************************************************/ -- cgit v1.2.3