picrin/src/blob.c

16 lines
308 B
C
Raw Normal View History

2013-11-04 22:38:23 -05:00
#include <string.h>
#include "picrin.h"
#include "picrin/blob.h"
struct pic_blob *
pic_blob_new(pic_state *pic, char *dat, int len)
{
struct pic_blob *bv;
bv = (struct pic_blob *)pic_obj_alloc(pic, sizeof(struct pic_blob), PIC_TT_BLOB);
bv->data = strndup(dat, len);
bv->len = len;
return bv;
}