6#include "missing_fields.pb.h"
15 MissingField msg = {0};
18 if (!
pb_encode(&stream, MissingField_fields, &msg))
20 printf(
"Encode failed.\n");
24 size = stream.bytes_written;
29 MissingField msg = {0};
32 if (!
pb_decode(&stream, MissingField_fields, &msg))
44 if (
pb_decode(&stream, AllFields_fields, &msg))
46 printf(
"Decode didn't detect missing field.\n");
#define PB_GET_ERROR(stream)
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)