=== modified file 'termkey.c' --- termkey.c 2008-02-10 19:23:18 +0000 +++ termkey.c 2008-02-10 19:15:29 +0000 @@ -444,7 +444,6 @@ case TERMKEY_RES_NONE: case TERMKEY_RES_EOF: - case TERMKEY_RES_AGAIN: break; } @@ -570,21 +569,17 @@ tk->buffcount += inputlen; } -termkey_result termkey_advisereadable(termkey_t *tk) +void termkey_advisereadable(termkey_t *tk) { unsigned char buffer[64]; // Smaller than the default size size_t len = read(tk->fd, buffer, sizeof buffer); if(len == -1 && errno == EAGAIN) - return TERMKEY_RES_NONE; - else if(len < 1) { + return; + else if(len < 1) tk->is_closed = 1; - return TERMKEY_RES_NONE; - } - else { + else termkey_pushinput(tk, buffer, len); - return TERMKEY_RES_AGAIN; - } } const char *termkey_describe_sym(termkey_t *tk, termkey_keysym code) === modified file 'termkey.h' --- termkey.h 2008-02-10 19:23:18 +0000 +++ termkey.h 2008-02-10 19:03:36 +0000 @@ -73,7 +73,6 @@ TERMKEY_RES_NONE, TERMKEY_RES_KEY, TERMKEY_RES_EOF, - TERMKEY_RES_AGAIN, } termkey_result; enum { @@ -115,7 +114,7 @@ void termkey_pushinput(termkey_t *tk, unsigned char *input, size_t inputlen); -termkey_result termkey_advisereadable(termkey_t *tk); +void termkey_advisereadable(termkey_t *tk); // Registration of keys and names termkey_keysym termkey_register_keyname(termkey_t *tk, termkey_keysym code, const char *name);