X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Flet_callback.h;fp=src%2Ftypes%2Flet_callback.h;h=0653b3d91f77684e96e42b577ef76a7a06ef7737;hp=0000000000000000000000000000000000000000;hb=5359ad5c181e5772f350fe1cba060cbed3a05b91;hpb=04a60b34fc18ea3a2638893eaf24514177692eeb diff --git a/src/types/let_callback.h b/src/types/let_callback.h new file mode 100644 index 0000000..0653b3d --- /dev/null +++ b/src/types/let_callback.h @@ -0,0 +1,26 @@ +#ifndef _PSI_TYPES_LET_CALLBACK_H +#define _PSI_TYPES_LET_CALLBACK_H + +typedef struct let_callback { + struct let_func *func; + struct set_values *args; + decl *decl; +} let_callback; + +static inline void free_let_func(struct let_func *func); +static inline void free_set_values(struct set_values *vals); +static inline let_callback *init_let_callback(struct let_func *func, struct set_values *args) { + let_callback *cb = calloc(1, sizeof(*cb)); + + cb->func = func; + cb->args = args; + return cb; +} + +static inline void free_let_callback(let_callback *cb) { + free_let_func(cb->func); + free_set_values(cb->args); + free(cb); +} + +#endif