2025-04-11 13:40:54 +01:00
|
|
|
#include <mie/const.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2025-04-23 15:42:58 +01:00
|
|
|
void mie_const_init(struct mie_const *c, struct mie_type *type)
|
2025-04-17 22:55:17 +01:00
|
|
|
{
|
|
|
|
|
memset(c, 0x0, sizeof *c);
|
|
|
|
|
mie_value_init(&c->c_base, MIE_VALUE_CONST);
|
|
|
|
|
|
|
|
|
|
c->c_type = type;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-28 15:38:25 +01:00
|
|
|
static struct mie_type *get_type(struct mie_value *v, struct mie_ctx *ctx)
|
2025-04-11 13:40:54 +01:00
|
|
|
{
|
2025-04-13 18:34:02 +01:00
|
|
|
struct mie_const *c = MIE_CONST(v);
|
|
|
|
|
return c->c_type;
|
2025-04-11 13:40:54 +01:00
|
|
|
}
|
|
|
|
|
|
2025-04-13 18:34:02 +01:00
|
|
|
const struct mie_value_type const_value_type = {
|
|
|
|
|
.t_id = MIE_VALUE_CONST,
|
|
|
|
|
.t_get_type = get_type,
|
|
|
|
|
};
|