api refactoring
[m6w6/ext-psi] / src / types / impl.h
1 #ifndef _PSI_TYPES_IMPL_H
2 #define _PSI_TYPES_IMPL_H
3
4 typedef struct impl {
5 impl_func *func;
6 impl_stmts *stmts;
7 decl *decl;
8 } impl;
9
10 static inline impl *init_impl(impl_func *func, impl_stmts *stmts) {
11 impl *i = calloc(1, sizeof(*i));
12 i->func = func;
13 i->stmts = stmts;
14 return i;
15 }
16
17 static inline void free_impl(impl *impl) {
18 free_impl_func(impl->func);
19 free_impl_stmts(impl->stmts);
20 free(impl);
21 }
22
23 #endif