#ifndef TOBI_STR_H #define TOBI_STR_H #include #include typedef struct tobi_sb { char *buf; size_t len; size_t cap; } tobi_sb; void tobi_sb_init(tobi_sb *sb); void tobi_sb_free(tobi_sb *sb); void tobi_sb_add(tobi_sb *sb, const char *s); void tobi_sb_addn(tobi_sb *sb, const char *s, size_t n); void tobi_sb_ch(tobi_sb *sb, char c); void tobi_sb_printf(tobi_sb *sb, const char *fmt, ...); char *tobi_sb_take(tobi_sb *sb); void tobi_json_string(tobi_sb *sb, const char *s); void tobi_hex(tobi_sb *sb, const uint8_t *data, size_t len); #endif