commits
tags
#ifndef HUSH_STRBUF_H
#define HUSH_STRBUF_H
typedef struct {
char *data;
int len;
int cap;
} StrBuf;
void sb_init(StrBuf *sb);
void sb_free(StrBuf *sb);
void sb_reserve(StrBuf *sb, int extra);
void sb_set(StrBuf *sb, const char *s, int n);
void sb_insert(StrBuf *sb, int pos, const char *s, int n);
void sb_delete(StrBuf *sb, int pos, int n);
void sb_append(StrBuf *sb, const char *s, int n);
void sb_append_char(StrBuf *sb, char c);
void sb_clear(StrBuf *sb);
#endif