1 /* A very simple encoding test case using person.proto.
2 * Just puts constant data in the fields.
9 bool streamcallback(pb_ostream_t *stream, const uint8_t *buf, size_t count)
11 FILE *file = (FILE*) stream->state;
12 return fwrite(buf, 1, count, file) == count;
17 Person person = {"Test Person 99", 99, true, "test@person.com",
18 1, {{"555-12345678", true, Person_PhoneType_MOBILE}}};
20 pb_ostream_t stream = {&streamcallback, stdout, SIZE_MAX, 0};
22 pb_encode(&stream, Person_fields, &person);