aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-02-13 23:40:42 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-02-13 23:40:42 +0000
commite252c497ae20351882d8b98a5c59ca19e479c5a8 (patch)
treed11076c7f28d8afba90996c6c42eedb6e7deddc2 /termkey.c
parent5779ec3cd1e2a286265837bad264125c55875be8 (diff)
downloadtermo-e252c497ae20351882d8b98a5c59ca19e479c5a8.tar.gz
termo-e252c497ae20351882d8b98a5c59ca19e479c5a8.tar.xz
termo-e252c497ae20351882d8b98a5c59ca19e479c5a8.zip
Added (undocumented) termkey_set_buffer_size()
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