summaryrefslogtreecommitdiff
path: root/src/upb.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-06-10 09:14:31 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-06-10 09:14:31 -0700
commit563325435753fae01d2b45cceba8b9d14c8a7aad (patch)
treef4ce7aab922308d0f2f6a2d7cb742e76b3b791d3 /src/upb.h
parent5743636ad19eafb11eddeefd29f2803052dadff2 (diff)
Implement proper type checking again.
Diffstat (limited to 'src/upb.h')
-rw-r--r--src/upb.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/upb.h b/src/upb.h
index 1681763..6bf548c 100644
--- a/src/upb.h
+++ b/src/upb.h
@@ -98,6 +98,18 @@ 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;
+ upb_wire_type_t native_wire_type;
+ uint8_t allowed_wire_types; // For packable fields, also allows delimited.
+ 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[];
+
// The number of a field, eg. "optional string foo = 3".
typedef int32_t upb_field_number_t;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback