summaryrefslogtreecommitdiff
path: root/upb_msg.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-06-28 12:35:08 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-06-28 12:35:08 -0700
commit01fb1d45ed26068bcb32a2dbf4ba8e56e65475e9 (patch)
tree281feaa12d3bc024bfdf7542e5b30ca04d8ff4b9 /upb_msg.h
parent1139650320e764b6ba3582174a13babaa88fb1a1 (diff)
Stubbed out a few more methods in _msg and _context.
Diffstat (limited to 'upb_msg.h')
-rw-r--r--upb_msg.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/upb_msg.h b/upb_msg.h
index 78fd2ce..70d4405 100644
--- a/upb_msg.h
+++ b/upb_msg.h
@@ -107,6 +107,13 @@ INLINE struct upb_msg_field *upb_get_msg_field(
bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d);
void upb_msg_free(struct upb_msg *m);
+/* Clients use this function on a previously initialized upb_msg to resolve the
+ * "ref" field in the upb_msg_field and upb_abbrev_msg_field. Since messages
+ * can refer to each other in mutually-recursive ways, this step must be
+ * separated from initialization. The function is necessary because there are
+ * multiple internal maps in which the ref appears. */
+void upb_msg_ref(struct upb_msg *m, struct upb_msg_field *f, union upb_symbol_ref ref);
+
/* While these are written to be as fast as possible, it will still be faster
* to cache the results of this lookup if possible. These return NULL if no
* such field is found. */
@@ -272,6 +279,13 @@ INLINE void upb_msg_clear(void *s, struct upb_msg *m)
memset(s, 0, m->set_flags_bytes);
}
+/* Serialization/Deserialization. ********************************************/
+
+/* Parses the string data in s according to the message description in m.
+ * Returns a newly allocated message which is now owned by the caller, or
+ * NULL if there was an error parsing the string. */
+void *upb_msg_parse(struct upb_msg *m, struct upb_string *s);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback