summaryrefslogtreecommitdiff
path: root/src/upb_def.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-05-08 13:05:12 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-05-08 13:05:12 -0700
commitf74534b42ac9ac8b0ff496cb0da83f1201bbf8da (patch)
treecf20bb7160a6f37cecd5c2cb4222c03b88e4fcde /src/upb_def.h
parent4a99abba123fc1d2bef62778846a1f27b2012de0 (diff)
Decoder redesign in preparation for packed fields and start/endseq.
Diffstat (limited to 'src/upb_def.h')
-rw-r--r--src/upb_def.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/upb_def.h b/src/upb_def.h
index e19aeba..ba1c410 100644
--- a/src/upb_def.h
+++ b/src/upb_def.h
@@ -117,12 +117,14 @@ struct _upb_fielddef {
INLINE bool upb_issubmsgtype(upb_fieldtype_t type) {
return type == UPB_TYPE(GROUP) || type == UPB_TYPE(MESSAGE);
}
-INLINE bool upb_issubmsg(upb_fielddef *f) {
- return upb_issubmsgtype(f->type);
+INLINE bool upb_isstringtype(upb_fieldtype_t type) {
+ return type == UPB_TYPE(STRING) || type == UPB_TYPE(BYTES);
}
-INLINE bool upb_isstring(upb_fielddef *f) {
- return f->type == UPB_TYPE(STRING) || f->type == UPB_TYPE(BYTES);
+INLINE bool upb_isprimitivetype(upb_fieldtype_t type) {
+ return !upb_issubmsgtype(type) && !upb_isstringtype(type);
}
+INLINE bool upb_issubmsg(upb_fielddef *f) { return upb_issubmsgtype(f->type); }
+INLINE bool upb_isstring(upb_fielddef *f) { return upb_isstringtype(f->type); }
INLINE bool upb_isarray(upb_fielddef *f) {
return f->label == UPB_LABEL(REPEATED);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback