1#include "submsg_callback.pb.h"
15 if (submsg->foo != 1234)
29 MyMessage msg = MyMessage_init_zero;
31 msg.which_oneof = MyMessage_submsg_tag;
32 msg.oneof.submsg.foo = 1234;
34 if (!
pb_encode(&ostream, MyMessage_fields, &msg))
40 msglen = ostream.bytes_written;
46 MyMessage msg = MyMessage_init_zero;
49 if (!
pb_decode(&istream, MyMessage_fields, &msg))
#define SubMessage_fields
#define PB_GET_ERROR(stream)
pb_field_iter_t pb_field_t
#define PB_RETURN_ERROR(stream, msg)
bool pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct)
pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t msglen)
pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize)
bool pb_encode(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct)
bool msg_callback(pb_istream_t *stream, const pb_field_t *field, void **arg)