summaryrefslogtreecommitdiff
path: root/src/upb.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-05-24 11:15:08 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-05-24 11:15:08 -0700
commit8c1e7170b74e1a6a29736f63507f83ddeb51f560 (patch)
tree728fae12fe9edab603b82c6fdc7fb0d5d4d81239 /src/upb.h
parentc615d11ce7dd2b7646af4918ffcd70329b99393b (diff)
Defined the upb_src and upb_bytesrc interfaces.
Diffstat (limited to 'src/upb.h')
-rw-r--r--src/upb.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/upb.h b/src/upb.h
index 4fb5773..c65a686 100644
--- a/src/upb.h
+++ b/src/upb.h
@@ -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 *****************************************/
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback