From 6d1a6636090b498d43354d5503ac39fb10ac908c Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Mon, 14 Jan 2013 14:47:16 -0500 Subject: Add a UNIX fd source https://bugzilla.gnome.org/show_bug.cgi?id=658020 --- glib/glib-unix.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'glib/glib-unix.h') diff --git a/glib/glib-unix.h b/glib/glib-unix.h index c04f66f3c..66ccf74cd 100644 --- a/glib/glib-unix.h +++ b/glib/glib-unix.h @@ -85,6 +85,39 @@ guint g_unix_signal_add (gint signum, GSourceFunc handler, gpointer user_data); +/** + * GUnixFDSourceFunc: + * @fd: the fd that triggered the event + * @condition: the IO conditions reported on @fd + * @user_data: user data passed to g_unix_fd_add() + * + * The type of functions to be called when a UNIX fd watch source + * triggers. + * + * Returns: %FALSE if the source should be removed + **/ +typedef gboolean (*GUnixFDSourceFunc) (gint fd, + GIOCondition condition, + gpointer user_data); + +GLIB_AVAILABLE_IN_2_36 +GSource *g_unix_fd_source_new (gint fd, + GIOCondition condition); + +GLIB_AVAILABLE_IN_2_36 +guint g_unix_fd_add_full (gint priority, + gint fd, + GIOCondition condition, + GUnixFDSourceFunc function, + gpointer user_data, + GDestroyNotify notify); + +GLIB_AVAILABLE_IN_2_36 +guint g_unix_fd_add (gint fd, + GIOCondition condition, + GUnixFDSourceFunc function, + gpointer user_data); + G_END_DECLS #endif /* __G_UNIX_H__ */ -- cgit v1.2.1