Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gmain.h File Reference
#include <glib/gpoll.h>
#include <glib/gslist.h>
#include <glib/gthread.h>

Go to the source code of this file.

Data Structures

struct  _GSource
 
struct  _GSourceCallbackFuncs
 
struct  _GSourceFuncs
 

Macros

#define G_SOURCE_FUNC(f)   ((GSourceFunc) (void (*)(void)) (f)) GLIB_AVAILABLE_MACRO_IN_2_58
 
#define G_PRIORITY_HIGH   -100
 
#define G_PRIORITY_DEFAULT   0
 
#define G_PRIORITY_HIGH_IDLE   100
 
#define G_PRIORITY_DEFAULT_IDLE   200
 
#define G_PRIORITY_LOW   300
 
#define G_SOURCE_REMOVE   FALSE
 
#define G_SOURCE_CONTINUE   TRUE
 
#define g_clear_handle_id(tag_ptr, clear_func)
 

Typedefs

typedef struct _GMainContext GMainContext
 
typedef struct _GMainLoop GMainLoop
 
typedef struct _GSource GSource
 
typedef struct _GSourcePrivate GSourcePrivate
 
typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs
 
typedef struct _GSourceFuncs GSourceFuncs
 
typedef gboolean(* GSourceFunc) (gpointer user_data)
 
typedef void(* GSourceOnceFunc) (gpointer user_data)
 
typedef void(* GChildWatchFunc) (GPid pid, gint wait_status, gpointer user_data)
 
typedef void(* GSourceDummyMarshal) (void)
 
typedef gboolean(* GSourceFuncsPrepareFunc) (GSource *source, gint *timeout_)
 
typedef gboolean(* GSourceFuncsCheckFunc) (GSource *source)
 
typedef gboolean(* GSourceFuncsDispatchFunc) (GSource *source, GSourceFunc callback, gpointer user_data)
 
typedef void(* GSourceFuncsFinalizeFunc) (GSource *source)
 
typedef void GMainContextPusher GLIB_AVAILABLE_TYPE_IN_2_64
 
typedef void(* GClearHandleFunc) (guint handle_id)
 

Enumerations

enum  GIOCondition {
  GLIB_SYSDEF_POLLIN , GLIB_SYSDEF_POLLOUT , GLIB_SYSDEF_POLLPRI , GLIB_SYSDEF_POLLERR ,
  GLIB_SYSDEF_POLLHUP , GLIB_SYSDEF_POLLNVAL
}
 
enum  GMainContextFlags { G_MAIN_CONTEXT_FLAGS_NONE = 0 , G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING = 1 }
 

Functions

