api refactoring
[m6w6/ext-psi] / src / types / impl_type.h
1 #ifndef _PSI_TYPES_IMPL_TYPE_H
2 #define _PSI_TYPES_IMPL_TYPE_H
3
4 typedef struct impl_type {
5 char *name;
6 token_t type;
7 } impl_type;
8
9 static inline impl_type *init_impl_type(token_t type, const char *name) {
10 impl_type *t = calloc(1, sizeof(*t));
11
12 t->type = type;
13 t->name = strdup(name);
14 return t;
15 }
16
17 static inline void free_impl_type(impl_type *type) {
18 free(type->name);
19 free(type);
20 }
21
22 #endif