tlvast.h

Mon, 01 Sep 2025 00:14:59 +0800

author
Gong Zhile <gongzl@stu.hebust.edu.cn>
date
Mon, 01 Sep 2025 00:14:59 +0800
changeset 0
59c92fa19678
permissions
-rw-r--r--

Initial Lexer/Parser

#ifndef _TLVAST_H_
#define _TLVAST_H_

#include <stddef.h>
#include <sys/queue.h>

enum tlv_ftype {
	TLV_TYPE_NONE,
	TLV_TYPE_STRING,
	TLV_TYPE_U8,
	TLV_TYPE_U16,
	TLV_TYPE_U32,
	TLV_TYPE_U64,
};

struct tlv_field {
	enum tlv_ftype	 type;
	char		*name;
	int		 tag;
	TAILQ_ENTRY(tlv_field) entries;
};

TAILQ_HEAD(tlv_field_list_head, tlv_field);

struct tlv {
	char			*name;
	int			 tag;
        TAILQ_HEAD(fields_head, tlv_field) fields;
        TAILQ_ENTRY(tlv) entries;
};

TAILQ_HEAD(tlv_list_head, tlv);

extern struct tlv_list_head g_tlvs;

#endif	/* _TLBAST_H_ */

mercurial