api refactoring
[m6w6/ext-psi] / src / types / let_callback.h
1 #ifndef _PSI_TYPES_LET_CALLBACK_H
2 #define _PSI_TYPES_LET_CALLBACK_H
3
4 typedef struct let_callback {
5 struct let_func *func;
6 struct set_values *args;
7 decl *decl;
8 } let_callback;
9
10 static inline void free_let_func(struct let_func *func);
11 static inline void free_set_values(struct set_values *vals);
12 static inline let_callback *init_let_callback(struct let_func *func, struct set_values *args) {
13 let_callback *cb = calloc(1, sizeof(*cb));
14
15 cb->func = func;
16 cb->args = args;
17 return cb;
18 }
19
20 static inline void free_let_callback(let_callback *cb) {
21 free_let_func(cb->func);
22 free_set_values(cb->args);
23 free(cb);
24 }
25
26 #endif