+void event_loop(int nonblock);
+
+/*
+ * Get the default GMainLoop object. Applications which use the Glib
+ * main loop directly should use this object for calls to e.g.,
+ * g_main_loop_run(loop).
+ */
+GMainLoop *default_main_loop(void);
+
+/*
+ * Utility GSources
+ */
+
+/* Create a GSource that will callback when the given file descriptor is in
+ * any of the given conditions. The callback is a simple GSourceFunc.
+ *
+ * @param fd: the file descriptr
+ * @param events: the conditions (GIOCondition flags)
+ * @return: GSource object
+ */
+GSource * new_fdsource(gint fd, GIOCondition events);
+
+/* Create a GSource that will callback when the given child dies. The callback
+ * should match ChildWatchFunc. Once the callback is made, it will not be called
+ * again by this source.
+ *
+ * Note: This is provided by glib in later versions, but not in version 2.2.0.
+ * This function and callback is modeled on g_child_watch_source_new.
+ *
+ * @param pid: the process ID @return: GSource object
+ */
+typedef void (*ChildWatchFunc)(pid_t pid, gint status, gpointer data);
+GSource * new_child_watch_source(pid_t pid);