summaryrefslogtreecommitdiff
path: root/upb/msg.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-07-29 17:49:59 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-07-29 17:49:59 -0700
commit56984e8db8e1c43687535cc77fb6ce43df0b3d1f (patch)
treedc8c85d1311458a68408ff4c43d009b6193ac221 /upb/msg.h
parent92b4c38fa5f137cbcf835ad359bed8711c1c9c51 (diff)
Significant work on Lua extension.
Also changes in core library to accommodate.
Diffstat (limited to 'upb/msg.h')
-rw-r--r--upb/msg.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/upb/msg.h b/upb/msg.h
index 625d805..ac9e877 100644
--- a/upb/msg.h
+++ b/upb/msg.h
@@ -92,12 +92,17 @@ INLINE bool upb_msg_has(void *m, upb_fielddef *f) {
return f->accessor && f->accessor->has(m, f->fval);
}
-// May only be called for fields that are known to be set.
+// May only be called for fields that have accessors.
INLINE upb_value upb_msg_get(void *m, upb_fielddef *f) {
- assert(upb_msg_has(m, f));
+ assert(f->accessor);
return f->accessor->get(m, f->fval);
}
+INLINE void upb_msg_set(void *m, upb_fielddef *f, upb_value val) {
+ assert(f->accessor);
+ f->accessor->set(m, f->fval, val);
+}
+
INLINE void *upb_seq_begin(void *s, upb_fielddef *f) {
assert(f->accessor);
return f->accessor->seqbegin(s);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback