summaryrefslogtreecommitdiff
path: root/src/upb_msg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_msg.h')
-rw-r--r--src/upb_msg.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/upb_msg.h b/src/upb_msg.h
index 8910505..ef49776 100644
--- a/src/upb_msg.h
+++ b/src/upb_msg.h
@@ -159,11 +159,19 @@ INLINE struct google_protobuf_FieldDescriptorProto *upb_msg_field_descriptor(
return m->field_descriptors[f->field_index];
}
-/* Initializes/frees a upb_msg. Caller retains ownership of d, but the msg
- * will contain references to it, so it must outlive the msg. Note that init
- * does not resolve upb_msg_field.ref -- the caller should do that
- * post-initialization by calling upb_msg_ref() below. */
-bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d);
+/* Initializes/frees a upb_msg. Usually this will be called by upb_context, and
+ * clients will not have to construct one directly.
+ *
+ * Caller retains ownership of d, but the msg will contain references to it, so
+ * it must outlive the msg. Note that init does not resolve upb_msg_field.ref
+ * the caller should do that post-initialization by calling upb_msg_ref()
+ * below.
+ *
+ * sort indicates whether or not it is safe to reorder the fields from the order
+ * they appear in d. This should be false if code has been compiled against a
+ * header for this type that expects the given order. */
+bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d,
+ bool sort);
void upb_msg_free(struct upb_msg *m);
/* Clients use this function on a previously initialized upb_msg to resolve the
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback