diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-06-10 09:14:31 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-06-10 09:14:31 -0700 |
commit | 563325435753fae01d2b45cceba8b9d14c8a7aad (patch) | |
tree | f4ce7aab922308d0f2f6a2d7cb742e76b3b791d3 /src/upb.h | |
parent | 5743636ad19eafb11eddeefd29f2803052dadff2 (diff) |
Implement proper type checking again.
Diffstat (limited to 'src/upb.h')
-rw-r--r-- | src/upb.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |