1 #ifndef _PSI_TYPES_DECL_TYPE_H
2 #define _PSI_TYPES_DECL_TYPE_H
4 #include "parser_proc.h"
6 typedef struct decl_type
{
7 struct psi_token
*token
;
12 struct decl_struct
*strct
;
13 struct decl_union
*unn
;
14 struct decl_enum
*enm
;
19 static inline decl_type
*init_decl_type(token_t type
, const char *name
) {
20 decl_type
*t
= calloc(1, sizeof(*t
));
22 t
->name
= strdup(name
);
26 static inline void free_decl(struct decl
*decl
);
27 static inline void free_decl_type(decl_type
*type
) {
31 if (type
->type
== PSI_T_FUNCTION
) {
32 free_decl(type
->real
.func
);