13MyMessage_NumbersEntry *
find_entry(MyMessage *msg,
const char *key)
16 for (i = 0; i < msg->numbers_count; i++)
18 if (
strcmp(msg->numbers[i].key, key) == 0)
20 return &msg->numbers[i];
36 printf(
"Message does not fit in buffer\n");
42 MyMessage msg = MyMessage_init_zero;
43 MyMessage_NumbersEntry *e;
46 if (!
pb_decode(&stream, MyMessage_fields, &msg))
48 fprintf(
stderr,
"Decoding failed\n");
MyMessage_NumbersEntry * find_entry(MyMessage *msg, const char *key)
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 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)
#define SET_BINARY_MODE(file)