aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/termkey.c b/termkey.c
index 1cc964b..8e443d1 100644
--- a/termkey.c
+++ b/termkey.c
@@ -466,6 +466,18 @@ size_t termkey_get_buffer_size(TermKey *tk)
return tk->buffsize;
}
+int termkey_set_buffer_size(TermKey *tk, size_t size)
+{
+ unsigned char *buffer = realloc(tk->buffer, size);
+ if(!buffer)
+ return 0;
+
+ tk->buffer = buffer;
+ tk->buffsize = size;
+
+ return 1;
+}
+
size_t termkey_get_buffer_remaining(TermKey *tk)
{
/* Return the total number of free bytes in the buffer, because that's what