diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-07-29 17:49:59 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-07-29 17:49:59 -0700 |
commit | 56984e8db8e1c43687535cc77fb6ce43df0b3d1f (patch) | |
tree | dc8c85d1311458a68408ff4c43d009b6193ac221 /upb/msg.h | |
parent | 92b4c38fa5f137cbcf835ad359bed8711c1c9c51 (diff) |
Significant work on Lua extension.
Also changes in core library to accommodate.
Diffstat (limited to 'upb/msg.h')
-rw-r--r-- | upb/msg.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |