7#include "msgid_example.pb.h"
27 MyMessage1 msg = MyMessage1_init_default;
30 &&
pb_encode(stream, MyMessage1_fields, &msg);
35 MyMessage2 msg = MyMessage2_init_default;
37 strcpy(msg.strvalue,
"Msg2");
39 &&
pb_encode(stream, MyMessage2_fields, &msg);
44 MyMessage3 msg = MyMessage3_init_default;
47 &&
pb_encode(stream, MyMessage3_fields, &msg);
59 fprintf(
stderr,
"Usage: encode_msgid [number]\n");
bool write_prefix(pb_ostream_t *stream, int msgid)
bool encode_MyMessage3(pb_ostream_t *stream)
bool encode_MyMessage2(pb_ostream_t *stream)
bool encode_MyMessage1(pb_ostream_t *stream)
MOSAPI char * strcpy(char *__restrict dest, const char *__restrict src)
size_t fwrite(const void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream)
MOSAPI s32 atoi(const char *nptr)
#define PB_GET_ERROR(stream)
bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count)
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)
#define SET_BINARY_MODE(file)