Added (undocumented) termkey_set_buffer_size()

This commit is contained in:
Paul LeoNerd Evans
2012-02-13 23:40:42 +00:00
parent 5779ec3cd1
commit e252c497ae
3 changed files with 45 additions and 0 deletions

View File

@@ -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