X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Fdecl_abi.h;fp=src%2Ftypes%2Fdecl_abi.h;h=48731a3d2632d705dced4311734e7167c865dc9e;hb=5359ad5c181e5772f350fe1cba060cbed3a05b91;hp=0000000000000000000000000000000000000000;hpb=04a60b34fc18ea3a2638893eaf24514177692eeb;p=m6w6%2Fext-psi diff --git a/src/types/decl_abi.h b/src/types/decl_abi.h new file mode 100644 index 0000000..48731a3 --- /dev/null +++ b/src/types/decl_abi.h @@ -0,0 +1,23 @@ +#ifndef _PSI_TYPES_DECL_ABI_H +#define _PSI_TYPES_DECL_ABI_H + +typedef struct decl_abi { + struct psi_token *token; + char *convention; +} decl_abi; + +static inline decl_abi *init_decl_abi(const char *convention) { + decl_abi *abi = calloc(1, sizeof(*abi)); + abi->convention = strdup(convention); + return abi; +} + +static inline void free_decl_abi(decl_abi *abi) { + if (abi->token) { + free(abi->token); + } + free(abi->convention); + free(abi); +} + +#endif