dbus-watch.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-watch.h DBusWatch internal interfaces
00003  *
00004  * Copyright (C) 2002  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 #ifndef DBUS_WATCH_H
00024 #define DBUS_WATCH_H
00025 
00026 #include <dbus/dbus-internals.h>
00027 #include <dbus/dbus-connection.h>
00028 
00029 DBUS_BEGIN_DECLS
00030 
00036 /* Public methods on DBusWatch are in dbus-connection.h */
00037 
00038 typedef struct DBusWatchList DBusWatchList;
00039 
00041 typedef dbus_bool_t (* DBusWatchHandler) (DBusWatch    *watch,
00042                                           unsigned int  flags,
00043                                           void         *data);
00044 
00045 DBusWatch* _dbus_watch_new                (int               fd,
00046                                            unsigned int      flags,
00047                                            dbus_bool_t       enabled,
00048                                            DBusWatchHandler  handler,
00049                                            void             *data,
00050                                            DBusFreeFunction  free_data_function);
00051 DBusWatch* _dbus_watch_ref                (DBusWatch        *watch);
00052 void       _dbus_watch_unref              (DBusWatch        *watch);
00053 void       _dbus_watch_invalidate         (DBusWatch        *watch);
00054 void       _dbus_watch_sanitize_condition (DBusWatch        *watch,
00055                                            unsigned int     *condition);
00056 void       _dbus_watch_set_handler        (DBusWatch        *watch,
00057                                            DBusWatchHandler  handler,
00058                                            void             *data,
00059                                            DBusFreeFunction  free_data_function);
00060 
00061 
00062 DBusWatchList* _dbus_watch_list_new           (void);
00063 void           _dbus_watch_list_free          (DBusWatchList           *watch_list);
00064 dbus_bool_t    _dbus_watch_list_set_functions (DBusWatchList           *watch_list,
00065                                                DBusAddWatchFunction     add_function,
00066                                                DBusRemoveWatchFunction  remove_function,
00067                                                DBusWatchToggledFunction toggled_function,
00068                                                void                    *data,
00069                                                DBusFreeFunction         free_data_function);
00070 dbus_bool_t    _dbus_watch_list_add_watch     (DBusWatchList           *watch_list,
00071                                                DBusWatch               *watch);
00072 void           _dbus_watch_list_remove_watch  (DBusWatchList           *watch_list,
00073                                                DBusWatch               *watch);
00074 void           _dbus_watch_list_toggle_watch  (DBusWatchList           *watch_list,
00075                                                DBusWatch               *watch,
00076                                                dbus_bool_t              enabled);
00077 
00080 DBUS_END_DECLS
00081 
00082 #endif /* DBUS_WATCH_H */

Generated on Tue Apr 15 15:54:04 2008 for D-Bus by  doxygen 1.5.1