D-Bus  1.10.12
dbus-watch.h
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  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 
00040 #define _DBUS_WATCH_NVAL (1<<4)
00041 
00043 typedef dbus_bool_t (* DBusWatchHandler) (DBusWatch    *watch,
00044                                           unsigned int  flags,
00045                                           void         *data);
00046 
00047 DBUS_PRIVATE_EXPORT
00048 DBusWatch* _dbus_watch_new                (DBusPollable      fd,
00049                                            unsigned int      flags,
00050                                            dbus_bool_t       enabled,
00051                                            DBusWatchHandler  handler,
00052                                            void             *data,
00053                                            DBusFreeFunction  free_data_function);
00054 DBUS_PRIVATE_EXPORT
00055 DBusWatch* _dbus_watch_ref                (DBusWatch        *watch);
00056 DBUS_PRIVATE_EXPORT
00057 void       _dbus_watch_unref              (DBusWatch        *watch);
00058 DBUS_PRIVATE_EXPORT
00059 void       _dbus_watch_invalidate         (DBusWatch        *watch);
00060 void       _dbus_watch_sanitize_condition (DBusWatch        *watch,
00061                                            unsigned int     *condition);
00062 void       _dbus_watch_set_handler        (DBusWatch        *watch,
00063                                            DBusWatchHandler  handler,
00064                                            void             *data,
00065                                            DBusFreeFunction  free_data_function);
00066 
00067 
00068 DBUS_PRIVATE_EXPORT
00069 DBusWatchList* _dbus_watch_list_new           (void);
00070 DBUS_PRIVATE_EXPORT
00071 void           _dbus_watch_list_free          (DBusWatchList           *watch_list);
00072 DBUS_PRIVATE_EXPORT
00073 dbus_bool_t    _dbus_watch_list_set_functions (DBusWatchList           *watch_list,
00074                                                DBusAddWatchFunction     add_function,
00075                                                DBusRemoveWatchFunction  remove_function,
00076                                                DBusWatchToggledFunction toggled_function,
00077                                                void                    *data,
00078                                                DBusFreeFunction         free_data_function);
00079 DBUS_PRIVATE_EXPORT
00080 dbus_bool_t    _dbus_watch_list_add_watch     (DBusWatchList           *watch_list,
00081                                                DBusWatch               *watch);
00082 DBUS_PRIVATE_EXPORT
00083 void           _dbus_watch_list_remove_watch  (DBusWatchList           *watch_list,
00084                                                DBusWatch               *watch);
00085 void           _dbus_watch_list_toggle_watch  (DBusWatchList           *watch_list,
00086                                                DBusWatch               *watch,
00087                                                dbus_bool_t              enabled);
00088 void           _dbus_watch_list_toggle_all_watches (DBusWatchList      *watch_list,
00089                                                dbus_bool_t              enabled);
00090 dbus_bool_t    _dbus_watch_get_enabled        (DBusWatch              *watch);
00091 
00092 DBUS_PRIVATE_EXPORT
00093 dbus_bool_t    _dbus_watch_get_oom_last_time  (DBusWatch               *watch);
00094 DBUS_PRIVATE_EXPORT
00095 void           _dbus_watch_set_oom_last_time  (DBusWatch               *watch,
00096                                                dbus_bool_t              oom);
00097 
00098 DBusSocket     _dbus_watch_get_socket         (DBusWatch               *watch);
00099 DBUS_PRIVATE_EXPORT
00100 DBusPollable   _dbus_watch_get_pollable       (DBusWatch               *watch);
00101 
00104 DBUS_END_DECLS
00105 
00106 #endif /* DBUS_WATCH_H */