diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-07-06 13:34:40 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-07-06 13:34:40 -0700 |
commit | 5235966ed5f369969c6ba0a558453ff22097a722 (patch) | |
tree | ad3d775531b264f65e78cb964c0cae2645a44178 /upb_parse.h | |
parent | dd2094537ad4316ddd42b10bca291f8d2e712de1 (diff) |
Lots of documentation, cleanup, and fixed memory leaks.
Diffstat (limited to 'upb_parse.h')
-rw-r--r-- | upb_parse.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/upb_parse.h b/upb_parse.h index 182cb9e..c5640f1 100644 --- a/upb_parse.h +++ b/upb_parse.h @@ -18,6 +18,33 @@ extern "C" { #endif +/* Definitions. ***************************************************************/ + +/* A list of types as they are encoded on-the-wire. */ +enum upb_wire_type { + UPB_WIRE_TYPE_VARINT = 0, + UPB_WIRE_TYPE_64BIT = 1, + UPB_WIRE_TYPE_DELIMITED = 2, + UPB_WIRE_TYPE_START_GROUP = 3, + UPB_WIRE_TYPE_END_GROUP = 4, + UPB_WIRE_TYPE_32BIT = 5 +}; +typedef uint8_t upb_wire_type_t; + +/* A value as it is encoded on-the-wire, except delimited, which is handled + * separately. */ +union upb_wire_value { + uint64_t varint; + uint64_t _64bit; + uint32_t _32bit; +}; + +/* A tag occurs before each value on-the-wire. */ +struct upb_tag { + upb_field_number_t field_number; + upb_wire_type_t wire_type; +}; + /* High-level parsing interface. **********************************************/ struct upb_parse_state; |