From 2c86e7eddb23c92cc83391c3f751c72237ec3759 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Sat, 26 Mar 2011 18:14:01 -0700 Subject: 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. --- src/upb_stream.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/upb_stream.h') 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. -- cgit v1.2.3