2025-04-11 13:40:54 +01:00
|
|
|
#include <mie/record.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
struct mie_record *mie_record_create(const struct mie_const *val)
|
|
|
|
|
{
|
|
|
|
|
struct mie_record *out = malloc(sizeof *out);
|
|
|
|
|
if (!out) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memset(out, 0x0, sizeof *out);
|
|
|
|
|
|
|
|
|
|
mie_value_init(&out->r_base, MIE_VALUE_RECORD);
|
|
|
|
|
out->r_value = val;
|
|
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
}
|
2025-04-13 18:34:02 +01:00
|
|
|
|
|
|
|
|
static struct mie_type *get_type(struct mie_value *v)
|
|
|
|
|
{
|
|
|
|
|
struct mie_record *r = MIE_RECORD(v);
|
|
|
|
|
return r->r_value->c_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const struct mie_value_type record_value_type = {
|
|
|
|
|
.t_id = MIE_VALUE_RECORD,
|
|
|
|
|
.t_get_type = get_type,
|
|
|
|
|
};
|