summaryrefslogtreecommitdiff
path: root/src/upb_parse.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_parse.h')
-rw-r--r--src/upb_parse.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/upb_parse.h b/src/upb_parse.h
index df26089..1dc4b4c 100644
--- a/src/upb_parse.h
+++ b/src/upb_parse.h
@@ -27,9 +27,11 @@ extern "C" {
// client should determine whether it wants to parse or skip the corresponding
// value. If it wants to parse it, it must discover and return the correct
// .proto type (the tag only contains the wire type) and check that the wire
-// type is appropriate for the .proto type. To skip the value (which means
-// skipping all submessages, in the case of a submessage), the callback should
-// return zero.
+// type is appropriate for the .proto type. Returning a type for which
+// upb_check_type(tag->wire_type, type) == false invokes undefined behavior.
+//
+// To skip the value (which means skipping all submessages, in the case of a
+// submessage), the callback should return zero.
//
// The client can store a void* in *user_field_desc; this will be passed to
// the value callback or the string callback.
@@ -67,6 +69,9 @@ void upb_cbparser_free(struct upb_cbparser *p);
// Resets the internal state of an already-allocated parser. Parsers must be
// reset before they can be used. A parser can be reset multiple times. udata
// will be passed as the first argument to callbacks.
+//
+// tagcb must be set, but all other callbacks can be NULL, in which case they
+// will just be skipped.
void upb_cbparser_reset(struct upb_cbparser *p, void *udata,
upb_tag_cb tagcb,
upb_value_cb valuecb,
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback