dbus-mainloop.h 2.69 KB
Newer Older
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
Havoc Pennington's avatar
Havoc Pennington committed
2 3 4 5
/* dbus-mainloop.h  Main loop utility
 *
 * Copyright (C) 2003  Red Hat, Inc.
 *
6
 * Licensed under the Academic Free License version 2.1
Havoc Pennington's avatar
Havoc Pennington committed
7 8 9 10 11 12 13 14 15 16 17 18 19
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Havoc Pennington's avatar
Havoc Pennington committed
21 22 23 24 25 26
 *
 */

#ifndef DBUS_MAINLOOP_H
#define DBUS_MAINLOOP_H

27 28
#ifndef DOXYGEN_SHOULD_SKIP_THIS

Havoc Pennington's avatar
Havoc Pennington committed
29 30 31 32 33 34 35 36 37
#include <dbus/dbus.h>

typedef struct DBusLoop DBusLoop;

typedef dbus_bool_t (* DBusWatchFunction)   (DBusWatch     *watch,
                                             unsigned int   condition,
                                             void          *data);

DBusLoop*   _dbus_loop_new            (void);
38
DBusLoop*   _dbus_loop_ref            (DBusLoop            *loop);
Havoc Pennington's avatar
Havoc Pennington committed
39 40
void        _dbus_loop_unref          (DBusLoop            *loop);
dbus_bool_t _dbus_loop_add_watch      (DBusLoop            *loop,
41
                                       DBusWatch           *watch);
Havoc Pennington's avatar
Havoc Pennington committed
42
void        _dbus_loop_remove_watch   (DBusLoop            *loop,
43
                                       DBusWatch           *watch);
44 45
void        _dbus_loop_toggle_watch   (DBusLoop            *loop,
                                       DBusWatch           *watch);
Havoc Pennington's avatar
Havoc Pennington committed
46
dbus_bool_t _dbus_loop_add_timeout    (DBusLoop            *loop,
47
                                       DBusTimeout         *timeout);
Havoc Pennington's avatar
Havoc Pennington committed
48
void        _dbus_loop_remove_timeout (DBusLoop            *loop,
49
                                       DBusTimeout         *timeout);
50 51 52 53

dbus_bool_t _dbus_loop_queue_dispatch (DBusLoop            *loop,
                                       DBusConnection      *connection);

Havoc Pennington's avatar
Havoc Pennington committed
54 55 56 57
void        _dbus_loop_run            (DBusLoop            *loop);
void        _dbus_loop_quit           (DBusLoop            *loop);
dbus_bool_t _dbus_loop_iterate        (DBusLoop            *loop,
                                       dbus_bool_t          block);
58
dbus_bool_t _dbus_loop_dispatch       (DBusLoop            *loop);
Havoc Pennington's avatar
Havoc Pennington committed
59 60 61 62

int  _dbus_get_oom_wait    (void);
void _dbus_wait_for_memory (void);

63
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
64

Havoc Pennington's avatar
Havoc Pennington committed
65
#endif /* DBUS_MAINLOOP_H */
66