mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-20 18:10:07 +00:00
16 lines
438 B
C
16 lines
438 B
C
#ifndef STRING_BUILDER_H
|
|
#define STRING_BUILDER_H
|
|
|
|
typedef struct _string_builder_t {
|
|
int used_length;
|
|
int alloc_length;
|
|
char* buffer;
|
|
} string_builder_t;
|
|
|
|
void sb_init(string_builder_t* psb, int alloc_length);
|
|
void sb_append_char(string_builder_t* psb, char c);
|
|
void sb_append_string(string_builder_t* psb, char* s);
|
|
// The caller should free() the return value:
|
|
char* sb_finish(string_builder_t* psb);
|
|
|
|
#endif // STRING_BUILDER_H
|