diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-08-01 23:06:22 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-08-01 23:06:22 -0700 |
commit | e8c58eb78dbd7fc161a82da321dad028a0acbb3d (patch) | |
tree | b7c1a8b0b0d76ab2236dc7eb961f1af5095b10ef /src/upb_parse.h | |
parent | a952e42e996fcab8f13e48d0078c0e95a4d507d9 (diff) |
Sketches of serialization.
Diffstat (limited to 'src/upb_parse.h')
-rw-r--r-- | src/upb_parse.h | 9 |
1 files changed, 7 insertions, 2 deletions
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); |