Hello guys,
Can someone explain me what's going on in
static const struct tlv_definition xyz_att_tlvdef?
I haven't seen this style of programming before, can someone provide me a link where such technique is explained? And what is the advantage of this style?Code://-------- .h file enum tlv_type { TLV_TYPE_FIXED, TLV_TYPE_T, TLV_TYPE_TV, TLV_TYPE_TLV, TLV_TYPE_TL16V, }; struct tlv_def { enum tlv_type type; u_int8_t fixed_len; }; //-------- .c file static const struct tlv_definition xyz_att_tlvdef = { .def = { [MOBILE_ID] = { TLV_TYPE_TLV }, [NAME_LONG] = { TLV_TYPE_TLV }, [NAME_SHORT] = { TLV_TYPE_TLV }, [UTC] = { TLV_TYPE_TV }, [NET_TIME_TZ] = { TLV_TYPE_FIXED, 7 }, [LSA_IDENT] = { TLV_TYPE_TLV }, }, };
Thank you.Code:static const char *lm_cause_names[] = { [CAUSE_NORMAL] = "Normal event", [CAUSE_ABNORMAL_UNSPEC] = "Abnormal release, unspecified", [CAUSE_ABNORMAL_UNACCT] = "Abnormal release, channel unacceptable", [CAUSE_ABNORMAL_TIMER] = "Abnormal release, timer expired", [CAUSE_ABNORMAL_NOACT] = "Abnormal release, no activity on radio path", [CAUSE_PREMPTIVE_REL] = "Preemptive release", };



LinkBack URL
About LinkBacks



