diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2025-02-28 08:20:22 -0700 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-02-28 08:20:22 -0700 |
| commit | 862c33fe0814ab7756aabcf55aa77fa9c3bd6ef2 (patch) | |
| tree | a10e21884c0ecb148d614ca4b3f925999f63900e /buffer.c | |
| parent | 05897c884af2ae3ed66f80b624f657dc898da2ae (diff) | |
| download | vis-862c33fe0814ab7756aabcf55aa77fa9c3bd6ef2.tar.gz vis-862c33fe0814ab7756aabcf55aa77fa9c3bd6ef2.tar.xz | |
buffer: remove more unused exposed functions
NOTE: buffer-test.c now directly includes buffer.c so that it can
continue to test functions which are defined as static/internal to
buffer.c
Diffstat (limited to 'buffer.c')
| -rw-r--r-- | buffer.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -67,7 +67,7 @@ bool buffer_remove(Buffer *buf, size_t pos, size_t len) { return true; } -bool buffer_insert(Buffer *buf, size_t pos, const void *data, size_t len) { +static bool buffer_insert(Buffer *buf, size_t pos, const void *data, size_t len) { if (pos > buf->len) return false; if (len == 0) @@ -84,7 +84,7 @@ bool buffer_insert(Buffer *buf, size_t pos, const void *data, size_t len) { bool buffer_insert0(Buffer *buf, size_t pos, const char *data) { if (pos == 0) - return buffer_prepend0(buf, data); + return buffer_insert(buf, 0, data, strlen(data) + (buf->len == 0)); if (pos == buf->len) return buffer_append0(buf, data); return buffer_insert(buf, pos, data, strlen(data)); @@ -103,14 +103,6 @@ bool buffer_append0(Buffer *buf, const char *data) { return ret; } -bool buffer_prepend(Buffer *buf, const void *data, size_t len) { - return buffer_insert(buf, 0, data, len); -} - -bool buffer_prepend0(Buffer *buf, const char *data) { - return buffer_prepend(buf, data, strlen(data) + (buf->len == 0)); -} - static bool buffer_vappendf(Buffer *buf, const char *fmt, va_list ap) { va_list ap_save; va_copy(ap_save, ap); |
