12 OneOfMessage msg = OneOfMessage_init_zero;
18 fprintf(
stderr,
"Usage: encode_oneof [number]\n");
30 msg.which_values = OneOfMessage_first_tag;
31 msg.values.first = 999;
35 msg.which_values = OneOfMessage_second_tag;
36 strcpy(msg.values.second,
"abcd");
40 msg.which_values = OneOfMessage_third_tag;
41 msg.values.third.array_count = 5;
42 msg.values.third.array[0] = 1;
43 msg.values.third.array[1] = 2;
44 msg.values.third.array[2] = 3;
45 msg.values.third.array[3] = 4;
46 msg.values.third.array[4] = 5;
53 if (
pb_encode(&stream, OneOfMessage_fields, &msg))
size_t fwrite(const void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream)