6#include "callbacks.pb.h"
11 char *str =
"Hello world!";
49 char *str[4] = {
"Hello world!",
"",
"Test",
"Test2"};
52 for (i = 0; i < 4; i++)
67 TestMessage testmessage = {{{
NULL}}};
76 testmessage.has_submsg =
true;
78 testmessage.submsg.int32value.funcs.encode = &
encode_int32;
84 if (!
pb_encode(&stream, TestMessage_fields, &testmessage))
bool encode_int32(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
bool encode_fixed64(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
bool encode_string(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
bool encode_fixed32(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
bool encode_repeatedstring(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
size_t fwrite(const void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream)
pb_field_iter_t pb_field_t
bool pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_iter_t *field)
bool pb_encode_varint(pb_ostream_t *stream, uint64_t value)
pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize)
bool pb_encode_fixed64(pb_ostream_t *stream, const void *value)
bool pb_encode_fixed32(pb_ostream_t *stream, const void *value)
bool pb_encode(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct)
bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size)
static size_t strlen(const char *s)
unsigned long long uint64_t
#define SET_BINARY_MODE(file)