diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-11-23 16:19:22 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-11-23 16:19:22 -0800 |
commit | b5f5ee867e6c91b77490dc8894236f17a47bde00 (patch) | |
tree | bb11d1e7881d27dfbcb8cef895be53812c57132e /upb/handlers.h | |
parent | 99ae0ed39723b9c8f97fbdde070681e2a8b7a20e (diff) |
Refinement of upb_bytesrc interface.
Added a upb_byteregion that tracks a region of
the input buffer; decoders use this instead of
using a upb_bytesrc directly. upb_byteregion
is also used as the way of passing a string to
a upb_handlers callback. This symmetry makes
decoders compose better; if you want to take
a parsed string and decode it as something else,
you can take the string directly from the callback
and feed it as input to another parser.
A commented-out version of a pinning interface
is present; I decline to actually implement it
(and accept its extra complexity) until/unless
it is clear that it is actually a win. But it
is included as a proof-of-concept, to show that
it fits well with the existing interface.
Diffstat (limited to 'upb/handlers.h')
-rw-r--r-- | upb/handlers.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/upb/handlers.h b/upb/handlers.h index 2945d8c..e17a726 100644 --- a/upb/handlers.h +++ b/upb/handlers.h @@ -324,13 +324,13 @@ typedef struct { uint16_t fieldindex; bool is_sequence; // frame represents seq or submsg? (f might be both). - bool is_packed; // !upb_issubmsg(f) && end_ofs != UINT64_MAX (strings aren't pushed) + bool is_packed; // !upb_issubmsg(f) && end_ofs != UINT64_MAX + // (strings aren't pushed). } upb_dispatcher_frame; -// Called when some of the input needs to be skipped. All frames from -// top to bottom, inclusive, should be skipped. -typedef void upb_skip_handler(void *, upb_dispatcher_frame *top, - upb_dispatcher_frame *bottom); +// Called when some of the input needs to be skipped. All frames from the +// current top to "bottom", inclusive, should be skipped. +typedef void upb_skip_handler(void *, upb_dispatcher_frame *bottom); typedef void upb_exit_handler(void *); typedef struct { |