diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-06-09 15:55:02 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-06-09 15:55:02 -0700 |
commit | 992a03be55faf83d794b9ec5e8c4ca7e78c08a9b (patch) | |
tree | 4c3b895b4e8e9808c3ec0e5215b227ef789e8466 /src/upb.h | |
parent | ed991c3b300d65dbe6fdb6a1d110cec029b0f5be (diff) |
More decoder work, first attempts at compiling it.
Diffstat (limited to 'src/upb.h')
-rw-r--r-- | src/upb.h | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -94,24 +94,6 @@ INLINE bool upb_isstringtype(upb_field_type_t type) { return type == UPB_TYPE(STRING) || type == UPB_TYPE(BYTES); } -// Info for a given field type. -typedef struct { - uint8_t align; - uint8_t size; - // A bit-field indicating whether each wire type is allowed. - uint8_t allowed_wire_types; - char *ctype; -} upb_type_info; - -// A static array of info about all of the field types, indexed by type number. -extern upb_type_info upb_types[]; - -// Returns true if wt is the correct on-the-wire type for ft. -INLINE bool upb_check_type(upb_wire_type_t wt, upb_field_type_t ft) { - // This doesn't currently support packed arrays. - return upb_types[ft] & (1 << wt); -} - // The number of a field, eg. "optional string foo = 3". typedef int32_t upb_field_number_t; @@ -127,14 +109,6 @@ typedef union { uint32_t _32bit; } upb_wire_value; -// A key occurs before each value on-the-wire. -typedef uint32_t upb_key; -INLINE upb_key upb_make_key(upb_fieldnum_t fieldnum, upb_wiretype_t wiretype) { - return (fieldnum << 3) | wiretype; -} -INLINE upb_fieldnum_t upb_key_fieldnum(upb_key key) { return key >> 3; } -INLINE upb_wiretype_t upb_key_wiretype(upb_key key) { return key & 0x07; } - /* Polymorphic values of .proto types *****************************************/ // INTERNAL-ONLY: never refer to these types with a tag ("union", "struct"). |