Mon, 01 Sep 2025 00:14:59 +0800
Initial Lexer/Parser
| 0 | 1 | #ifndef _TLVAST_H_ |
| 2 | #define _TLVAST_H_ | |
| 3 | ||
| 4 | #include <stddef.h> | |
| 5 | #include <sys/queue.h> | |
| 6 | ||
| 7 | enum tlv_ftype { | |
| 8 | TLV_TYPE_NONE, | |
| 9 | TLV_TYPE_STRING, | |
| 10 | TLV_TYPE_U8, | |
| 11 | TLV_TYPE_U16, | |
| 12 | TLV_TYPE_U32, | |
| 13 | TLV_TYPE_U64, | |
| 14 | }; | |
| 15 | ||
| 16 | struct tlv_field { | |
| 17 | enum tlv_ftype type; | |
| 18 | char *name; | |
| 19 | int tag; | |
| 20 | TAILQ_ENTRY(tlv_field) entries; | |
| 21 | }; | |
| 22 | ||
| 23 | TAILQ_HEAD(tlv_field_list_head, tlv_field); | |
| 24 | ||
| 25 | struct tlv { | |
| 26 | char *name; | |
| 27 | int tag; | |
| 28 | TAILQ_HEAD(fields_head, tlv_field) fields; | |
| 29 | TAILQ_ENTRY(tlv) entries; | |
| 30 | }; | |
| 31 | ||
| 32 | TAILQ_HEAD(tlv_list_head, tlv); | |
| 33 | ||
| 34 | extern struct tlv_list_head g_tlvs; | |
| 35 | ||
| 36 | #endif /* _TLBAST_H_ */ |