summaryrefslogtreecommitdiff
path: root/upb/sink.h
diff options
context:
space:
mode:
Diffstat (limited to 'upb/sink.h')
-rw-r--r--upb/sink.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/upb/sink.h b/upb/sink.h
index a50bafb..0b98f07 100644
--- a/upb/sink.h
+++ b/upb/sink.h
@@ -315,6 +315,18 @@ UPB_INLINE size_t upb_sink_putstring(upb_sink *s, upb_selector_t sel,
return handler(s->closure, hd, buf, n, handle);
}
+UPB_INLINE bool upb_sink_putunknown(upb_sink *s, const char *buf, size_t n) {
+ typedef upb_unknown_handlerfunc func;
+ func *handler;
+ const void *hd;
+ if (!s->handlers) return true;
+ handler = (func *)upb_handlers_gethandler(s->handlers, UPB_UNKNOWN_SELECTOR);
+
+ if (!handler) return n;
+ hd = upb_handlers_gethandlerdata(s->handlers, UPB_UNKNOWN_SELECTOR);
+ return handler(s->closure, hd, buf, n);
+}
+
UPB_INLINE bool upb_sink_startmsg(upb_sink *s) {
typedef upb_startmsg_handlerfunc func;
func *startmsg;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback