diff options
author | Josh Haberman <jhaberman@gmail.com> | 2011-03-26 18:14:01 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2011-03-26 18:14:01 -0700 |
commit | 2c86e7eddb23c92cc83391c3f751c72237ec3759 (patch) | |
tree | bd2960efa1a9ca00c58ba5356f797d05ee55e336 /src/upb_stream.h | |
parent | 484809c272df7b1f05e56d09f6a5e8e0f340cac4 (diff) |
Small semantics changes in the decoder.
Simplified some of the semantics around
the decoder's data structures, in anticipation
of sharing them between the regular C decoder
and a JIT-ted decoder.
Diffstat (limited to 'src/upb_stream.h')
-rw-r--r-- | src/upb_stream.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/upb_stream.h b/src/upb_stream.h index 783f6c8..0c75acd 100644 --- a/src/upb_stream.h +++ b/src/upb_stream.h @@ -280,7 +280,9 @@ upb_handlers_fieldent *upb_handlers_lookup(upb_inttable *dispatch_table, upb_fie typedef struct { upb_handlers_fieldent *f; void *closure; - size_t end_offset; // For groups, 0. + // Relative to the beginning of this buffer. + // For groups and the top-level: UINT32_MAX. + uint32_t end_offset; } upb_dispatcher_frame; typedef struct { @@ -322,11 +324,11 @@ INLINE bool upb_dispatcher_noframe(upb_dispatcher *d) { typedef upb_handlers_fieldent upb_dispatcher_field; -void upb_dispatcher_init(upb_dispatcher *d, upb_handlers *h, size_t top_end_offset); -void upb_dispatcher_reset(upb_dispatcher *d); +void upb_dispatcher_init(upb_dispatcher *d, upb_handlers *h); +void upb_dispatcher_reset(upb_dispatcher *d, void *top_closure, uint32_t top_end_offset); void upb_dispatcher_uninit(upb_dispatcher *d); -upb_flow_t upb_dispatch_startmsg(upb_dispatcher *d, void *closure); +upb_flow_t upb_dispatch_startmsg(upb_dispatcher *d); void upb_dispatch_endmsg(upb_dispatcher *d, upb_status *status); // Looks up a field by number for the current message. |