From 01fb1d45ed26068bcb32a2dbf4ba8e56e65475e9 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 28 Jun 2009 12:35:08 -0700 Subject: Stubbed out a few more methods in _msg and _context. --- upb_msg.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'upb_msg.h') 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 -- cgit v1.2.3