diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-07-22 19:49:53 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-07-22 19:49:53 -0700 |
commit | ee1ed1ccb87effa403dc91603d452d4c98ed716f (patch) | |
tree | e1ee8c1b38d9351d4d3494c5e45b91b288f3a081 /src/upb_msg.h | |
parent | e4e89247e5f7548b5ebdb9a667657cdcb3feb17f (diff) |
Compiler finally works (except string arrays). Untested. Holy crap that was a lot of work.
Diffstat (limited to 'src/upb_msg.h')
-rw-r--r-- | src/upb_msg.h | 7 |
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 |