1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-mainloop.h Main loop utility
4 * Copyright (C) 2003 Red Hat, Inc.
6 * Licensed under the Academic Free License version 1.2
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef DBUS_MAINLOOP_H
25 #define DBUS_MAINLOOP_H
27 #include <dbus/dbus.h>
29 typedef struct DBusLoop DBusLoop;
31 typedef dbus_bool_t (* DBusWatchFunction) (DBusWatch *watch,
32 unsigned int condition,
34 typedef void (* DBusTimeoutFunction) (DBusTimeout *timeout,
37 DBusLoop* _dbus_loop_new (void);
38 void _dbus_loop_ref (DBusLoop *loop);
39 void _dbus_loop_unref (DBusLoop *loop);
40 dbus_bool_t _dbus_loop_add_watch (DBusLoop *loop,
42 DBusWatchFunction function,
44 DBusFreeFunction free_data_func);
45 void _dbus_loop_remove_watch (DBusLoop *loop,
47 DBusWatchFunction function,
49 dbus_bool_t _dbus_loop_add_timeout (DBusLoop *loop,
51 DBusTimeoutFunction function,
53 DBusFreeFunction free_data_func);
54 void _dbus_loop_remove_timeout (DBusLoop *loop,
56 DBusTimeoutFunction function,
59 dbus_bool_t _dbus_loop_queue_dispatch (DBusLoop *loop,
60 DBusConnection *connection);
62 void _dbus_loop_run (DBusLoop *loop);
63 void _dbus_loop_quit (DBusLoop *loop);
64 dbus_bool_t _dbus_loop_iterate (DBusLoop *loop,
66 dbus_bool_t _dbus_loop_dispatch (DBusLoop *loop);
68 int _dbus_get_oom_wait (void);
69 void _dbus_wait_for_memory (void);
71 #endif /* DBUS_MAINLOOP_H */