diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-12-10 00:23:47 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-12-10 00:23:47 +0000 |
commit | ef669c134d9352d88ae020803c7ee280083523f8 (patch) | |
tree | fe1e5b91fcf94ad0cceffed39c627319cd27568d /driver-ti.c | |
parent | eee8ddcee317bdd1717734b95ab5e8d0b968619d (diff) | |
download | termo-ef669c134d9352d88ae020803c7ee280083523f8.tar.gz termo-ef669c134d9352d88ae020803c7ee280083523f8.tar.xz termo-ef669c134d9352d88ae020803c7ee280083523f8.zip |
Complete change of driver internals - peek and return size but don't eat bytes; eat later in getkey()
Diffstat (limited to 'driver-ti.c')
-rw-r--r-- | driver-ti.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/driver-ti.c b/driver-ti.c index fe28137..098c526 100644 --- a/driver-ti.c +++ b/driver-ti.c @@ -260,7 +260,7 @@ static void free_driver(void *info) #define CHARAT(i) (tk->buffer[tk->buffstart + (i)]) -static termkey_result getkey(termkey_t *tk, void *info, termkey_key *key, int force) +static termkey_result peekkey(termkey_t *tk, void *info, termkey_key *key, int force, size_t *nbytep) { termkey_ti *ti = info; @@ -282,7 +282,7 @@ static termkey_result getkey(termkey_t *tk, void *info, termkey_key *key, int fo key->type = nk->key.type; key->code.sym = nk->key.sym; key->modifiers = nk->key.modifier_set; - (*tk->method.eat_bytes)(tk, pos); + *nbytep = pos; return TERMKEY_RES_KEY; } } @@ -456,5 +456,5 @@ struct termkey_driver termkey_driver_ti = { .start_driver = start_driver, .stop_driver = stop_driver, - .getkey = getkey, + .peekkey = peekkey, }; |