mie: move mie_ctx out of the ir subsystem
This commit is contained in:
27
mie/type.c
Normal file
27
mie/type.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <mie/type.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static struct mie_type *get_type(struct mie_value *v, struct mie_ctx *ctx)
|
||||
{
|
||||
return MIE_TYPE(v);
|
||||
}
|
||||
|
||||
const struct mie_value_type type_value_type = {
|
||||
.t_id = MIE_VALUE_TYPE,
|
||||
.t_get_type = get_type,
|
||||
};
|
||||
|
||||
struct mie_type *mie_type_create(void)
|
||||
{
|
||||
struct mie_type *out = malloc(sizeof *out);
|
||||
if (!out) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(out, 0x0, sizeof *out);
|
||||
|
||||
out->t_base.v_type = &type_value_type;
|
||||
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user