3. init/deinit
<<function_declarations>>=
void monolith_janet_init(monolith_d *m);
<<functions>>=
void monolith_janet_init(monolith_d *m)
{
JanetTable *env;
janet_init();
env = janet_core_env(NULL);
monolith_janet_env_set(m, env);
monolith_janet_loader(env);
}
<<janet_scheme_entries>>=
{"monolith:janet-init", pp_janet_init, 0, 0, {___,___,___}},
<<janet_scheme_functions>>=
static cell pp_janet_init(cell x)
{
monolith_janet_init(monolith_data_get());
return UNSPECIFIC;
}
<<function_declarations>>=
void monolith_janet_deinit(monolith_d *m);
<<functions>>=
void monolith_janet_deinit(monolith_d *m)
{
JanetTable *env;
env = monolith_janet_env(m);
if (env != NULL) {
janet_deinit();
}
}
prev | home | next