星期二, 9月 22, 2020

ProtobufCMessage

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] */

};

--------------------------------------------
void   vpi__init    (Vpi         *message){

  static const Vpi init_value = VPI__INIT;

  *message = init_value;

}

--------------------------------------------

#define ETHERNET__INIT \

 { PROTOBUF_C_MESSAGE_INIT (&ethernet__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));

}




星期二, 9月 01, 2020

Yocto

 Yocto基本概念及介紹