mie: implement value type initialiser functions
This commit is contained in:
19
mie/record.c
Normal file
19
mie/record.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
mie_value_retain(MIE_VALUE(out->r_value));
|
||||
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user