mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
Refactor code to create a watcher for an fd into a function.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4813 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
e88bd31323
commit
cad6fb2e19
3 changed files with 14 additions and 5 deletions
|
|
@ -87,6 +87,16 @@ int g_input_add(GIOChannel *source, int condition,
|
|||
function, data);
|
||||
}
|
||||
|
||||
/* easy way to bypass glib polling of io channel internal buffer */
|
||||
int g_input_add_poll(int fd, int priority, int condition,
|
||||
GInputFunction function, void *data)
|
||||
{
|
||||
GIOChannel *source = g_io_channel_unix_new(fd);
|
||||
int ret = g_input_add_full(source, priority, condition, function, data);
|
||||
g_io_channel_unref(source);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2)
|
||||
{
|
||||
if (tv1->tv_sec < tv2->tv_sec)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue