mie: add some convenience functions for func, block, and builder

This commit is contained in:
2025-04-14 20:14:44 +01:00
parent d4e0df0bda
commit 5630132a69
4 changed files with 30 additions and 0 deletions

View File

@@ -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);