mie: add some convenience functions for func, block, and builder
This commit is contained in:
20
mie/func.c
20
mie/func.c
@@ -80,6 +80,26 @@ struct mie_value *mie_func_generate_value_name(
|
||||
return b_unbox(struct mie_value, name, v_name);
|
||||
}
|
||||
|
||||
struct mie_block *mie_func_get_first_block(struct mie_func *func)
|
||||
{
|
||||
b_queue_entry *entry = b_queue_first(&func->f_blocks);
|
||||
if (!entry) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (struct mie_block *)b_unbox(struct mie_value, entry, v_entry);
|
||||
}
|
||||
|
||||
struct mie_block *mie_func_get_last_block(struct mie_func *func)
|
||||
{
|
||||
b_queue_entry *entry = b_queue_last(&func->f_blocks);
|
||||
if (!entry) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (struct mie_block *)b_unbox(struct mie_value, entry, v_entry);
|
||||
}
|
||||
|
||||
static struct mie_type *get_type(struct mie_value *v)
|
||||
{
|
||||
struct mie_func *f = MIE_FUNC(v);
|
||||
|
||||
Reference in New Issue
Block a user