summaryrefslogtreecommitdiff
path: root/src/text-buffer.c
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2025-08-22 00:38:36 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2025-08-22 00:38:36 +0200
commit39dd684496a6750a2458873e3c736bd8569e8db0 (patch)
tree171f2d0ab8094eb83e183e64de4385260ea228cd /src/text-buffer.c
parentebb4cc5b97b8565ceffa0d48301f8af9e6b884df (diff)
text-buffer: Add `text_buffer_append_str` function
Diffstat (limited to 'src/text-buffer.c')
-rw-r--r--src/text-buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/text-buffer.c b/src/text-buffer.c
index 215e446..cc764bc 100644
--- a/src/text-buffer.c
+++ b/src/text-buffer.c
@@ -47,6 +47,16 @@ text_buffer_append (text_buffer *tb, char c)
tb->contents[tb->used++] = c;
}
+void
+text_buffer_append_str (text_buffer *tb, char *c, size_t len)
+{
+ size_t i;
+ for (i=0; i<len; i++)
+ {
+ text_buffer_append (tb, c[i]);
+ }
+}
+
char
text_buffer_index (text_buffer *tb, size_t pos)
{