1/* GLIB - Library of useful routines for C programming
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20/*
21 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GLib Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GLib at ftp://ftp.gtk.org/pub/gtk/.
25 */
26
27#ifndef __G_DEPRECATED_MAIN_H__
28#define __G_DEPRECATED_MAIN_H__
29
30#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
31#error "Only <glib.h> can be included directly."
32#endif
33
34#include <glib/gmain.h>
35
36G_BEGIN_DECLS
37
38/* ============== Compat main loop stuff ================== */
39
40/**
41 * g_main_new:
42 * @is_running: set to %TRUE to indicate that the loop is running. This
43 * is not very important since calling g_main_run() will set this
44 * to %TRUE anyway.
45 *
46 * Creates a new #GMainLoop for th default main context.
47 *
48 * Returns: a new #GMainLoop
49 *
50 * Deprecated: 2.2: Use g_main_loop_new() instead
51 */
52#define g_main_new(is_running) g_main_loop_new (NULL, is_running) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_new)
53
54/**
55 * g_main_run:
56 * @loop: a #GMainLoop
57 *
58 * Runs a main loop until it stops running.
59 *
60 * Deprecated: 2.2: Use g_main_loop_run() instead
61 */
62#define g_main_run(loop) g_main_loop_run(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_run)
63
64/**
65 * g_main_quit:
66 * @loop: a #GMainLoop
67 *
68 * Stops the #GMainLoop.
69 * If g_main_run() was called to run the #GMainLoop, it will now return.
70 *
71 * Deprecated: 2.2: Use g_main_loop_quit() instead
72 */
73#define g_main_quit(loop) g_main_loop_quit(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_quit)
74
75/**
76 * g_main_destroy:
77 * @loop: a #GMainLoop
78 *
79 * Frees the memory allocated for the #GMainLoop.
80 *
81 * Deprecated: 2.2: Use g_main_loop_unref() instead
82 */
83#define g_main_destroy(loop) g_main_loop_unref(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_unref)
84
85/**
86 * g_main_is_running:
87 * @loop: a #GMainLoop
88 *
89 * Checks if the main loop is running.
90 *
91 * Returns: %TRUE if the main loop is running
92 *
93 * Deprecated: 2.2: Use g_main_loop_is_running() instead
94 */
95#define g_main_is_running(loop) g_main_loop_is_running(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_is_running)
96
97/**
98 * g_main_iteration:
99 * @may_block: set to %TRUE if it should block (i.e. wait) until an event
100 * source becomes ready. It will return after an event source has been
101 * processed. If set to %FALSE it will return immediately if no event
102 * source is ready to be processed.
103 *
104 * Runs a single iteration for the default #GMainContext.
105 *
106 * Returns: %TRUE if more events are pending.
107 *
108 * Deprecated: 2.2: Use g_main_context_iteration() instead.
109 */
110#define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_iteration)
111
112/**
113 * g_main_pending:
114 *
115 * Checks if any events are pending for the default #GMainContext
116 * (i.e. ready to be processed).
117 *
118 * Returns: %TRUE if any events are pending.
119 *
120 * Deprecated: 2.2: Use g_main_context_pending() instead.
121 */
122#define g_main_pending() g_main_context_pending (NULL) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_pending)
123
124/**
125 * g_main_set_poll_func:
126 * @func: the function to call to poll all file descriptors
127 *
128 * Sets the function to use for the handle polling of file descriptors
129 * for the default main context.
130 *
131 * Deprecated: 2.2: Use g_main_context_set_poll_func() again
132 */
133#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_set_poll_func)
134
135G_END_DECLS
136
137#endif /* __G_DEPRECATED_MAIN_H__ */
138