28 lines
473 B
C
28 lines
473 B
C
|
|
#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;
|
||
|
|
}
|