=== modified file 'driver-csi.c' --- driver-csi.c 2008-11-08 17:47:57 +0000 +++ driver-csi.c 2008-11-08 17:43:51 +0000 @@ -130,9 +130,9 @@ return NULL; } -static void free_driver(void *info) +static void free_driver(void *private) { - termkey_csi *csi = info; + termkey_csi *csi = private; free(csi->csifuncs); csi->csifuncs = NULL; @@ -286,12 +286,12 @@ return TERMKEY_RES_KEY; } -static termkey_result getkey(termkey_t *tk, void *info, termkey_key *key, int force) +static termkey_result getkey(termkey_t *tk, termkey_key *key, int force) { if(tk->buffcount == 0) return tk->is_closed ? TERMKEY_RES_EOF : TERMKEY_RES_NONE; - termkey_csi *csi = info; + termkey_csi *csi = tk->driver_info; // Now we're sure at least 1 byte is valid unsigned char b0 = CHARAT(0); === modified file 'driver-ti.c' --- driver-ti.c 2008-11-08 17:47:57 +0000 +++ driver-ti.c 2008-11-02 22:16:03 +0000 @@ -77,7 +77,7 @@ return NULL; } -static void start_driver(termkey_t *tk, void *info) +static void start_driver(termkey_t *tk) { /* The terminfo database will contain keys in application cursor key mode. * We may need to enable that mode @@ -88,7 +88,7 @@ } } -static void stop_driver(termkey_t *tk, void *info) +static void stop_driver(termkey_t *tk) { if(keypad_local) { // Can't call putp or tputs because they suck and don't give us fd control @@ -96,15 +96,15 @@ } } -static void free_driver(void *info) +static void free_driver(void *private) { } #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 getkey(termkey_t *tk, termkey_key *key, int force) { - termkey_ti *ti = info; + termkey_ti *ti = tk->driver_info; if(tk->buffcount == 0) return tk->is_closed ? TERMKEY_RES_EOF : TERMKEY_RES_NONE; === modified file 'termkey-internal.h' --- termkey-internal.h 2008-11-08 17:47:57 +0000 +++ termkey-internal.h 2008-11-02 17:54:24 +0000 @@ -9,10 +9,10 @@ struct termkey_driver { void *(*new_driver)(termkey_t *tk, const char *term); - void (*free_driver)(void *info); - void (*start_driver)(termkey_t *tk, void *info); - void (*stop_driver)(termkey_t *tk, void *info); - termkey_result (*getkey)(termkey_t *tk, void *info, termkey_key *key, int force); + void (*free_driver)(void *); + void (*start_driver)(termkey_t *tk); + void (*stop_driver)(termkey_t *tk); + termkey_result (*getkey)(termkey_t *tk, termkey_key *key, int force); }; struct keyinfo { === modified file 'termkey.c' --- termkey.c 2008-11-08 17:47:57 +0000 +++ termkey.c 2008-11-06 20:29:50 +0000 @@ -186,7 +186,7 @@ } if(tk->driver.start_driver) - (*tk->driver.start_driver)(tk, tk->driver_info); + (*tk->driver.start_driver)(tk); return tk; @@ -221,7 +221,7 @@ void termkey_destroy(termkey_t *tk) { if(tk->driver.stop_driver) - (*tk->driver.stop_driver)(tk, tk->driver_info); + (*tk->driver.stop_driver)(tk); if(tk->restore_termios_valid) tcsetattr(tk->fd, TCSANOW, &tk->restore_termios); @@ -375,7 +375,7 @@ tk->buffcount--; // Run the full driver - termkey_result metakey_result = (*tk->driver.getkey)(tk, tk->driver_info, key, force); + termkey_result metakey_result = (*tk->driver.getkey)(tk, key, force); tk->buffstart--; tk->buffcount++; @@ -497,12 +497,12 @@ termkey_result termkey_getkey(termkey_t *tk, termkey_key *key) { - return (*tk->driver.getkey)(tk, tk->driver_info, key, 0); + return (*tk->driver.getkey)(tk, key, 0); } termkey_result termkey_getkey_force(termkey_t *tk, termkey_key *key) { - return (*tk->driver.getkey)(tk, tk->driver_info, key, 1); + return (*tk->driver.getkey)(tk, key, 1); } termkey_result termkey_waitkey(termkey_t *tk, termkey_key *key)