diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-06 23:36:14 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-06 23:36:14 +0100 |
commit | e3eca8d51a7d6c0676b973713a1ff043eb0095c7 (patch) | |
tree | 37f12e4734916972ed6e2f851841430102d3cdb2 /driver-csi.c | |
parent | f5c6ecf9af6a024c1c4a0d486303516a6381ddc7 (diff) | |
download | termo-e3eca8d51a7d6c0676b973713a1ff043eb0095c7.tar.gz termo-e3eca8d51a7d6c0676b973713a1ff043eb0095c7.tar.xz termo-e3eca8d51a7d6c0676b973713a1ff043eb0095c7.zip |
Use vtable in driver to indirect calls to the CSI driver
Diffstat (limited to 'driver-csi.c')
-rw-r--r-- | driver-csi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/driver-csi.c b/driver-csi.c index a3e3e7e..a6f5241 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -24,7 +24,7 @@ typedef struct { struct keyinfo *csifuncs; } termkey_csi; -void *termkeycsi_new_driver(termkey_t *tk) +static void *new_driver(termkey_t *tk) { termkey_csi *csi = malloc(sizeof *csi); @@ -50,7 +50,7 @@ void *termkeycsi_new_driver(termkey_t *tk) return csi; } -void termkeycsi_free_driver(void *private) +static void free_driver(void *private) { termkey_csi *csi = private; @@ -324,7 +324,7 @@ static termkey_result getkey_ss3(termkey_t *tk, size_t introlen, termkey_key *ke return TERMKEY_RES_KEY; } -termkey_result termkeycsi_getkey(termkey_t *tk, termkey_key *key) +static termkey_result getkey(termkey_t *tk, termkey_key *key) { if(tk->buffcount == 0) return tk->is_closed ? TERMKEY_RES_EOF : TERMKEY_RES_NONE; @@ -580,3 +580,10 @@ termkey_keysym termkey_register_csifunc_full(termkey_t *tk, termkey_type type, t return sym; } + +struct termkey_driver termkey_driver_csi = { + .new_driver = new_driver, + .free_driver = free_driver, + + .getkey = getkey, +}; |