D-Bus  1.16.2
dbus-mainloop.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-mainloop.h Main loop utility
3  *
4  * Copyright (C) 2003 Red Hat, Inc.
5  *
6  * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
7  *
8  * Licensed under the Academic Free License version 2.1
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 #ifndef DBUS_MAINLOOP_H
27 #define DBUS_MAINLOOP_H
28 
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 
31 #include <dbus/dbus.h>
32 
33 typedef struct DBusLoop DBusLoop;
34 
35 typedef dbus_bool_t (* DBusWatchFunction) (DBusWatch *watch,
36  unsigned int condition,
37  void *data);
38 
39 DBusLoop* _dbus_loop_new (void);
40 DBusLoop* _dbus_loop_ref (DBusLoop *loop);
41 void _dbus_loop_unref (DBusLoop *loop);
42 dbus_bool_t _dbus_loop_add_watch (DBusLoop *loop,
43  DBusWatch *watch);
44 void _dbus_loop_remove_watch (DBusLoop *loop,
45  DBusWatch *watch);
46 void _dbus_loop_toggle_watch (DBusLoop *loop,
47  DBusWatch *watch);
48 dbus_bool_t _dbus_loop_add_timeout (DBusLoop *loop,
49  DBusTimeout *timeout);
50 void _dbus_loop_remove_timeout (DBusLoop *loop,
51  DBusTimeout *timeout);
52 
53 dbus_bool_t _dbus_loop_queue_dispatch (DBusLoop *loop,
54  DBusConnection *connection);
55 
56 void _dbus_loop_run (DBusLoop *loop);
57 void _dbus_loop_quit (DBusLoop *loop);
58 dbus_bool_t _dbus_loop_iterate (DBusLoop *loop,
59  dbus_bool_t block);
60 dbus_bool_t _dbus_loop_dispatch (DBusLoop *loop);
61 
62 int _dbus_get_oom_wait (void);
63 void _dbus_wait_for_memory (void);
64 
65 static inline void
66 _dbus_clear_loop (DBusLoop **pointer_to_loop)
67 {
68  _dbus_clear_pointer_impl (DBusLoop, pointer_to_loop,
69  _dbus_loop_unref);
70 }
71 
72 #endif /* !DOXYGEN_SHOULD_SKIP_THIS */
73 
74 #endif /* DBUS_MAINLOOP_H */
Internals of DBusTimeout.
Definition: dbus-timeout.c:42
Implementation of DBusWatch.
Definition: dbus-watch.c:42
Implementation details of DBusConnection.
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:37