diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-05-24 11:15:08 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-05-24 11:15:08 -0700 |
commit | 8c1e7170b74e1a6a29736f63507f83ddeb51f560 (patch) | |
tree | 728fae12fe9edab603b82c6fdc7fb0d5d4d81239 /src/upb.h | |
parent | c615d11ce7dd2b7646af4918ffcd70329b99393b (diff) |
Defined the upb_src and upb_bytesrc interfaces.
Diffstat (limited to 'src/upb.h')
-rw-r--r-- | src/upb.h | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -116,12 +116,13 @@ typedef union { uint32_t _32bit; } upb_wire_value; -// A tag occurs before each value on-the-wire. -typedef struct { - upb_field_number_t field_number; - upb_wire_type_t wire_type; -} upb_tag; - +// 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 *****************************************/ |