Signed-off-by: Wincent Colaiuta <win@wincent.com>
return str;
}
-str_t *str_new_size(long len)
-{
- str_t *str = ALLOC_N(str_t, 1);
- str->ptr = ALLOC_N(char, len + STR_OVERALLOC);
- str->len = 0;
- str->capacity = len + STR_OVERALLOC;
- return str;
-}
-
str_t *str_new_copy(const char *src, long len)
{
str_t *str = ALLOC_N(str_t, 1);
// create a new, empty string struct
str_t *str_new(void);
-// create a new, empty string struct with capacity len
-str_t *str_new_size(long len);
-
// create a new string struct and initialize it with a copy of the buffer of length len pointed to by src
str_t *str_new_copy(const char *src, long len);