GLIB_AVAILABLE_IN_ALL GMainContextg_main_context_new (void)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_72 GMainContextg_main_context_new_with_flags (GMainContextFlags flags)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL GMainContextg_main_context_ref (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_unref (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL GMainContextg_main_context_default (void)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_context_iteration (GMainContext *context, gboolean may_block)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_context_pending (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL GSourceg_main_context_find_source_by_id (GMainContext *context, guint source_id)
 
GLIB_AVAILABLE_IN_ALL GSourceg_main_context_find_source_by_user_data (GMainContext *context, gpointer user_data)
 
GLIB_AVAILABLE_IN_ALL GSourceg_main_context_find_source_by_funcs_user_data (GMainContext *context, GSourceFuncs *funcs, gpointer user_data)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_wakeup (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_context_acquire (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_release (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_context_is_owner (GMainContext *context)
 
gboolean g_main_context_wait (GMainContext *context, GCond *cond, GMutex *mutex)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_context_prepare (GMainContext *context, gint *priority)
 
GLIB_AVAILABLE_IN_ALL gint g_main_context_query (GMainContext *context, gint max_priority, gint *timeout_, GPollFD *fds, gint n_fds)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_context_check (GMainContext *context, gint max_priority, GPollFD *fds, gint n_fds)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_dispatch (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_set_poll_func (GMainContext *context, GPollFunc func)
 
GLIB_AVAILABLE_IN_ALL GPollFunc g_main_context_get_poll_func (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_add_poll (GMainContext *context, GPollFD *fd, gint priority)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_remove_poll (GMainContext *context, GPollFD *fd)
 
GLIB_AVAILABLE_IN_ALL gint g_main_depth (void)
 
GLIB_AVAILABLE_IN_ALL GSourceg_main_current_source (void)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_push_thread_default (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_pop_thread_default (GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL GMainContextg_main_context_get_thread_default (void)
 
GLIB_AVAILABLE_IN_ALL GMainContextg_main_context_ref_thread_default (void)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS static GLIB_AVAILABLE_STATIC_INLINE_IN_2_64 GMainContextPusher * g_main_context_pusher_new (GMainContext *main_context)
 
G_GNUC_END_IGNORE_DEPRECATIONS G_GNUC_BEGIN_IGNORE_DEPRECATIONS static GLIB_AVAILABLE_STATIC_INLINE_IN_2_64 void g_main_context_pusher_free (GMainContextPusher *pusher)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL GMainLoopg_main_loop_new (GMainContext *context, gboolean is_running)
 
GLIB_AVAILABLE_IN_ALL void g_main_loop_run (GMainLoop *loop)
 
GLIB_AVAILABLE_IN_ALL void g_main_loop_quit (GMainLoop *loop)
 
GLIB_AVAILABLE_IN_ALL GMainLoopg_main_loop_ref (GMainLoop *loop)
 
GLIB_AVAILABLE_IN_ALL void g_main_loop_unref (GMainLoop *loop)
 
GLIB_AVAILABLE_IN_ALL gboolean g_main_loop_is_running (GMainLoop *loop)
 
GLIB_AVAILABLE_IN_ALL GMainContextg_main_loop_get_context (GMainLoop *loop)
 
GLIB_AVAILABLE_IN_ALL GSourceg_source_new (GSourceFuncs *source_funcs, guint struct_size)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_64 void g_source_set_dispose_function (GSource *source, GSourceDisposeFunc dispose)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL GSourceg_source_ref (GSource *source)
 
GLIB_AVAILABLE_IN_ALL void g_source_unref (GSource *source)
 
GLIB_AVAILABLE_IN_ALL guint g_source_attach (GSource *source, GMainContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_source_destroy (GSource *source)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_priority (GSource *source, gint priority)
 
GLIB_AVAILABLE_IN_ALL gint g_source_get_priority (GSource *source)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_can_recurse (GSource *source, gboolean can_recurse)
 
GLIB_AVAILABLE_IN_ALL gboolean g_source_get_can_recurse (GSource *source)
 
GLIB_AVAILABLE_IN_ALL guint g_source_get_id (GSource *source)
 
GLIB_AVAILABLE_IN_ALL GMainContextg_source_get_context (GSource *source)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_callback (GSource *source, GSourceFunc func, gpointer data, GDestroyNotify notify)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_funcs (GSource *source, GSourceFuncs *funcs)
 
GLIB_AVAILABLE_IN_ALL gboolean g_source_is_destroyed (GSource *source)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_name (GSource *source, const char *name)
 
GLIB_AVAILABLE_IN_2_70 void g_source_set_static_name (GSource *source, const char *name)
 
GLIB_AVAILABLE_IN_ALL const char * g_source_get_name (GSource *source)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_name_by_id (guint tag, const char *name)
 
GLIB_AVAILABLE_IN_2_36 void g_source_set_ready_time (GSource *source, gint64 ready_time)
 
GLIB_AVAILABLE_IN_2_36 gint64 g_source_get_ready_time (GSource *source)
 
GLIB_AVAILABLE_IN_2_36 gpointer g_source_add_unix_fd (GSource *source, gint fd, GIOCondition events)
 
GLIB_AVAILABLE_IN_2_36 void g_source_modify_unix_fd (GSource *source, gpointer tag, GIOCondition new_events)
 
GLIB_AVAILABLE_IN_2_36 void g_source_remove_unix_fd (GSource *source, gpointer tag)
 
GLIB_AVAILABLE_IN_2_36 GIOCondition g_source_query_unix_fd (GSource *source, gpointer tag)
 
GLIB_AVAILABLE_IN_ALL void g_source_set_callback_indirect (GSource *source, gpointer callback_data, GSourceCallbackFuncs *callback_funcs)
 
GLIB_AVAILABLE_IN_ALL void g_source_add_poll (GSource *source, GPollFD *fd)
 
GLIB_AVAILABLE_IN_ALL void g_source_remove_poll (GSource *source, GPollFD *fd)
 
GLIB_AVAILABLE_IN_ALL void g_source_add_child_source (GSource *source, GSource *child_source)
 
GLIB_AVAILABLE_IN_ALL void g_source_remove_child_source (GSource *source, GSource *child_source)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_source_get_current_time (GSource *source, GTimeVal *timeval)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL gint64 g_source_get_time (GSource *source)
 
GLIB_AVAILABLE_IN_ALL GSourceg_idle_source_new (void)
 
GLIB_AVAILABLE_IN_ALL GSourceg_child_watch_source_new (GPid pid)
 
GLIB_AVAILABLE_IN_ALL GSourceg_timeout_source_new (guint interval)
 
GLIB_AVAILABLE_IN_ALL GSourceg_timeout_source_new_seconds (guint interval)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_get_current_time (GTimeVal *result)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL gint64 g_get_monotonic_time (void)
 
GLIB_AVAILABLE_IN_ALL gint64 g_get_real_time (void)
 
GLIB_AVAILABLE_IN_ALL gboolean g_source_remove (guint tag)
 
GLIB_AVAILABLE_IN_ALL gboolean g_source_remove_by_user_data (gpointer user_data)
 
GLIB_AVAILABLE_IN_ALL gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, gpointer user_data)
 
GLIB_AVAILABLE_IN_2_56 void g_clear_handle_id (guint *tag_ptr, GClearHandleFunc clear_func)
 
GLIB_AVAILABLE_IN_ALL guint g_timeout_add_full (gint priority, guint interval, GSourceFunc function, gpointer data, GDestroyNotify notify)
 
GLIB_AVAILABLE_IN_ALL guint g_timeout_add (guint interval, GSourceFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_2_74 guint g_timeout_add_once (guint interval, GSourceOnceFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_ALL guint g_timeout_add_seconds_full (gint priority, guint interval, GSourceFunc function, gpointer data, GDestroyNotify notify)
 
GLIB_AVAILABLE_IN_ALL guint g_timeout_add_seconds (guint interval, GSourceFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_2_78 guint g_timeout_add_seconds_once (guint interval, GSourceOnceFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_ALL guint g_child_watch_add_full (gint priority, GPid pid, GChildWatchFunc function, gpointer data, GDestroyNotify notify)
 
GLIB_AVAILABLE_IN_ALL guint g_child_watch_add (GPid pid, GChildWatchFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_ALL guint g_idle_add (GSourceFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_ALL guint g_idle_add_full (gint priority, GSourceFunc function, gpointer data, GDestroyNotify notify)
 
GLIB_AVAILABLE_IN_2_74 guint g_idle_add_once (GSourceOnceFunc function, gpointer data)
 
GLIB_AVAILABLE_IN_ALL gboolean g_idle_remove_by_data (gpointer data)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_invoke_full (GMainContext *context, gint priority, GSourceFunc function, gpointer data, GDestroyNotify notify)
 
GLIB_AVAILABLE_IN_ALL void g_main_context_invoke (GMainContext *context, GSourceFunc function, gpointer data)
 
static GLIB_AVAILABLE_STATIC_INLINE_IN_2_70 int g_steal_fd (int *fd_ptr)
 

Variables

GLIB_AVAILABLE_TYPE_IN_2_64 typedef void(* GSourceDisposeFunc )(GSource *source)
 
GLIB_VAR GSourceFuncs g_timeout_funcs
 
GLIB_VAR GSourceFuncs g_child_watch_funcs
 
GLIB_VAR GSourceFuncs g_idle_funcs
 
GLIB_VAR GSourceFuncs g_unix_signal_funcs
 
GLIB_VAR GSourceFuncs g_unix_fd_source_funcs
 

Macro Definition Documentation

◆ g_clear_handle_id

#define g_clear_handle_id ( tag_ptr,
clear_func )
Value:
G_STATIC_ASSERT (sizeof *(tag_ptr) == sizeof (guint)); \
guint *_tag_ptr = (guint *) (tag_ptr); \
guint _handle_id; \
\
_handle_id = *_tag_ptr; \
if (_handle_id > 0) \
{ \
*_tag_ptr = 0; \
clear_func (_handle_id); \
} \
} G_STMT_END \
GLIB_AVAILABLE_MACRO_IN_2_56
#define G_STMT_START
Definition gmacros.h:989
unsigned int guint
Definition gtypes.h:61

Definition at line 854 of file gmain.h.

854#define g_clear_handle_id(tag_ptr, clear_func) \
855 G_STMT_START { \
856 G_STATIC_ASSERT (sizeof *(tag_ptr) == sizeof (guint)); \
857 guint *_tag_ptr = (guint *) (tag_ptr); \
858 guint _handle_id; \
859 \
860 _handle_id = *_tag_ptr; \
861 if (_handle_id > 0) \
862 { \
863 *_tag_ptr = 0; \
864 clear_func (_handle_id); \
865 } \
866 } G_STMT_END \
867 GLIB_AVAILABLE_MACRO_IN_2_56

◆ G_PRIORITY_DEFAULT

#define G_PRIORITY_DEFAULT   0

G_PRIORITY_DEFAULT:

Use this for default priority event sources.

In GLib this priority is used when adding timeout functions with [func@.nosp@m.GLib.nosp@m..time.nosp@m.out_.nosp@m.add]. In GDK this priority is used for events from the X server.

Definition at line 431 of file gmain.h.

◆ G_PRIORITY_DEFAULT_IDLE

#define G_PRIORITY_DEFAULT_IDLE   200

G_PRIORITY_DEFAULT_IDLE:

Use this for default priority idle functions.

In GLib this priority is used when adding idle functions with [func@.nosp@m.GLib.nosp@m..idle.nosp@m._add].

Definition at line 453 of file gmain.h.

◆ G_PRIORITY_HIGH

#define G_PRIORITY_HIGH   -100

G_PRIORITY_HIGH:

Use this for high priority event sources.

It is not used within GLib or GTK.

Definition at line 420 of file gmain.h.

◆ G_PRIORITY_HIGH_IDLE

#define G_PRIORITY_HIGH_IDLE   100

G_PRIORITY_HIGH_IDLE:

Use this for high priority idle functions.

GTK uses G_PRIORITY_HIGH_IDLE + 10 for resizing operations, and G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is done to ensure that any pending resizes are processed before any pending redraws, so that widgets are not redrawn twice unnecessarily.)

Definition at line 443 of file gmain.h.

◆ G_PRIORITY_LOW

#define G_PRIORITY_LOW   300

G_PRIORITY_LOW:

Use this for very low priority background tasks.

It is not used within GLib or GTK.

Definition at line 462 of file gmain.h.

◆ G_SOURCE_CONTINUE

#define G_SOURCE_CONTINUE   TRUE

G_SOURCE_CONTINUE:

Use this macro as the return value of a [callb.nosp@m.ack@.nosp@m.GLib..nosp@m.Sour.nosp@m.ceFun.nosp@m.c] to leave the [struc.nosp@m.t@GL.nosp@m.ib.So.nosp@m.urce] in the main loop.

Since: 2.32

Definition at line 482 of file gmain.h.

◆ G_SOURCE_FUNC

#define G_SOURCE_FUNC ( f)    ((GSourceFunc) (void (*)(void)) (f)) GLIB_AVAILABLE_MACRO_IN_2_58

G_SOURCE_FUNC: @f: a function pointer.

Cast a function pointer to a [callb.nosp@m.ack@.nosp@m.GLib..nosp@m.Sour.nosp@m.ceFun.nosp@m.c], suppressing warnings from GCC 8 onwards with -Wextra or -Wcast-function-type enabled about the function types being incompatible.

For example, the correct type of callback for a source created by [func@.nosp@m.GLib.nosp@m..chil.nosp@m.d_wa.nosp@m.tch_s.nosp@m.ourc.nosp@m.e_new] is GChildWatchFunc, which accepts more arguments than [callb.nosp@m.ack@.nosp@m.GLib..nosp@m.Sour.nosp@m.ceFun.nosp@m.c]. Casting the function with (GSourceFunc) to call [metho.nosp@m.d@GL.nosp@m.ib.So.nosp@m.urce.nosp@m..set_.nosp@m.call.nosp@m.back] will trigger a warning, even though it will be cast back to the correct type before it is called by the source.

Since: 2.58

Definition at line 232 of file gmain.h.

◆ G_SOURCE_REMOVE

#define G_SOURCE_REMOVE   FALSE

G_SOURCE_REMOVE:

Use this macro as the return value of a [callb.nosp@m.ack@.nosp@m.GLib..nosp@m.Sour.nosp@m.ceFun.nosp@m.c] to remove the [struc.nosp@m.t@GL.nosp@m.ib.So.nosp@m.urce] from the main loop.

Since: 2.32

Definition at line 472 of file gmain.h.

Typedef Documentation

◆ GChildWatchFunc

typedef void(* GChildWatchFunc) (GPid pid, gint wait_status, gpointer user_data)

GChildWatchFunc: @pid: the process id of the child process @wait_status: Status information about the child process, encoded in a platform-specific manner @user_data: user data passed to [func@.nosp@m.GLib.nosp@m..chil.nosp@m.d_wa.nosp@m.tch_a.nosp@m.dd]

Prototype of a #GChildWatchSource callback, called when a child process has exited.

To interpret @wait_status, see the documentation for [func@.nosp@m.GLib.nosp@m..spaw.nosp@m.n_ch.nosp@m.eck_w.nosp@m.ait_.nosp@m.statu.nosp@m.s]. In particular, on Unix platforms, note that it is usually not equal to the integer passed to exit() or returned from main().

Definition at line 249 of file gmain.h.

◆ GClearHandleFunc

typedef void(* GClearHandleFunc) (guint handle_id)

GClearHandleFunc: @handle_id: the handle ID to clear

Specifies the type of function passed to [func@.nosp@m.GLib.nosp@m..clea.nosp@m.r_ha.nosp@m.ndle_.nosp@m.id] The implementation is expected to free the resource identified by @handle_id; for instance, if @handle_id is a [struc.nosp@m.t@GL.nosp@m.ib.So.nosp@m.urce] ID, [func@.nosp@m.GLib.nosp@m..Sour.nosp@m.ce.r.nosp@m.emove] can be used.

Since: 2.56

Definition at line 848 of file gmain.h.

◆ GLIB_AVAILABLE_TYPE_IN_2_64

typedef void GMainContextPusher GLIB_AVAILABLE_TYPE_IN_2_64

GMainContextPusher:

Opaque type. See g_main_context_pusher_new() for details.

Since: 2.64

Definition at line 589 of file gmain.h.

◆ GMainContext

typedef struct _GMainContext GMainContext

GMainContext:

The GMainContext struct is an opaque data type representing a set of sources to be handled in a main loop.

Definition at line 70 of file gmain.h.

◆ GMainLoop

typedef struct _GMainLoop GMainLoop

GMainLoop:

The GMainLoop struct is an opaque data type representing the main event loop of a GLib or GTK application.

Definition at line 78 of file gmain.h.

◆ GSource

typedef struct _GSource GSource

GSource:

The GSource struct is an opaque data type representing an event source.

Definition at line 86 of file gmain.h.

◆ GSourceCallbackFuncs

GSourceCallbackFuncs: Called when a reference is added to the callback object @unref: Called when a reference to the callback object is dropped @get: Called to extract the callback function and data from the callback object.

The GSourceCallbackFuncs struct contains functions for managing callback objects.

Definition at line 99 of file gmain.h.

◆ GSourceDummyMarshal

typedef void(* GSourceDummyMarshal) (void)

GSourceDummyMarshal:

This is just a placeholder for GClosureMarshal, which cannot be used here for dependency reasons.

Definition at line 307 of file gmain.h.

◆ GSourceFunc

typedef gboolean(* GSourceFunc) (gpointer user_data)

GPid:

A type which is used to hold a process identification.

On UNIX, processes are identified by a process id (an integer), while Windows uses process handles (which are pointers).

GPid is used in GLib only for descendant processes spawned with the g_spawn functions. G_PID_FORMAT:

A format specifier that can be used in printf()-style format strings when printing a GPid.

Since: 2.50 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 [func@.nosp@m.GLib.nosp@m..time.nosp@m.out_.nosp@m.add], [func@.nosp@m.GLib.nosp@m..time.nosp@m.out_.nosp@m.add_f.nosp@m.ull], [func@.nosp@m.GLib.nosp@m..idle.nosp@m._add], and [func@.nosp@m.GLib.nosp@m..idle.nosp@m._add.nosp@m._full].

When calling [metho.nosp@m.d@GL.nosp@m.ib.So.nosp@m.urce.nosp@m..set_.nosp@m.call.nosp@m.back], you may need to cast a function of a different type to this type. Use [func@.nosp@m.GLib.nosp@m..SOUR.nosp@m.CE_F.nosp@m.UNC] to avoid warnings about incompatible function types.

Returns: FALSE if the source should be removed. [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.CONTI.nosp@m.NUE] and [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.REMOV.nosp@m.E] are more memorable names for the return value.

Definition at line 199 of file gmain.h.

◆ GSourceFuncs

typedef struct _GSourceFuncs GSourceFuncs

GSourceFuncs: @prepare: Called before all the file descriptors are polled. If the source can determine that it is ready here (without waiting for the results of the poll() call) it should return TRUE. It can also return a @timeout_ value which should be the maximum timeout (in milliseconds) which should be passed to the poll() call. The actual timeout used will be -1 if all sources returned -1, or it will be the minimum of all the @timeout_ values returned which were >= 0. Since 2.36 this may be NULL, in which case the effect is as if the function always returns FALSE with a timeout of -1. If @prepare returns a timeout and the source also has a ready time set, then the lower of the two will be used. @check: Called after all the file descriptors are polled. The source should return TRUE if it is ready to be dispatched. Note that some time may have passed since the previous prepare function was called, so the source should be checked again here. Since 2.36 this may be NULL, in which case the effect is as if the function always returns FALSE. @dispatch: Called to dispatch the event source, after it has returned TRUE in either its @prepare or its @check function, or if a ready time has been reached. The @dispatch function receives a callback function and user data. The callback function may be NULL if the source was never connected to a callback using [metho.nosp@m.d@GL.nosp@m.ib.So.nosp@m.urce.nosp@m..set_.nosp@m.call.nosp@m.back]. The @dispatch function should call the callback function with @user_data and whatever additional parameters are needed for this type of event source. The return value of the @dispatch function should be [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.REMOV.nosp@m.E] if the source should be removed or [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.CONTI.nosp@m.NUE] to keep it. @finalize: Called when the source is finalized. At this point, the source will have been destroyed, had its callback cleared, and have been removed from its [struc.nosp@m.t@GL.nosp@m.ib.Ma.nosp@m.inCo.nosp@m.ntext], but it will still have its final reference count, so methods can be called on it from within this function.

The GSourceFuncs struct contains a table of functions used to handle event sources in a generic manner.

For idle sources, the prepare and check functions always return TRUE to indicate that the source is always ready to be processed. The prepare function also returns a timeout value of 0 to ensure that the poll() call doesn't block (since that would be time wasted which could have been spent running the idle function).

For timeout sources, the prepare and check functions both return TRUE if the timeout interval has expired. The prepare function also returns a timeout value to ensure that the poll() call doesn't block too long and miss the next timeout.

For file descriptor sources, the prepare function typically returns FALSE, since it must wait until poll() has been called before it knows whether any events need to be processed. It sets the returned timeout to -1 to indicate that it doesn't mind how long the poll() call blocks. In the check function, it tests the results of the poll() call to see if the required condition has been met, and returns TRUE if so.

Definition at line 157 of file gmain.h.

◆ GSourceFuncsCheckFunc

typedef gboolean(* GSourceFuncsCheckFunc) (GSource *source)

GSourceFuncsCheckFunc: @source: The GSource

Checks if the source is ready to be dispatched.

Called after all the file descriptors are polled. The source should return TRUE if it is ready to be dispatched. Note that some time may have passed since the previous prepare function was called, so the source should be checked again here.

Since 2.36 this may be NULL, in which case the effect is as if the function always returns FALSE.

Returns: TRUE if ready to be dispatched, FALSE otherwise

Since: 2.82

Definition at line 354 of file gmain.h.

◆ GSourceFuncsDispatchFunc

typedef gboolean(* GSourceFuncsDispatchFunc) (GSource *source, GSourceFunc callback, gpointer user_data)

GSourceFuncsDispatchFunc: @source: The GSource @callback: (nullable): The GSourceFunc to call @user_data: (nullable): data to pass to @callback

Dispatches the source callback.

Called to dispatch the event source, after it has returned TRUE in either its prepare or its check function, or if a ready time has been reached. The dispatch function receives a callback function and user data. The callback function may be NULL if the source was never connected to a callback using [metho.nosp@m.d@GL.nosp@m.ib.So.nosp@m.urce.nosp@m..set_.nosp@m.call.nosp@m.back]. The dispatch function should call the callback function with @user_data and whatever additional parameters are needed for this type of event source. The return value of the dispatch function should be [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.REMOV.nosp@m.E] if the source should be removed or [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.CONTI.nosp@m.NUE] to keep it.

Returns: [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.REMOV.nosp@m.E] if the source should be removed, [const.nosp@m.@GLi.nosp@m.b.SOU.nosp@m.RCE_.nosp@m.CONTI.nosp@m.NUE] otherwise.

Since: 2.82

Definition at line 379 of file gmain.h.

◆ GSourceFuncsFinalizeFunc

typedef void(* GSourceFuncsFinalizeFunc) (GSource *source)

GSourceFuncsFinalizeFunc: @source: The GSource

Finalizes the source.

Called when the source is finalized. At this point, the source will have been destroyed, had its callback cleared, and have been removed from its [type@.nosp@m.GLib.nosp@m..Main.nosp@m.Cont.nosp@m.ext], but it will still have its final reference count, so methods can be called on it from within this function.

Since: 2.82

Definition at line 396 of file gmain.h.

◆ GSourceFuncsPrepareFunc

typedef gboolean(* GSourceFuncsPrepareFunc) (GSource *source, gint *timeout_)

GSourceFuncsPrepareFunc: @source: The GSource @timeout_: (out) (optional): the maximum timeout (in milliseconds) which should be passed to the poll call

Checks the source for readiness.

Called before all the file descriptors are polled. If the source can determine that it is ready here (without waiting for the results of the poll call) it should return TRUE. It can also return a @timeout_ value which should be the maximum timeout (in milliseconds) which should be passed to the poll call. The actual timeout used will be -1 if all sources returned -1, or it will be the minimum of all the @timeout_ values returned which were greater than or equal to 0. If the prepare function returns a timeout and the source also has a ready time set, then the lower of the two will be used.

Since 2.36 this may be NULL, in which case the effect is as if the function always returns FALSE with a timeout of -1.

Returns: TRUE if the source is ready, FALSE otherwise

Since: 2.82

Definition at line 333 of file gmain.h.

◆ GSourceOnceFunc

typedef void(* GSourceOnceFunc) (gpointer user_data)

GSourceOnceFunc: @user_data: data passed to the function, set when the source was created

A source function that is only called once before being removed from the main context automatically.

See: [func@.nosp@m.GLib.nosp@m..idle.nosp@m._add.nosp@m._once], [func@.nosp@m.GLib.nosp@m..time.nosp@m.out_.nosp@m.add_o.nosp@m.nce]

Since: 2.74

Definition at line 213 of file gmain.h.

◆ GSourcePrivate

typedef struct _GSourcePrivate GSourcePrivate

Definition at line 87 of file gmain.h.

Enumeration Type Documentation

◆ GIOCondition

Enumerator
GLIB_SYSDEF_POLLIN 
GLIB_SYSDEF_POLLOUT 
GLIB_SYSDEF_POLLPRI 
GLIB_SYSDEF_POLLERR 
GLIB_SYSDEF_POLLHUP 
GLIB_SYSDEF_POLLNVAL 

Definition at line 33 of file gmain.h.

34{
35 G_IO_IN GLIB_SYSDEF_POLLIN,
36 G_IO_OUT GLIB_SYSDEF_POLLOUT,
37 G_IO_PRI GLIB_SYSDEF_POLLPRI,
38 G_IO_ERR GLIB_SYSDEF_POLLERR,
39 G_IO_HUP GLIB_SYSDEF_POLLHUP,
40 G_IO_NVAL GLIB_SYSDEF_POLLNVAL
GIOCondition
Definition gmain.h:34
@ GLIB_SYSDEF_POLLERR
Definition gmain.h:38
@ GLIB_SYSDEF_POLLOUT
Definition gmain.h:36
@ GLIB_SYSDEF_POLLHUP
Definition gmain.h:39
@ GLIB_SYSDEF_POLLPRI
Definition gmain.h:37
@ GLIB_SYSDEF_POLLNVAL
Definition gmain.h:40
@ GLIB_SYSDEF_POLLIN
Definition gmain.h:35

◆ GMainContextFlags

GMainContextFlags: @G_MAIN_CONTEXT_FLAGS_NONE: Default behaviour. @G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING: Assume that polling for events will free the thread to process other jobs. That's useful if you're using g_main_context_{prepare,query,check,dispatch} to integrate GMainContext in other event loops.

Flags to pass to [ctor@.nosp@m.GLib.nosp@m..Main.nosp@m.Cont.nosp@m.ext.n.nosp@m.ew_w.nosp@m.ith_f.nosp@m.lags] which affect the behaviour of a [struc.nosp@m.t@GL.nosp@m.ib.Ma.nosp@m.inCo.nosp@m.ntext].

Since: 2.72

Enumerator
G_MAIN_CONTEXT_FLAGS_NONE 
G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING 

Definition at line 57 of file gmain.h.

58{
GMainContextFlags
Definition gmain.h:58
@ G_MAIN_CONTEXT_FLAGS_NONE
Definition gmain.h:59
@ G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING
Definition gmain.h:60

Function Documentation

◆ g_child_watch_add()

GLIB_AVAILABLE_IN_ALL guint g_child_watch_add ( GPid pid,
GChildWatchFunc function,
gpointer data )

◆ g_child_watch_add_full()

GLIB_AVAILABLE_IN_ALL guint g_child_watch_add_full ( gint priority,
GPid pid,
GChildWatchFunc function,
gpointer data,
GDestroyNotify notify )

◆ g_child_watch_source_new()

GLIB_AVAILABLE_IN_ALL GSource * g_child_watch_source_new ( GPid pid)

◆ g_clear_handle_id()

GLIB_AVAILABLE_IN_2_56 void g_clear_handle_id ( guint * tag_ptr,
GClearHandleFunc clear_func )

◆ g_get_current_time()

G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_get_current_time ( GTimeVal * result)

◆ g_get_monotonic_time()

◆ g_get_real_time()

GLIB_AVAILABLE_IN_ALL gint64 g_get_real_time ( void )

◆ g_idle_add()

GLIB_AVAILABLE_IN_ALL guint g_idle_add ( GSourceFunc function,
gpointer data )

◆ g_idle_add_full()

GLIB_AVAILABLE_IN_ALL guint g_idle_add_full ( gint priority,
GSourceFunc function,
gpointer data,
GDestroyNotify notify )

◆ g_idle_add_once()

GLIB_AVAILABLE_IN_2_74 guint g_idle_add_once ( GSourceOnceFunc function,
gpointer data )

◆ g_idle_remove_by_data()

GLIB_AVAILABLE_IN_ALL gboolean g_idle_remove_by_data ( gpointer data)

◆ g_idle_source_new()

GLIB_AVAILABLE_IN_ALL GSource * g_idle_source_new ( void )

◆ g_main_context_acquire()

GLIB_AVAILABLE_IN_ALL gboolean g_main_context_acquire ( GMainContext * context)

◆ g_main_context_add_poll()

GLIB_AVAILABLE_IN_ALL void g_main_context_add_poll ( GMainContext * context,
GPollFD * fd,
gint priority )

◆ g_main_context_check()

GLIB_AVAILABLE_IN_ALL gboolean g_main_context_check ( GMainContext * context,
gint max_priority,
GPollFD * fds,
gint n_fds )

◆ g_main_context_default()

GLIB_AVAILABLE_IN_ALL GMainContext * g_main_context_default ( void )

◆ g_main_context_dispatch()

GLIB_AVAILABLE_IN_ALL void g_main_context_dispatch ( GMainContext * context)

◆ g_main_context_find_source_by_funcs_user_data()

GLIB_AVAILABLE_IN_ALL GSource * g_main_context_find_source_by_funcs_user_data ( GMainContext * context,
GSourceFuncs * funcs,
gpointer user_data )

◆ g_main_context_find_source_by_id()

GLIB_AVAILABLE_IN_ALL GSource * g_main_context_find_source_by_id ( GMainContext * context,
guint source_id )

◆ g_main_context_find_source_by_user_data()

GLIB_AVAILABLE_IN_ALL GSource * g_main_context_find_source_by_user_data ( GMainContext * context,
gpointer user_data )

◆ g_main_context_get_poll_func()

GLIB_AVAILABLE_IN_ALL GPollFunc g_main_context_get_poll_func ( GMainContext * context)

◆ g_main_context_get_thread_default()

GLIB_AVAILABLE_IN_ALL GMainContext * g_main_context_get_thread_default ( void )

◆ g_main_context_invoke()

GLIB_AVAILABLE_IN_ALL void g_main_context_invoke ( GMainContext * context,
GSourceFunc function,
gpointer data )

◆ g_main_context_invoke_full()

GLIB_AVAILABLE_IN_ALL void g_main_context_invoke_full ( GMainContext * context,
gint priority,
GSourceFunc function,
gpointer data,
GDestroyNotify notify )

◆ g_main_context_is_owner()

GLIB_AVAILABLE_IN_ALL gboolean g_main_context_is_owner ( GMainContext * context)

◆ g_main_context_iteration()

GLIB_AVAILABLE_IN_ALL gboolean g_main_context_iteration ( GMainContext * context,
gboolean may_block )

◆ g_main_context_new()

GLIB_AVAILABLE_IN_ALL GMainContext * g_main_context_new ( void )

◆ g_main_context_new_with_flags()

◆ g_main_context_pending()

GLIB_AVAILABLE_IN_ALL gboolean g_main_context_pending ( GMainContext * context)

◆ g_main_context_pop_thread_default()

GLIB_AVAILABLE_IN_ALL void g_main_context_pop_thread_default ( GMainContext * context)

◆ g_main_context_prepare()

GLIB_AVAILABLE_IN_ALL gboolean g_main_context_prepare ( GMainContext * context,
gint * priority )

◆ g_main_context_push_thread_default()

GLIB_AVAILABLE_IN_ALL void g_main_context_push_thread_default ( GMainContext * context)

◆ g_main_context_pusher_free()

G_GNUC_END_IGNORE_DEPRECATIONS G_GNUC_BEGIN_IGNORE_DEPRECATIONS static GLIB_AVAILABLE_STATIC_INLINE_IN_2_64 void g_main_context_pusher_free ( GMainContextPusher * pusher)
inlinestatic

g_main_context_pusher_free: @pusher: (transfer full): a #GMainContextPusher

Pop @pusher’s main context as the thread default main context. See g_main_context_pusher_new() for details.

This will pop the [struc.nosp@m.t@GL.nosp@m.ib.Ma.nosp@m.inCo.nosp@m.ntext] as the current thread-default main context, but will not call [metho.nosp@m.d@GL.nosp@m.ib.Ma.nosp@m.inCo.nosp@m.ntext.nosp@m..unr.nosp@m.ef] on it.

Since: 2.64

Definition at line 661 of file gmain.h.

662{
664}
struct _GMainContext GMainContext
Definition gmain.h:70
GLIB_AVAILABLE_IN_ALL void g_main_context_pop_thread_default(GMainContext *context)

References g_main_context_pop_thread_default().

◆ g_main_context_pusher_new()

G_GNUC_BEGIN_IGNORE_DEPRECATIONS static GLIB_AVAILABLE_STATIC_INLINE_IN_2_64 GMainContextPusher * g_main_context_pusher_new ( GMainContext * main_context)
inlinestatic

g_main_context_pusher_new: @main_context: (transfer none): a main context to push

Push @main_context as the new thread-default main context for the current thread, using [metho.nosp@m.d@GL.nosp@m.ib.Ma.nosp@m.inCo.nosp@m.ntext.nosp@m..pus.nosp@m.h_thr.nosp@m.ead_.nosp@m.defau.nosp@m.lt], and return a new [alias.nosp@m.@GLi.nosp@m.b.Mai.nosp@m.nCon.nosp@m.textP.nosp@m.ushe.nosp@m.r]. Pop with g_main_context_pusher_free(). Using [metho.nosp@m.d@GL.nosp@m.ib.Ma.nosp@m.inCo.nosp@m.ntext.nosp@m..pop.nosp@m._thre.nosp@m.ad_d.nosp@m.efaul.nosp@m.t] on @main_context while a [alias.nosp@m.@GLi.nosp@m.b.Mai.nosp@m.nCon.nosp@m.textP.nosp@m.ushe.nosp@m.r] exists for it can lead to undefined behaviour.

Using two [alias.nosp@m.@GLi.nosp@m.b.Mai.nosp@m.nCon.nosp@m.textP.nosp@m.ushe.nosp@m.r]s in the same scope is not allowed, as it leads to an undefined pop order.

This is intended to be used with g_autoptr(). Note that g_autoptr() is only available when using GCC or clang, so the following example will only work with those compilers: |[ typedef struct { ... GMainContext *context; ... } MyObject;

static void my_object_do_stuff (MyObject *self) { g_autoptr(GMainContextPusher) pusher = g_main_context_pusher_new (self->context);

// Code with main context as the thread default here

if (cond) // No need to pop return;

// Optionally early pop g_clear_pointer (&pusher, g_main_context_pusher_free);

// Code with main context no longer the thread default here } ]|

Returns: (transfer full): a #GMainContextPusher Since: 2.64

Definition at line 639 of file gmain.h.

640{
642 return (GMainContextPusher *) main_context;
643}
GLIB_AVAILABLE_IN_ALL void g_main_context_push_thread_default(GMainContext *context)

References g_main_context_push_thread_default().

◆ g_main_context_query()

GLIB_AVAILABLE_IN_ALL gint g_main_context_query ( GMainContext * context,
gint max_priority,
gint * timeout_,
GPollFD * fds,
gint n_fds )

◆ g_main_context_ref()

◆ g_main_context_ref_thread_default()

GLIB_AVAILABLE_IN_ALL GMainContext * g_main_context_ref_thread_default ( void )

◆ g_main_context_release()

GLIB_AVAILABLE_IN_ALL void g_main_context_release ( GMainContext * context)

◆ g_main_context_remove_poll()

GLIB_AVAILABLE_IN_ALL void g_main_context_remove_poll ( GMainContext * context,
GPollFD * fd )

◆ g_main_context_set_poll_func()

GLIB_AVAILABLE_IN_ALL void g_main_context_set_poll_func ( GMainContext * context,
GPollFunc func )

◆ g_main_context_unref()

GLIB_AVAILABLE_IN_ALL void g_main_context_unref ( GMainContext * context)

◆ g_main_context_wait()

gboolean g_main_context_wait ( GMainContext * context,
GCond * cond,
GMutex * mutex )

◆ g_main_context_wakeup()

GLIB_AVAILABLE_IN_ALL void g_main_context_wakeup ( GMainContext * context)

◆ g_main_current_source()

GLIB_AVAILABLE_IN_ALL GSource * g_main_current_source ( void )

◆ g_main_depth()

GLIB_AVAILABLE_IN_ALL gint g_main_depth ( void )

◆ g_main_loop_get_context()

GLIB_AVAILABLE_IN_ALL GMainContext * g_main_loop_get_context ( GMainLoop * loop)

◆ g_main_loop_is_running()

GLIB_AVAILABLE_IN_ALL gboolean g_main_loop_is_running ( GMainLoop * loop)

◆ g_main_loop_new()

◆ g_main_loop_quit()

GLIB_AVAILABLE_IN_ALL void g_main_loop_quit ( GMainLoop * loop)

◆ g_main_loop_ref()

GLIB_AVAILABLE_IN_ALL GMainLoop * g_main_loop_ref ( GMainLoop * loop)

◆ g_main_loop_run()

GLIB_AVAILABLE_IN_ALL void g_main_loop_run ( GMainLoop * loop)

◆ g_main_loop_unref()

GLIB_AVAILABLE_IN_ALL void g_main_loop_unref ( GMainLoop * loop)

◆ g_source_add_child_source()

GLIB_AVAILABLE_IN_ALL void g_source_add_child_source ( GSource * source,
GSource * child_source )

◆ g_source_add_poll()

GLIB_AVAILABLE_IN_ALL void g_source_add_poll ( GSource * source,
GPollFD * fd )

◆ g_source_add_unix_fd()

GLIB_AVAILABLE_IN_2_36 gpointer g_source_add_unix_fd ( GSource * source,
gint fd,
GIOCondition events )

◆ g_source_attach()

GLIB_AVAILABLE_IN_ALL guint g_source_attach ( GSource * source,
GMainContext * context )

◆ g_source_destroy()

GLIB_AVAILABLE_IN_ALL void g_source_destroy ( GSource * source)

◆ g_source_get_can_recurse()

GLIB_AVAILABLE_IN_ALL gboolean g_source_get_can_recurse ( GSource * source)

◆ g_source_get_context()

GLIB_AVAILABLE_IN_ALL GMainContext * g_source_get_context ( GSource * source)

◆ g_source_get_current_time()

G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_source_get_current_time ( GSource * source,
GTimeVal * timeval )

◆ g_source_get_id()

GLIB_AVAILABLE_IN_ALL guint g_source_get_id ( GSource * source)

◆ g_source_get_name()

GLIB_AVAILABLE_IN_ALL const char * g_source_get_name ( GSource * source)

◆ g_source_get_priority()

GLIB_AVAILABLE_IN_ALL gint g_source_get_priority ( GSource * source)

◆ g_source_get_ready_time()

GLIB_AVAILABLE_IN_2_36 gint64 g_source_get_ready_time ( GSource * source)

◆ g_source_get_time()

◆ g_source_is_destroyed()

GLIB_AVAILABLE_IN_ALL gboolean g_source_is_destroyed ( GSource * source)

◆ g_source_modify_unix_fd()

GLIB_AVAILABLE_IN_2_36 void g_source_modify_unix_fd ( GSource * source,
gpointer tag,
GIOCondition new_events )

◆ g_source_new()

GLIB_AVAILABLE_IN_ALL GSource * g_source_new ( GSourceFuncs * source_funcs,
guint struct_size )

◆ g_source_query_unix_fd()

GLIB_AVAILABLE_IN_2_36 GIOCondition g_source_query_unix_fd ( GSource * source,
gpointer tag )

◆ g_source_ref()

◆ g_source_remove()

GLIB_AVAILABLE_IN_ALL gboolean g_source_remove ( guint tag)

◆ g_source_remove_by_funcs_user_data()

GLIB_AVAILABLE_IN_ALL gboolean g_source_remove_by_funcs_user_data ( GSourceFuncs * funcs,
gpointer user_data )

◆ g_source_remove_by_user_data()

GLIB_AVAILABLE_IN_ALL gboolean g_source_remove_by_user_data ( gpointer user_data)

◆ g_source_remove_child_source()

GLIB_AVAILABLE_IN_ALL void g_source_remove_child_source ( GSource * source,
GSource * child_source )

◆ g_source_remove_poll()

GLIB_AVAILABLE_IN_ALL void g_source_remove_poll ( GSource * source,
GPollFD * fd )

◆ g_source_remove_unix_fd()

GLIB_AVAILABLE_IN_2_36 void g_source_remove_unix_fd ( GSource * source,
gpointer tag )

◆ g_source_set_callback()

GLIB_AVAILABLE_IN_ALL void g_source_set_callback ( GSource * source,
GSourceFunc func,
gpointer data,
GDestroyNotify notify )

◆ g_source_set_callback_indirect()

GLIB_AVAILABLE_IN_ALL void g_source_set_callback_indirect ( GSource * source,
gpointer callback_data,
GSourceCallbackFuncs * callback_funcs )

◆ g_source_set_can_recurse()

GLIB_AVAILABLE_IN_ALL void g_source_set_can_recurse ( GSource * source,
gboolean can_recurse )

◆ g_source_set_dispose_function()

G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_64 void g_source_set_dispose_function ( GSource * source,
GSourceDisposeFunc dispose )

◆ g_source_set_funcs()

GLIB_AVAILABLE_IN_ALL void g_source_set_funcs ( GSource * source,
GSourceFuncs * funcs )

◆ g_source_set_name()

GLIB_AVAILABLE_IN_ALL void g_source_set_name ( GSource * source,
const char * name )

◆ g_source_set_name_by_id()

GLIB_AVAILABLE_IN_ALL void g_source_set_name_by_id ( guint tag,
const char * name )

◆ g_source_set_priority()

GLIB_AVAILABLE_IN_ALL void g_source_set_priority ( GSource * source,
gint priority )

◆ g_source_set_ready_time()

GLIB_AVAILABLE_IN_2_36 void g_source_set_ready_time ( GSource * source,
gint64 ready_time )

◆ g_source_set_static_name()

GLIB_AVAILABLE_IN_2_70 void g_source_set_static_name ( GSource * source,
const char * name )

◆ g_source_unref()

GLIB_AVAILABLE_IN_ALL void g_source_unref ( GSource * source)

◆ g_steal_fd()

static GLIB_AVAILABLE_STATIC_INLINE_IN_2_70 int g_steal_fd ( int * fd_ptr)
inlinestatic

Definition at line 935 of file gmain.h.

936{
937 int fd = *fd_ptr;
938 *fd_ptr = -1;
939 return fd;
940}

Referenced by g_unix_pipe_steal().

◆ g_timeout_add()

GLIB_AVAILABLE_IN_ALL guint g_timeout_add ( guint interval,
GSourceFunc function,
gpointer data )

◆ g_timeout_add_full()

GLIB_AVAILABLE_IN_ALL guint g_timeout_add_full ( gint priority,
guint interval,
GSourceFunc function,
gpointer data,
GDestroyNotify notify )

◆ g_timeout_add_once()

GLIB_AVAILABLE_IN_2_74 guint g_timeout_add_once ( guint interval,
GSourceOnceFunc function,
gpointer data )

◆ g_timeout_add_seconds()

GLIB_AVAILABLE_IN_ALL guint g_timeout_add_seconds ( guint interval,
GSourceFunc function,
gpointer data )

◆ g_timeout_add_seconds_full()

GLIB_AVAILABLE_IN_ALL guint g_timeout_add_seconds_full ( gint priority,
guint interval,
GSourceFunc function,
gpointer data,
GDestroyNotify notify )

◆ g_timeout_add_seconds_once()

GLIB_AVAILABLE_IN_2_78 guint g_timeout_add_seconds_once ( guint interval,
GSourceOnceFunc function,
gpointer data )

◆ g_timeout_source_new()

GLIB_AVAILABLE_IN_ALL GSource * g_timeout_source_new ( guint interval)

◆ g_timeout_source_new_seconds()

GLIB_AVAILABLE_IN_ALL GSource * g_timeout_source_new_seconds ( guint interval)

Variable Documentation

◆ g_child_watch_funcs

GLIB_VAR GSourceFuncs g_child_watch_funcs

Definition at line 944 of file gmain.h.

◆ g_idle_funcs

GLIB_VAR GSourceFuncs g_idle_funcs

Definition at line 945 of file gmain.h.

◆ g_timeout_funcs

GLIB_VAR GSourceFuncs g_timeout_funcs

Definition at line 943 of file gmain.h.

◆ g_unix_fd_source_funcs

GLIB_VAR GSourceFuncs g_unix_fd_source_funcs

Definition at line 948 of file gmain.h.

◆ g_unix_signal_funcs

GLIB_VAR GSourceFuncs g_unix_signal_funcs

Definition at line 947 of file gmain.h.

◆ GSourceDisposeFunc

GLIB_AVAILABLE_TYPE_IN_2_64 typedef void(* GSourceDisposeFunc) (GSource *source) ( GSource * source)

GSourceDisposeFunc: @source: GSource that is currently being disposed

Dispose function for @source. See [metho.nosp@m.d@GL.nosp@m.ib.So.nosp@m.urce.nosp@m..set_.nosp@m.disp.nosp@m.ose_f.nosp@m.unct.nosp@m.ion] for details.

Since: 2.64

Definition at line 264 of file gmain.h.