gboolean (*dispatch) (GSource *source,
GSourceFunc callback,
gpointer user_data);
- void (*destroy) (GSource *source);
+ void (*destroy) (GSource *source); /* Can be NULL */
};
/* Any definitions using GPollFD or GPollFunc are primarily
gboolean is_running);
void g_main_loop_run (GMainLoop *loop);
void g_main_loop_quit (GMainLoop *loop);
-void g_main_loop_destroy (GMainLoop *loop);
+GMainLoop *g_main_loop_ref (GMainLoop *loop);
+void g_main_loop_unref (GMainLoop *loop);
gboolean g_main_loop_is_running (GMainLoop *loop);
/* GSource: */
/* ============== Compat main loop stuff ================== */
+#ifndef G_DISABLE_DEPRECATED
+
/* Legacy names for GMainLoop functions
*/
#define g_main_new(is_running) g_main_loop_new (NULL, is_running);
#define g_main_run(loop) g_main_loop_run(loop)
#define g_main_quit(loop) g_main_loop_quit(loop)
-#define g_main_destroy(loop) g_main_loop_destroy(loop)
+#define g_main_destroy(loop) g_main_loop_unref(loop)
#define g_main_is_running(loop) g_main_loop_is_running(loop)
-/* Source manipulation by ID */
-gboolean g_source_remove (guint tag);
-gboolean g_source_remove_by_user_data (gpointer user_data);
-gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
- gpointer user_data);
-
/* Functions to manipulate the default main loop
*/
#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func)
+#endif /* G_DISABLE_DEPRECATED */
+
+/* Source manipulation by ID */
+gboolean g_source_remove (guint tag);
+gboolean g_source_remove_by_user_data (gpointer user_data);
+gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
+ gpointer user_data);
+
/* Idles and timeouts */
guint g_timeout_add_full (gint priority,
guint interval,