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