=== modified file 't/02getkey.c' --- t/02getkey.c 2012-01-18 10:04:15 +0000 +++ t/02getkey.c 2011-03-31 12:51:21 +0000 @@ -8,7 +8,7 @@ TermKey *tk; TermKeyKey key; - plan_tests(29); + plan_tests(19); pipe(fd); @@ -17,8 +17,6 @@ tk = termkey_new(fd[0], TERMKEY_FLAG_NOTERMIOS); - is_int(termkey_get_buffer_remaining(tk), 256, "buffer free initially 256"); - is_int(termkey_getkey(tk, &key), TERMKEY_RES_NONE, "getkey yields RES_NONE when empty"); write(fd[1], "h", 1); @@ -27,8 +25,6 @@ is_int(termkey_advisereadable(tk), TERMKEY_RES_AGAIN, "advisereadable yields RES_AGAIN after h"); - is_int(termkey_get_buffer_remaining(tk), 255, "buffer free 255 after advisereadable"); - is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY after h"); is_int(key.type, TERMKEY_TYPE_UNICODE, "key.type after h"); @@ -36,8 +32,6 @@ is_int(key.modifiers, 0, "key.modifiers after h"); is_str(key.utf8, "h", "key.utf8 after h"); - is_int(termkey_get_buffer_remaining(tk), 256, "buffer free 256 after getkey"); - is_int(termkey_getkey(tk, &key), TERMKEY_RES_NONE, "getkey yields RES_NONE a second time"); write(fd[1], "\x01", 1); @@ -60,24 +54,6 @@ is_int(key.code.sym, TERMKEY_SYM_UP, "key.code.sym after Up"); is_int(key.modifiers, 0, "key.modifiers after Up"); - write(fd[1], "\eO", 2); - termkey_advisereadable(tk); - - is_int(termkey_get_buffer_remaining(tk), 254, "buffer free 254 after partial write"); - - is_int(termkey_getkey(tk, &key), TERMKEY_RES_AGAIN, "getkey yields RES_AGAIN after partial write"); - - write(fd[1], "C", 1); - termkey_advisereadable(tk); - - is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY after Right completion"); - - is_int(key.type, TERMKEY_TYPE_KEYSYM, "key.type after Right"); - is_int(key.code.sym, TERMKEY_SYM_RIGHT, "key.code.sym after Right"); - is_int(key.modifiers, 0, "key.modifiers after Right"); - - is_int(termkey_get_buffer_remaining(tk), 256, "buffer free 256 after completion"); - termkey_destroy(tk); return exit_status(); === modified file 'termkey.c' --- termkey.c 2012-01-18 10:04:15 +0000 +++ termkey.c 2012-01-18 09:36:36 +0000 @@ -425,13 +425,6 @@ tk->flags &= ~TERMKEY_FLAG_SPACESYMBOL; } -size_t termkey_get_buffer_remaining(TermKey *tk) -{ - /* Return the total number of free bytes in the buffer, because that's what - * is available to the user. */ - return tk->buffsize - tk->buffcount; -} - static void eat_bytes(TermKey *tk, size_t count) { if(count >= tk->buffcount) { === modified file 'termkey.h.in' --- termkey.h.in 2012-01-18 10:04:15 +0000 +++ termkey.h.in 2012-01-18 09:36:36 +0000 @@ -171,8 +171,6 @@ int termkey_get_canonflags(TermKey *tk); void termkey_set_canonflags(TermKey *tk, int); -size_t termkey_get_buffer_remaining(TermKey *tk); - void termkey_canonicalise(TermKey *tk, TermKeyKey *key); TermKeyResult termkey_getkey(TermKey *tk, TermKeyKey *key); === removed file 'termkey_get_buffer_remaining.3' --- termkey_get_buffer_remaining.3 2012-01-18 10:04:15 +0000 +++ termkey_get_buffer_remaining.3 1970-01-01 00:00:00 +0000 @@ -1,20 +0,0 @@ -.TH TERMKEY_GET_BUFFER_REMAINING 3 -.SH NAME -termkey_get_buffer_remaining \- returns the free buffer space -.SH SYNOPSIS -.nf -.B #include -.sp -.BI "size_t termkey_get_buffer_remaining(TermKey *" tk "); -.fi -.sp -Link with \fI-ltermkey\fP. -.SH DESCRIPTION -A termkey instance contains a buffer of pending bytes that have been read by \fBtermkey_advisereadable\fP(3) but not yet consumed by \fBtermkey_getkey\fP(3). \fBtermkey_get_buffer_remaining\fP() returns the number of bytes of buffer space currently free in the termkey instance. -.PP -.SH "RETURN VALUE" -\fBtermkey_get_buffer_remaining\fP() returns a size in bytes. -.SH "SEE ALSO" -.BR termkey_new (3), -.BR termkey_advisereadable (3), -.BR termkey_getkey (3) === modified file 'termkey_new.3' --- termkey_new.3 2012-01-18 10:04:15 +0000 +++ termkey_new.3 2011-08-25 09:48:41 +0000 @@ -56,5 +56,4 @@ .BR termkey_advisereadable (3), .BR termkey_getkey (3), .BR termkey_get_flags (3), -.BR termkey_get_fd (3), -.BR termkey_get_buffer_remaining (3) +.BR termkey_get_fd (3)