From 563325435753fae01d2b45cceba8b9d14c8a7aad Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 10 Jun 2010 09:14:31 -0700 Subject: Implement proper type checking again. --- src/upb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/upb.h') 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; -- cgit v1.2.3