dbus-mainloop.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-mainloop.h  Main loop utility
00003  *
00004  * Copyright (C) 2003  Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.1
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 #ifndef DBUS_MAINLOOP_H
00025 #define DBUS_MAINLOOP_H
00026 
00027 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00028 
00029 #include <dbus/dbus.h>
00030 
00031 typedef struct DBusLoop DBusLoop;
00032 
00033 typedef dbus_bool_t (* DBusWatchFunction)   (DBusWatch     *watch,
00034                                              unsigned int   condition,
00035                                              void          *data);
00036 typedef void        (* DBusTimeoutFunction) (DBusTimeout   *timeout,
00037                                              void          *data);
00038 
00039 DBusLoop*   _dbus_loop_new            (void);
00040 DBusLoop*   _dbus_loop_ref            (DBusLoop            *loop);
00041 void        _dbus_loop_unref          (DBusLoop            *loop);
00042 dbus_bool_t _dbus_loop_add_watch      (DBusLoop            *loop,
00043                                        DBusWatch           *watch,
00044                                        DBusWatchFunction    function,
00045                                        void                *data,
00046                                        DBusFreeFunction     free_data_func);
00047 void        _dbus_loop_remove_watch   (DBusLoop            *loop,
00048                                        DBusWatch           *watch,
00049                                        DBusWatchFunction    function,
00050                                        void                *data);
00051 dbus_bool_t _dbus_loop_add_timeout    (DBusLoop            *loop,
00052                                        DBusTimeout         *timeout,
00053                                        DBusTimeoutFunction  function,
00054                                        void                *data,
00055                                        DBusFreeFunction     free_data_func);
00056 void        _dbus_loop_remove_timeout (DBusLoop            *loop,
00057                                        DBusTimeout         *timeout,
00058                                        DBusTimeoutFunction  function,
00059                                        void                *data);
00060 
00061 dbus_bool_t _dbus_loop_queue_dispatch (DBusLoop            *loop,
00062                                        DBusConnection      *connection);
00063 
00064 void        _dbus_loop_run            (DBusLoop            *loop);
00065 void        _dbus_loop_quit           (DBusLoop            *loop);
00066 dbus_bool_t _dbus_loop_iterate        (DBusLoop            *loop,
00067                                        dbus_bool_t          block);
00068 dbus_bool_t _dbus_loop_dispatch       (DBusLoop            *loop);
00069 
00070 int  _dbus_get_oom_wait    (void);
00071 void _dbus_wait_for_memory (void);
00072 
00073 #endif /* !DOXYGEN_SHOULD_SKIP_THIS */
00074 
00075 #endif /* DBUS_MAINLOOP_H */
00076 

Generated on Fri Sep 21 18:12:12 2007 for D-Bus by  doxygen 1.5.1