message Success {
required int32 int1st = 1;
optional int32 int2nd = 2;
optional float float1st = 3;
optional float float2nd = 4;
extensions 10 to 100;
}
extend Success {
optional int32 newValue = 10 [default=1];
}
The question is - how to set up or read the newValue field in C ? Just can't find it in help
One more question - in callbacks example user's callback functions defined for each field. But it's really necessary? I mean if i have one repeated field in my message, can i define just one custom encode function? And as i see callback function must call two encoding functions - for tag and for value. So, if i want to encode in my repeated field for example 5 values then that field will looks like stream with structure: field tag, value 1, field tag, value 2... ?
pb_encode_tag(...);
pb_encode_varint(stream, sizeof(fieldtype)*n);
for(i = 0; i<n; i++) {
pb_encode_varint(stream, value[i]);
}