summaryrefslogtreecommitdiff
path: root/src/upb.h
diff options
context:
space:
mode:
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