mie: implement ir generation for message sending
This commit is contained in:
22
mie/module.c
22
mie/module.c
@@ -1,3 +1,4 @@
|
||||
#include <mie/data.h>
|
||||
#include <mie/func.h>
|
||||
#include <mie/module.h>
|
||||
#include <stdlib.h>
|
||||
@@ -22,6 +23,27 @@ 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);
|
||||
}
|
||||
|
||||
struct mie_data *mie_module_get_data(struct mie_module *mod, const char *name)
|
||||
{
|
||||
b_queue_iterator it;
|
||||
b_queue_foreach (&it, &mod->m_data) {
|
||||
struct mie_data *data = (struct mie_data *)b_unbox(
|
||||
struct mie_value, it.entry, v_entry);
|
||||
if (!strcmp(data->d_base.v_name.n_str, name)) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enum b_status mie_module_put_data(struct mie_module *mod, struct mie_data *data)
|
||||
{
|
||||
/* TODO enforce unique names */
|
||||
b_queue_push_back(&mod->m_data, &data->d_base.v_entry);
|
||||
return B_SUCCESS;
|
||||
}
|
||||
|
||||
static void cleanup(struct mie_value *value)
|
||||
{
|
||||
struct mie_module *module = MIE_MODULE(value);
|
||||
|
||||
Reference in New Issue
Block a user