From abfc897b50532e5ed64f7f5497f80ef56abd3b26 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 24 Feb 2011 00:09:27 -0800 Subject: Pass the upb_fielddef* to the endmsg callback. --- src/upb_stream_vtbl.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/upb_stream_vtbl.h') diff --git a/src/upb_stream_vtbl.h b/src/upb_stream_vtbl.h index 10ee917..e9a4043 100644 --- a/src/upb_stream_vtbl.h +++ b/src/upb_stream_vtbl.h @@ -186,6 +186,12 @@ INLINE upb_flow_t upb_startsubmsg_nop(void *closure, struct _upb_fielddef *f, return UPB_CONTINUE; } +INLINE upb_flow_t upb_endsubmsg_nop(void *closure, struct _upb_fielddef *f) { + (void)closure; + (void)f; + return UPB_CONTINUE; +} + INLINE upb_flow_t upb_unknownval_nop(void *closure, upb_field_number_t fieldnum, upb_value val) { (void)closure; @@ -199,7 +205,7 @@ INLINE void upb_register_handlerset(upb_handlers *h, upb_handlerset *set) { if (!set->endmsg) set->endmsg = &upb_nop; if (!set->value) set->value = &upb_value_nop; if (!set->startsubmsg) set->startsubmsg = &upb_startsubmsg_nop; - if (!set->endsubmsg) set->endsubmsg = &upb_nop; + if (!set->endsubmsg) set->endsubmsg = &upb_endsubmsg_nop; if (!set->unknownval) set->unknownval = &upb_unknownval_nop; h->set = set; } @@ -264,7 +270,8 @@ INLINE upb_flow_t upb_dispatch_startsubmsg(upb_dispatcher *d, return ret; } -INLINE upb_flow_t upb_dispatch_endsubmsg(upb_dispatcher *d) { +INLINE upb_flow_t upb_dispatch_endsubmsg(upb_dispatcher *d, + struct _upb_fielddef *f) { upb_flow_t ret; if (--d->top->depth == 0) { ret = d->top->handlers.set->endmsg(d->top->handlers.closure); @@ -273,7 +280,7 @@ INLINE upb_flow_t upb_dispatch_endsubmsg(upb_dispatcher *d) { --d->top; assert(d->top >= d->stack); } - return d->top->handlers.set->endsubmsg(d->top->handlers.closure); + return d->top->handlers.set->endsubmsg(d->top->handlers.closure, f); } INLINE upb_flow_t upb_dispatch_value(upb_dispatcher *d, -- cgit v1.2.3