summaryrefslogtreecommitdiff
path: root/src/upb_msg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_msg.h')
-rw-r--r--src/upb_msg.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/upb_msg.h b/src/upb_msg.h
index 6be9405..233e604 100644
--- a/src/upb_msg.h
+++ b/src/upb_msg.h
@@ -231,7 +231,7 @@ INLINE void upb_msg_unset(void *s, struct upb_msg_field *f)
((char*)s)[upb_isset_offset(f->field_index)] &= ~upb_isset_mask(f->field_index);
}
-INLINE bool upb_msg_is_set(void *s, struct upb_msg_field *f)
+INLINE bool upb_msg_isset(void *s, struct upb_msg_field *f)
{
return ((char*)s)[upb_isset_offset(f->field_index)] & upb_isset_mask(f->field_index);
}
@@ -262,6 +262,11 @@ INLINE union upb_value_ptr upb_msg_getptr(void *data, struct upb_msg_field *f) {
return p;
}
+/* Returns a a specific field in a message. */
+INLINE union upb_value upb_msg_get(void *data, struct upb_msg_field *f) {
+ return upb_deref(upb_msg_getptr(data, f), f->type);
+}
+
/* Memory management *********************************************************/
/* One important note about these memory management routines: they must be used
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback