Data Structures | |
struct | DBusWatch |
Implementation of DBusWatch. More... | |
struct | DBusWatchList |
DBusWatchList implementation details. More... | |
Typedefs | |
typedef DBusWatchList | DBusWatchList |
Opaque data type representing a list of watches and a set of DBusAddWatchFunction/DBusRemoveWatchFunction. More... | |
Functions | |
DBusWatch * | _dbus_watch_new (int fd, unsigned int flags, dbus_bool_t enabled, DBusWatchHandler handler, void *data, DBusFreeFunction free_data_function) |
Creates a new DBusWatch. More... | |
DBusWatch * | _dbus_watch_ref (DBusWatch *watch) |
Increments the reference count of a DBusWatch object. More... | |
void | _dbus_watch_unref (DBusWatch *watch) |
Decrements the reference count of a DBusWatch object and finalizes the object if the count reaches zero. More... | |
void | _dbus_watch_invalidate (DBusWatch *watch) |
Clears the file descriptor from a now-invalid watch object so that no one tries to use it. More... | |
void | _dbus_watch_sanitize_condition (DBusWatch *watch, unsigned int *condition) |
Sanitizes the given condition so that it only contains flags that the DBusWatch requested. More... | |
DBusWatchList * | _dbus_watch_list_new (void) |
Creates a new watch list. More... | |
void | _dbus_watch_list_free (DBusWatchList *watch_list) |
Frees a DBusWatchList. More... | |
dbus_bool_t | _dbus_watch_list_set_functions (DBusWatchList *watch_list, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function) |
Sets the watch functions. More... | |
dbus_bool_t | _dbus_watch_list_add_watch (DBusWatchList *watch_list, DBusWatch *watch) |
Adds a new watch to the watch list, invoking the application DBusAddWatchFunction if appropriate. More... | |
void | _dbus_watch_list_remove_watch (DBusWatchList *watch_list, DBusWatch *watch) |
Removes a watch from the watch list, invoking the application's DBusRemoveWatchFunction if appropriate. More... | |
void | _dbus_watch_list_toggle_watch (DBusWatchList *watch_list, DBusWatch *watch, dbus_bool_t enabled) |
Sets a watch to the given enabled state, invoking the application's DBusWatchToggledFunction if appropriate. More... | |
void | _dbus_watch_set_handler (DBusWatch *watch, DBusWatchHandler handler, void *data, DBusFreeFunction free_data_function) |
Sets the handler for the watch. More... |
|
Opaque data type representing a list of watches and a set of DBusAddWatchFunction/DBusRemoveWatchFunction. Automatically handles removing/re-adding watches when the DBusAddWatchFunction is updated or changed. Holds a reference count to each watch. Used in the implementation of both DBusServer and DBusClient. Definition at line 33 of file dbus-watch.h. |
|
Clears the file descriptor from a now-invalid watch object so that no one tries to use it. This is because a watch may stay alive due to reference counts after the file descriptor is closed. Invalidation makes it easier to catch bugs. It also keeps people from doing dorky things like assuming file descriptors are unique (never recycled).
Definition at line 145 of file dbus-watch.c. References DBusWatch::fd, and DBusWatch::flags. |
|
Adds a new watch to the watch list, invoking the application DBusAddWatchFunction if appropriate.
Definition at line 332 of file dbus-watch.c. References DBusWatchList::add_watch_function, DBusWatchList::watch_data, and DBusWatchList::watches. |
|
Frees a DBusWatchList.
Definition at line 225 of file dbus-watch.c. References DBusWatchList::watches. |
|
Creates a new watch list. Returns NULL if insufficient memory exists.
Definition at line 208 of file dbus-watch.c. |
|
Removes a watch from the watch list, invoking the application's DBusRemoveWatchFunction if appropriate.
Definition at line 365 of file dbus-watch.c. References DBusWatchList::remove_watch_function, DBusWatchList::watch_data, and DBusWatchList::watches. |
|
Sets the watch functions. This function is the "backend" for dbus_connection_set_watch_functions() and dbus_server_set_watch_functions().
Definition at line 253 of file dbus-watch.c. References DBusWatchList::add_watch_function, DBusList::data, DBusWatchList::remove_watch_function, DBusWatchList::watch_data, DBusWatchList::watch_free_data_function, DBusWatchList::watch_toggled_function, and DBusWatchList::watches. |
|
Sets a watch to the given enabled state, invoking the application's DBusWatchToggledFunction if appropriate.
Definition at line 392 of file dbus-watch.c. References DBusWatch::enabled, DBusWatchList::watch_data, and DBusWatchList::watch_toggled_function. |
|
Creates a new DBusWatch. Used to add a file descriptor to be polled by a main loop.
Definition at line 67 of file dbus-watch.c. References DBusWatch::enabled, DBusWatch::fd, DBusWatch::flags, DBusWatch::free_handler_data_function, DBusWatch::handler, DBusWatch::handler_data, and DBusWatch::refcount. |
|
Increments the reference count of a DBusWatch object.
Definition at line 103 of file dbus-watch.c. References DBusWatch::refcount. |
|
Sanitizes the given condition so that it only contains flags that the DBusWatch requested. e.g. if the watch is a DBUS_WATCH_READABLE watch then DBUS_WATCH_WRITABLE will be stripped from the condition.
Definition at line 161 of file dbus-watch.c. References DBusWatch::flags. |
|
Sets the handler for the watch.
Definition at line 426 of file dbus-watch.c. References DBusWatch::free_handler_data_function, DBusWatch::handler, and DBusWatch::handler_data. |
|
Decrements the reference count of a DBusWatch object and finalizes the object if the count reaches zero.
Definition at line 117 of file dbus-watch.c. References DBusWatch::free_handler_data_function, DBusWatch::handler_data, and DBusWatch::refcount. |