28 lines
528 B
C
28 lines
528 B
C
|
|
#include <mie/func.h>
|
||
|
|
#include <mie/module.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
#include <string.h>
|
||
|
|
|
||
|
|
struct mie_module *mie_module_create(void)
|
||
|
|
{
|
||
|
|
struct mie_module *out = malloc(sizeof *out);
|
||
|
|
if (!out) {
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
memset(out, 0x0, sizeof *out);
|
||
|
|
|
||
|
|
mie_value_init(&out->m_base, MIE_VALUE_MODULE);
|
||
|
|
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
|
void mie_module_add_function(struct mie_module *mod, struct mie_func *func)
|
||
|
|
{
|
||
|
|
b_queue_push_back(&mod->m_func, &func->f_base.v_entry);
|
||
|
|
}
|
||
|
|
|
||
|
|
const struct mie_value_type module_value_type = {
|
||
|
|
.t_id = MIE_VALUE_MODULE,
|
||
|
|
};
|