* Boston, MA 02111-1307, USA.
*/
-#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
#error "Only <glib.h> can be included directly."
#endif
* while Windows uses process handles (which are pointers).
*/
-typedef gboolean (*GSourceFunc) (gpointer data);
+/**
+ * GSourceFunc:
+ * @user_data: data passed to the function, set when the source was
+ * created with one of the above functions
+ *
+ * Specifies the type of function passed to g_timeout_add(),
+ * g_timeout_add_full(), g_idle_add(), and g_idle_add_full().
+ *
+ * Returns: %FALSE if the source should be removed
+ */
+typedef gboolean (*GSourceFunc) (gpointer user_data);
/**
* GChildWatchFunc:
* @pid: the process id of the child process
* @status: Status information about the child process,
* see waitpid(2) for more information about this field
- * @data: user data passed to g_child_watch_add()
+ * @user_data: user data passed to g_child_watch_add()
*
* The type of functions to be called when a child exists.
*/
typedef void (*GChildWatchFunc) (GPid pid,
gint status,
- gpointer data);
+ gpointer user_data);
struct _GSource
{
/*< private >*/
gpointer *data);
};
+/**
+ * GSourceDummyMarshal:
+ *
+ * This is just a placeholder for #GClosureMarshal,
+ * which cannot be used here for dependency reasons.
+ */
typedef void (*GSourceDummyMarshal) (void);
struct _GSourceFuncs
*/
#define G_PRIORITY_LOW 300
+/**
+ * G_SOURCE_REMOVE:
+ *
+ * Use this macro as the return value of a #GSourceFunc to remove
+ * the #GSource from the main loop.
+ *
+ * Since: 2.28
+ */
+#define G_SOURCE_REMOVE FALSE
+
+/**
+ * G_SOURCE_CONTINUE:
+ *
+ * Use this macro as the return value of a #GSourceFunc to leave
+ * the #GSource in the main loop.
+ *
+ * Since: 2.28
+ */
+#define G_SOURCE_CONTINUE TRUE
+
/* GMainContext: */
GMainContext *g_main_context_new (void);
void g_main_context_push_thread_default (GMainContext *context);
void g_main_context_pop_thread_default (GMainContext *context);
GMainContext *g_main_context_get_thread_default (void);
+GMainContext *g_main_context_ref_thread_default (void);
/* GMainLoop: */
void g_source_set_name (GSource *source,
const char *name);
-G_CONST_RETURN char* g_source_get_name (GSource *source);
+const char * g_source_get_name (GSource *source);
void g_source_set_name_by_id (guint tag,
const char *name);
void g_source_remove_child_source (GSource *source,
GSource *child_source);
-#ifndef G_DISABLE_DEPRECATED
+GLIB_DEPRECATED_FOR(g_source_get_time)
void g_source_get_current_time (GSource *source,
GTimeVal *timeval);
-#endif
+
gint64 g_source_get_time (GSource *source);
/* void g_source_connect_closure (GSource *source,