picrin/extlib/benz/data.c

16 lines
367 B
C
Raw Normal View History

2014-08-25 00:38:09 -04:00
#include "picrin.h"
struct pic_data *
pic_data_alloc(pic_state *pic, const pic_data_type *type, void *userdata)
{
struct pic_data *data;
2015-06-23 12:13:18 -04:00
struct pic_dict *storage = pic_make_dict(pic);
2014-08-25 00:38:09 -04:00
data = (struct pic_data *)pic_obj_alloc(pic, sizeof(struct pic_data), PIC_TT_DATA);
data->type = type;
data->data = userdata;
2015-06-23 12:13:18 -04:00
data->storage = storage;
2014-08-25 00:38:09 -04:00
return data;
}