Add callbacks that get invoked before the next call to select(), which will allow for a nice fix to https://github.com/fish-shell/fish-shell/issues/608. Eliminate the poll handler, and replace it with this mechanism.

This commit is contained in:
ridiculousfish
2013-04-03 13:49:58 -07:00
parent 11a444e914
commit 1543d02f96
3 changed files with 45 additions and 19 deletions

View File

@@ -30,9 +30,6 @@ enum
*/
void input_common_init(int (*ih)());
/* Sets a callback to be invoked every time a byte is read */
void input_common_set_poll_callback(void (*handler)(void));
/**
Free memory used by the library
*/
@@ -56,4 +53,9 @@ wchar_t input_common_readch(int timed);
*/
void input_common_unreadch(wint_t ch);
/** Adds a callback to be invoked at the next turn of the "event loop." The callback function will be invoked and passed arg. */
void input_common_add_callback(void (*callback)(void *), void *arg);
#endif