diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-01-19 10:28:51 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-01-19 10:28:51 -0800 |
commit | dda1499a0eab41165c82277e630dd7050145448f (patch) | |
tree | 059f8819c007261279688a5929d007d7b249becf /src/upb_data.h | |
parent | 036fe6bb0673930cd5e8450532abe3b7acffb94e (diff) |
Add status to the sink interfaces.
Diffstat (limited to 'src/upb_data.h')
-rw-r--r-- | src/upb_data.h | 10 |
1 files changed, 8 insertions, 2 deletions
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 ****************************************************************/ |