struct ProtobufCMessage {
const ProtobufCMessageDescriptor */;
-----------------
struct ProtobufCMessageDescriptor {
ProtobufCMessageInit message_init;
const ProtobufCFieldDescriptor *fields;
uint32_t magic;
const char *name;
----------------------
struct ProtobufCFieldDescriptor
--------------------------------------------
const ProtobufCMessageDescriptor vpi__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"vpi",
"Vpi",
"Vpi",
"",
sizeof(Vpi),
4,
vpi__field_descriptors,
vpi__field_indices_by_name,
1, vpi__number_ranges,
(ProtobufCMessageInit) vpi__init,
NULL,NULL,NULL /* reserved[123] */
};
static const Vpi init_value = VPI__INIT;
*message = init_value;
}
#define ETHERNET__INIT \
{ PROTOBUF_C_MESSAGE_INIT (ðernet__descriptor) \
, 0, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
#define PROTOBUF_C_MESSAGE_INIT(descriptor) { descriptor, 0, NULL }
--------------------------------------------
protobuf_c_message_init(const ProtobufCMessageDescriptor * descriptor, void *message){
descriptor->message_init((ProtobufCMessage *) (message));
}
沒有留言:
張貼留言