11 size_t len =
fread(buf, 1, count, file);
19 stream->bytes_left = 0;
27 MyMessage msg = MyMessage_init_default;
34 status =
pb_decode(&stream, MyMessage_fields, &msg);
36 assert(
strcmp(stream.errmsg,
"realloc failed") == 0);
bool stream_callback(pb_istream_t *stream, uint8_t *buf, size_t count)
MOSAPI s32 strcmp(const char *str1, const char *str2)
size_t fread(void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream)
void set_max_alloc_bytes(size_t max_bytes)
bool pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct)
#define SET_BINARY_MODE(file)