roza/lib/fun.c

20 lines
357 B
C
Raw Normal View History

2023-12-20 19:54:58 +00:00
#include "fun.h"
#include "sym.h"
void fun_init(fun_t* fun, struct tysy* tysy, err_t* err)
{
assert(fun);
program_init(&fun->program);
fun->sym = malloc(sizeof(sym_t));
sym_init((sym_t*) fun->sym, (tysy_t*) tysy, err);
}
void fun_free(fun_t* fun)
{
assert(fun);
program_free(&fun->program);
sym_free((sym_t*) fun->sym);
free(fun->sym);
}