From 5235966ed5f369969c6ba0a558453ff22097a722 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 6 Jul 2009 13:34:40 -0700 Subject: Lots of documentation, cleanup, and fixed memory leaks. --- upb_parse.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'upb_parse.h') 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; -- cgit v1.2.3