#ifndef BUF_H #define BUF_H #include /* string views */ typedef struct { const char *s; size_t n; } strv_t; strv_t strv(const char *s); int strv_split(strv_t *src, int chr, strv_t *dest); /* strings */ typedef struct buf { size_t sz, cap; char *buf; } str_t; void str_init(str_t *, size_t); void str_grow(str_t *, size_t); void str_free(str_t *); void str_cat(str_t *b, strv_t s); void str_catc(str_t *b, char c); #endif