X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Fimpl_type.h;fp=src%2Ftypes%2Fimpl_type.h;h=9f7e89419d2672b83923667861045053d7d75c66;hb=5359ad5c181e5772f350fe1cba060cbed3a05b91;hp=0000000000000000000000000000000000000000;hpb=04a60b34fc18ea3a2638893eaf24514177692eeb;p=m6w6%2Fext-psi diff --git a/src/types/impl_type.h b/src/types/impl_type.h new file mode 100644 index 0000000..9f7e894 --- /dev/null +++ b/src/types/impl_type.h @@ -0,0 +1,22 @@ +#ifndef _PSI_TYPES_IMPL_TYPE_H +#define _PSI_TYPES_IMPL_TYPE_H + +typedef struct impl_type { + char *name; + token_t type; +} impl_type; + +static inline impl_type *init_impl_type(token_t type, const char *name) { + impl_type *t = calloc(1, sizeof(*t)); + + t->type = type; + t->name = strdup(name); + return t; +} + +static inline void free_impl_type(impl_type *type) { + free(type->name); + free(type); +} + +#endif