From e8c58eb78dbd7fc161a82da321dad028a0acbb3d Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 1 Aug 2009 23:06:22 -0700 Subject: Sketches of serialization. --- src/upb_parse.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/upb_parse.h') diff --git a/src/upb_parse.h b/src/upb_parse.h index 193c307..e727c11 100644 --- a/src/upb_parse.h +++ b/src/upb_parse.h @@ -99,7 +99,9 @@ struct upb_parse_state { upb_submsg_end_cb submsg_end_cb; }; -/* Parses up to len bytes of protobuf data out of buf, calling cb as needed. +/* Parses up to len bytes of protobuf data out of buf, calling the appropriate + * callbacks as values are parsed. + * * The function returns a status indicating the success of the operation. Data * is parsed until no more data can be read from buf, or the callback returns an * error like UPB_STATUS_USER_CANCELLED, or an error occurs. @@ -109,7 +111,10 @@ struct upb_parse_state { * of the currently provided data. * * The next call to upb_parse must be the first byte after buf + *read, even in - * the case that *read > len. */ + * the case that *read > len. + * + * TODO: see if we can provide the following guarantee efficiently: + * *read will always be >= len. */ upb_status_t upb_parse(struct upb_parse_state *s, void *buf, size_t len, size_t *read); -- cgit v1.2.3