diff options
Diffstat (limited to 'dynstr.c')
-rw-r--r-- | dynstr.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -105,7 +105,7 @@ static void *alloc(size_t size) /* Allocate a new dynamic string. If dynamic is true, the contents of the * new string is copied from mem. Otherwise the new string just uses mem * directly. */ -static Dynstr *new(const void *mem, size_t size, bool dynamic) +static Dynstr *newstr(const void *mem, size_t size, bool dynamic) { Dynstr *dynstr; @@ -133,31 +133,31 @@ static Dynstr *new(const void *mem, size_t size, bool dynamic) Dynstr *dynstr_new_empty(void) { - return new(NULL, 0, true); + return newstr(NULL, 0, true); } Dynstr *dynstr_new_from_cstring(const char *cstring) { - return new(cstring, strlen(cstring), true); + return newstr(cstring, strlen(cstring), true); } Dynstr *dynstr_new_from_memory(const void *mem, size_t size) { - return new(mem, size, true); + return newstr(mem, size, true); } Dynstr *dynstr_new_from_constant_cstring(const char *cstring) { - return new(cstring, strlen(cstring), false); + return newstr(cstring, strlen(cstring), false); } Dynstr *dynstr_new_from_constant_memory(const void *mem, size_t size) { - return new(mem, size, false); + return newstr(mem, size, false); } @@ -218,7 +218,7 @@ Dynstr *dynstr_substr(Dynstr *dynstr, size_t offset, size_t size) } else if (size > dynstr->size - offset) { size = dynstr->size - offset; } - return new(dynstr->mem + offset, size, true); + return newstr(dynstr->mem + offset, size, true); } @@ -254,7 +254,7 @@ Dynstr *dynstr_cat_many(Dynstr *dynstr, ...) } va_end(args); - result = new(mem, size, false); + result = newstr(mem, size, false); if (result == NULL) { free(mem); return NULL; @@ -395,7 +395,7 @@ static Dynstr *read_helper(size_t (*callback)(FILE *f, int fd, unsigned char *bu buf = p; } - dynstr = new(buf, n, false); + dynstr = newstr(buf, n, false); dynstr->dynamic = true; return dynstr; } |