mie: implement caching and emitting string data
This commit is contained in:
17
mie/data.c
17
mie/data.c
@@ -33,6 +33,23 @@ struct mie_data *mie_data_create_extern_global(
|
||||
return data;
|
||||
}
|
||||
|
||||
struct mie_data *mie_data_create_const(struct mie_const *value)
|
||||
{
|
||||
struct mie_data *data = malloc(sizeof *data);
|
||||
if (!data) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(data, 0x0, sizeof *data);
|
||||
|
||||
mie_value_init(&data->d_base, MIE_VALUE_DATA);
|
||||
|
||||
data->d_type = MIE_DATA_CONST;
|
||||
data->d_const.c_value = value;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static struct mie_type *get_type(struct mie_value *v)
|
||||
{
|
||||
if (!ptr_type.t_id) {
|
||||
|
||||
Reference in New Issue
Block a user