diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-02-13 23:40:42 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-02-13 23:40:42 +0000 |
commit | e252c497ae20351882d8b98a5c59ca19e479c5a8 (patch) | |
tree | d11076c7f28d8afba90996c6c42eedb6e7deddc2 /termkey.c | |
parent | 5779ec3cd1e2a286265837bad264125c55875be8 (diff) | |
download | termo-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.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |