X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fimpl.h;fp=src%2Ftypes%2Fimpl.h;h=11270fac8ba206f0021df62b3be87657c488af54;hp=0000000000000000000000000000000000000000;hb=5359ad5c181e5772f350fe1cba060cbed3a05b91;hpb=04a60b34fc18ea3a2638893eaf24514177692eeb diff --git a/src/types/impl.h b/src/types/impl.h new file mode 100644 index 0000000..11270fa --- /dev/null +++ b/src/types/impl.h @@ -0,0 +1,23 @@ +#ifndef _PSI_TYPES_IMPL_H +#define _PSI_TYPES_IMPL_H + +typedef struct impl { + impl_func *func; + impl_stmts *stmts; + decl *decl; +} impl; + +static inline impl *init_impl(impl_func *func, impl_stmts *stmts) { + impl *i = calloc(1, sizeof(*i)); + i->func = func; + i->stmts = stmts; + return i; +} + +static inline void free_impl(impl *impl) { + free_impl_func(impl->func); + free_impl_stmts(impl->stmts); + free(impl); +} + +#endif