diff options
author | Anton Kling <anton@kling.gg> | 2024-04-11 17:22:00 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-04-11 17:23:39 +0200 |
commit | ca082f686fd2dc7ee6f0284421f6212d6d4acee8 (patch) | |
tree | 493b1047661174816f0d1d300952e40e2846b24b /userland/libc/include/tb/sb.h | |
parent | e25a47fcc4db09ab9b845a691297da67243e6049 (diff) |
bug fixes
Diffstat (limited to 'userland/libc/include/tb/sb.h')
-rw-r--r-- | userland/libc/include/tb/sb.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/userland/libc/include/tb/sb.h b/userland/libc/include/tb/sb.h new file mode 100644 index 0000000..5675985 --- /dev/null +++ b/userland/libc/include/tb/sb.h @@ -0,0 +1,23 @@ +#ifndef SB_H +#define SB_H +#include "sv.h" +#include <stddef.h> + +struct sb { + char *string; + size_t length; + size_t capacity; +}; + +struct sv; + +void sb_init(struct sb *ctx); +void sb_free(struct sb *ctx); +void sb_reset(struct sb *ctx); +int sb_isempty(const struct sb *ctx); +void sb_append_char(struct sb *ctx, char c); +int sb_delete_right(struct sb *ctx, int n); +void sb_append(struct sb *ctx, const char *s); +void sb_append_sv(struct sb *ctx, struct sv sv); +void sb_prepend_sv(struct sb *ctx, struct sv sv); +#endif |