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_decoder.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_decoder.h')
-rw-r--r-- | src/upb_decoder.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/upb_decoder.h b/src/upb_decoder.h index 32a989a..bb54930 100644 --- a/src/upb_decoder.h +++ b/src/upb_decoder.h @@ -34,8 +34,8 @@ struct _upb_decoder { // Dispatcher to which we push parsed data. upb_dispatcher dispatcher; - // Current input buffer. - upb_string *buf; + // String to hold our input buffer; is only active if d->buf != NULL. + upb_string *bufstr; // Temporary string for passing string data to callbacks. upb_string *tmp; @@ -43,18 +43,20 @@ struct _upb_decoder { // The offset within the overall stream represented by the *beginning* of buf. size_t buf_stream_offset; - // Our current position in the data buffer. - const char *ptr; + // Pointer to the beginning of our current data buffer, or NULL if none. + const char *buf; // End of this buffer, relative to *ptr. const char *end; + // Members which may also be written by the JIT: + + // Our current position in the data buffer. + const char *ptr; + // End of this submessage, relative to *ptr. const char *submsg_end; - // The closure that was passed by the caller for the top-level message. - void *closure; - // Where we will store any errors that occur. upb_status *status; }; |