diff --git a/blob.c b/blob.c index 0bb28713..9e79bcd1 100644 --- a/blob.c +++ b/blob.c @@ -25,7 +25,7 @@ pic_strdup(pic_state *pic, const char *s) } struct pic_blob * -pic_blob_new(pic_state *pic, size_t len) +pic_make_blob(pic_state *pic, size_t len) { struct pic_blob *bv; @@ -56,7 +56,7 @@ pic_blob_make_bytevector(pic_state *pic) if (b < 0 || b > 255) pic_error(pic, "byte out of range"); - blob = pic_blob_new(pic, k); + blob = pic_make_blob(pic, k); for (i = 0; i < k; ++i) { blob->data[i] = b; } @@ -146,7 +146,7 @@ pic_blob_bytevector_copy(pic_state *pic) end = from->len; } - to = pic_blob_new(pic, end - start); + to = pic_make_blob(pic, end - start); while (start < end) { to->data[i++] = from->data[start++]; } @@ -169,7 +169,7 @@ pic_blob_bytevector_append(pic_state *pic) len += pic_blob_ptr(argv[i])->len; } - blob = pic_blob_new(pic, len); + blob = pic_make_blob(pic, len); len = 0; for (i = 0; i < argc; ++i) { diff --git a/include/picrin/blob.h b/include/picrin/blob.h index f61f588d..5837c04f 100644 --- a/include/picrin/blob.h +++ b/include/picrin/blob.h @@ -18,7 +18,7 @@ struct pic_blob { #define pic_blob_p(v) (pic_type(v) == PIC_TT_BLOB) #define pic_blob_ptr(v) ((struct pic_blob *)pic_ptr(v)) -struct pic_blob *pic_blob_new(pic_state *, size_t); +struct pic_blob *pic_make_blob(pic_state *, size_t); #if defined(__cplusplus) } diff --git a/port.c b/port.c index ae7c66b2..b6c666fe 100644 --- a/port.c +++ b/port.c @@ -360,7 +360,7 @@ pic_port_get_output_bytevector(pic_state *pic) xrewind(port->file); /* copy to buf */ - blob = pic_blob_new(pic, endpos); + blob = pic_make_blob(pic, endpos); xfread(blob->data, 1, endpos, port->file); return pic_obj_value(blob); @@ -528,7 +528,7 @@ pic_port_read_blob(pic_state *pic) assert_port_profile(port, PIC_PORT_IN | PIC_PORT_BINARY, PIC_PORT_OPEN, "read-bytevector"); - blob = pic_blob_new(pic, k); + blob = pic_make_blob(pic, k); i = xfread(blob->data, sizeof(char), k, port->file); if ( i == 0 ) { diff --git a/read.c b/read.c index d52f1416..5f3bd383 100644 --- a/read.c +++ b/read.c @@ -534,7 +534,7 @@ read_blob(pic_state *pic, struct pic_port *port, const char *str) c = next(port); } - blob = pic_blob_new(pic, len); + blob = pic_make_blob(pic, len); for (i = 0; i < len; ++i) { blob->data[i] = dat[i]; }