67 sb = malloc(
sizeof(*sb));
102 memcpy(sb->
buf+sb->
pos, str, len);
116 va_start(arg, format);
120 if (n > -1 && (
size_t)n < size) {
121 sb->
pos += (size_t)n;
143 if (sb->
pos+len <= sb->size) {
147 new_size = sb->
pos+len+256;
148 tmp = realloc(sb->
buf, new_size);
void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2)
sstring stringbuffer_finish_shared(StringBuffer *sb)
StringBuffer * stringbuffer_new(void)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
static void stringbuffer_ensure(StringBuffer *sb, size_t len)
sstring add_string(const char *str)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
char * stringbuffer_finish(StringBuffer *sb)