10 size_t message_length;
22 SimpleMessage message = SimpleMessage_init_zero;
28 message.lucky_number = 13;
31 status =
pb_encode(&stream, SimpleMessage_fields, &message);
32 message_length = stream.bytes_written;
50 SimpleMessage message = SimpleMessage_init_zero;
56 status =
pb_decode(&stream, SimpleMessage_fields, &message);
66 printf(
"Your lucky number was %d!\n", (
int)message.lucky_number);