summaryrefslogtreecommitdiff
path: root/userland/libc/include/tb/sb.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-31 14:53:29 +0100
committerAnton Kling <anton@kling.gg>2024-12-31 14:55:34 +0100
commit1b0c0f4b45e518bf12c58902819fbc90e4834dad (patch)
treefb8a52096d8c8aee9a6355c716cc972a57567027 /userland/libc/include/tb/sb.h
parentf2e31397b0e20e962eba1c2096fba73a0b210846 (diff)
libc: Add more sv/sb functions
Diffstat (limited to 'userland/libc/include/tb/sb.h')
-rw-r--r--userland/libc/include/tb/sb.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/userland/libc/include/tb/sb.h b/userland/libc/include/tb/sb.h
index 7832015..f75fa5c 100644
--- a/userland/libc/include/tb/sb.h
+++ b/userland/libc/include/tb/sb.h
@@ -8,12 +8,14 @@ struct sb {
char *string;
size_t length;
size_t capacity;
+ size_t to_ignore;
uint8_t prebuffer;
};
struct sv;
void sb_init(struct sb *ctx);
+void sb_set_ignore(struct sb *ctx, size_t n);
int sb_init_capacity(struct sb *ctx, size_t starting_capacity);
void sb_init_buffer(struct sb *ctx, char *buffer, size_t size);
void sb_free(struct sb *ctx);
@@ -22,8 +24,10 @@ int sb_isempty(const struct sb *ctx);
int sb_append_char(struct sb *ctx, char c);
int sb_delete_right(struct sb *ctx, size_t n);
int sb_append(struct sb *ctx, const char *s);
-int sb_append_buffer(struct sb *ctx, const char *buffer, size_t length);
+int sb_append_buffer(struct sb *ctx, const void *buffer, size_t length);
int sb_append_sv(struct sb *ctx, struct sv sv);
int sb_prepend_sv(struct sb *ctx, struct sv sv);
-int sb_prepend_buffer(struct sb *ctx, const char *buffer, size_t length);
+int sb_prepend_buffer(struct sb *ctx, const void *buffer, size_t length);
+int sb_modify_location(struct sb *ctx, void *buffer, size_t length, size_t offset);
+int sb_reserve_buffer(struct sb *ctx, size_t *offset, size_t length);
#endif