summaryrefslogtreecommitdiff
path: root/upb/json
diff options
context:
space:
mode:
authorChris Fallin <cfallin@c1f.net>2015-01-14 11:18:20 -0800
committerChris Fallin <cfallin@c1f.net>2015-01-14 11:18:20 -0800
commit87a18f37743efde6f66f77209c98400cdec67cbe (patch)
treefcbab052ead901543a135a15e25fee36189b15bd /upb/json
parentbebdc009b484295f06185b5bab884a3754bbbacd (diff)
Support oneof defs in upb.
This change adds support for a OneofDef (upb_oneofdef), which represents a 'oneof' as introduced by Protocol Buffers. This is semantically a union type that contains fields and in turn may be added to a MessageDef. This change does not alter parsing or the handler abstraction in any way, because a oneof has impact only at a higher semantic level (i.e., any sort of storage of the fields in a message object), which is user-specific with respect to upb.
Diffstat (limited to 'upb/json')
-rw-r--r--upb/json/printer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/upb/json/printer.c b/upb/json/printer.c
index b996ccf..3dd3c20 100644
--- a/upb/json/printer.c
+++ b/upb/json/printer.c
@@ -437,9 +437,9 @@ void printer_sethandlers(const void *closure, upb_handlers *h) {
} \
break;
- upb_msg_iter i;
- upb_msg_begin(&i, upb_handlers_msgdef(h));
- for(; !upb_msg_done(&i); upb_msg_next(&i)) {
+ upb_msg_field_iter i;
+ upb_msg_field_begin(&i, upb_handlers_msgdef(h));
+ for(; !upb_msg_field_done(&i); upb_msg_field_next(&i)) {
const upb_fielddef *f = upb_msg_iter_field(&i);
upb_handlerattr name_attr = UPB_HANDLERATTR_INITIALIZER;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback