8#include "alltypes.pb.h"
63 for (i = 0; i < msglen; i++)
65 stream.bytes_left = msglen;
73 fprintf(
stderr,
"Unexpected success in decode\n");
76 else if (
strcmp(stream.errmsg,
"simulated") != 0)
78 fprintf(
stderr,
"Wrong error in decode: %s\n", stream.errmsg);
83 stream.bytes_left = msglen;
91 fprintf(
stderr,
"Decoding failed: %s\n", stream.errmsg);
103 for (i = 0; i < msglen; i++)
105 stream.max_size = msglen;
106 stream.bytes_written = 0;
114 fprintf(
stderr,
"Unexpected success in encode\n");
117 else if (
strcmp(stream.errmsg,
"simulated") != 0)
119 fprintf(
stderr,
"Wrong error in encode: %s\n", stream.errmsg);
124 stream.max_size = msglen;
125 stream.bytes_written = 0;
133 fprintf(
stderr,
"Encoding failed: %s\n", stream.errmsg);
#define AllTypes_init_zero
MOSAPI s32 strcmp(const char *str1, const char *str2)
size_t fread(void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream)
bool write_callback(pb_ostream_t *stream, const uint8_t *buf, size_t count)
bool read_callback(pb_istream_t *stream, uint8_t *buf, size_t count)
#define PB_RETURN_ERROR(stream, msg)
bool pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct)
bool pb_encode(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct)
#define SET_BINARY_MODE(file)