D-Bus
1.4.10
|
Implementation details of DBusServer. More...
Data Structures | |
struct | DBusServer |
Internals of DBusServer object. More... | |
Typedefs | |
typedef dbus_bool_t(* | DBusWatchAddFunction )(DBusWatchList *list, DBusWatch *watch) |
Function to be called in protected_change_watch() with refcount held. | |
typedef void(* | DBusWatchRemoveFunction )(DBusWatchList *list, DBusWatch *watch) |
Function to be called in protected_change_watch() with refcount held. | |
typedef void(* | DBusWatchToggleFunction )(DBusWatchList *list, DBusWatch *watch, dbus_bool_t enabled) |
Function to be called in protected_change_watch() with refcount held. | |
typedef dbus_bool_t(* | DBusTimeoutAddFunction )(DBusTimeoutList *list, DBusTimeout *timeout) |
Function to be called in protected_change_timeout() with refcount held. | |
typedef void(* | DBusTimeoutRemoveFunction )(DBusTimeoutList *list, DBusTimeout *timeout) |
Function to be called in protected_change_timeout() with refcount held. | |
typedef void(* | DBusTimeoutToggleFunction )(DBusTimeoutList *list, DBusTimeout *timeout, dbus_bool_t enabled) |
Function to be called in protected_change_timeout() with refcount held. | |
Functions | |
dbus_bool_t | _dbus_server_init_base (DBusServer *server, const DBusServerVTable *vtable, const DBusString *address) |
Initializes the members of the DBusServer base class. | |
void | _dbus_server_finalize_base (DBusServer *server) |
Finalizes the members of the DBusServer base class. | |
dbus_bool_t | _dbus_server_add_watch (DBusServer *server, DBusWatch *watch) |
Adds a watch for this server, chaining out to application-provided watch handlers. | |
void | _dbus_server_remove_watch (DBusServer *server, DBusWatch *watch) |
Removes a watch previously added with _dbus_server_remove_watch(). | |
void | _dbus_server_toggle_watch (DBusServer *server, DBusWatch *watch, dbus_bool_t enabled) |
Toggles a watch and notifies app via server's DBusWatchToggledFunction if available. | |
dbus_bool_t | _dbus_server_add_timeout (DBusServer *server, DBusTimeout *timeout) |
Adds a timeout for this server, chaining out to application-provided timeout handlers. | |
void | _dbus_server_remove_timeout (DBusServer *server, DBusTimeout *timeout) |
Removes a timeout previously added with _dbus_server_add_timeout(). | |
void | _dbus_server_toggle_timeout (DBusServer *server, DBusTimeout *timeout, dbus_bool_t enabled) |
Toggles a timeout and notifies app via server's DBusTimeoutToggledFunction if available. | |
void | _dbus_server_ref_unlocked (DBusServer *server) |
Like dbus_server_ref() but does not acquire the lock (must already be held) | |
void | _dbus_server_unref_unlocked (DBusServer *server) |
Like dbus_server_unref() but does not acquire the lock (must already be held) |
Implementation details of DBusServer.
dbus_bool_t _dbus_server_add_timeout | ( | DBusServer * | server, |
DBusTimeout * | timeout | ||
) |
Adds a timeout for this server, chaining out to application-provided timeout handlers.
The timeout should be repeatedly handled with dbus_timeout_handle() at its given interval until it is removed.
server | the server. |
timeout | the timeout to add. |
Definition at line 383 of file dbus-server.c.
References _dbus_timeout_list_add_timeout(), NULL, and FALSE.
dbus_bool_t _dbus_server_add_watch | ( | DBusServer * | server, |
DBusWatch * | watch | ||
) |
Adds a watch for this server, chaining out to application-provided watch handlers.
server | the server. |
watch | the watch to add. |
Definition at line 265 of file dbus-server.c.
References _dbus_watch_list_add_watch(), NULL, and FALSE.
Referenced by _dbus_server_new_for_socket().
void _dbus_server_finalize_base | ( | DBusServer * | server | ) |
Finalizes the members of the DBusServer base class.
Chained up to by subclass finalizers.
server | the server. |
Definition at line 170 of file dbus-server.c.
References _dbus_assert, DBusServer::have_server_lock, DBusServer::disconnected, _dbus_data_slot_list_free(), DBusServer::slot_list, dbus_server_set_new_connection_function(), NULL, _dbus_watch_list_free(), DBusServer::watches, _dbus_timeout_list_free(), DBusServer::timeouts, _dbus_mutex_free_at_location(), DBusServer::mutex, dbus_free(), DBusServer::address, dbus_free_string_array(), DBusServer::auth_mechanisms, _dbus_string_free(), and DBusServer::guid_hex.
Referenced by _dbus_server_new_for_socket().
dbus_bool_t _dbus_server_init_base | ( | DBusServer * | server, |
const DBusServerVTable * | vtable, | ||
const DBusString * | address | ||
) |
Initializes the members of the DBusServer base class.
Chained up to by subclass constructors.
server | the server. |
vtable | the vtable for the subclass. |
address | the server's address |
Definition at line 97 of file dbus-server.c.
References DBusServer::vtable, DBusServer::refcount, DBusAtomic::value, DBusServer::address, NULL, DBusServer::watches, DBusServer::timeouts, DBusServer::published_address, FALSE, _dbus_string_init(), DBusServer::guid_hex, _dbus_generate_uuid(), DBusServer::guid, _dbus_uuid_encode(), _dbus_mutex_new_at_location(), DBusServer::mutex, _dbus_watch_list_new(), _dbus_timeout_list_new(), _dbus_data_slot_list_init(), DBusServer::slot_list, TRUE, _dbus_mutex_free_at_location(), _dbus_watch_list_free(), _dbus_timeout_list_free(), dbus_free(), and _dbus_string_free().
Referenced by _dbus_server_new_for_socket().
void _dbus_server_ref_unlocked | ( | DBusServer * | server | ) |
Like dbus_server_ref() but does not acquire the lock (must already be held)
server | the server. |
Definition at line 434 of file dbus-server.c.
References _dbus_assert, NULL, DBusServer::refcount, DBusAtomic::value, and _dbus_atomic_inc().
Referenced by dbus_server_disconnect().
void _dbus_server_remove_timeout | ( | DBusServer * | server, |
DBusTimeout * | timeout | ||
) |
Removes a timeout previously added with _dbus_server_add_timeout().
server | the server. |
timeout | the timeout to remove. |
Definition at line 398 of file dbus-server.c.
References NULL, _dbus_timeout_list_remove_timeout(), and FALSE.
void _dbus_server_remove_watch | ( | DBusServer * | server, |
DBusWatch * | watch | ||
) |
Removes a watch previously added with _dbus_server_remove_watch().
server | the server. |
watch | the watch to remove. |
Definition at line 281 of file dbus-server.c.
References NULL, _dbus_watch_list_remove_watch(), and FALSE.
Referenced by _dbus_server_new_for_socket().
void _dbus_server_toggle_timeout | ( | DBusServer * | server, |
DBusTimeout * | timeout, | ||
dbus_bool_t | enabled | ||
) |
Toggles a timeout and notifies app via server's DBusTimeoutToggledFunction if available.
It's an error to call this function on a timeout that was not previously added.
server | the server. |
timeout | the timeout to toggle. |
enabled | whether to enable or disable |
Definition at line 417 of file dbus-server.c.
References NULL, and _dbus_timeout_list_toggle_timeout().
void _dbus_server_toggle_watch | ( | DBusServer * | server, |
DBusWatch * | watch, | ||
dbus_bool_t | enabled | ||
) |
Toggles a watch and notifies app via server's DBusWatchToggledFunction if available.
It's an error to call this function on a watch that was not previously added.
server | the server. |
watch | the watch to toggle. |
enabled | whether to enable or disable |
Definition at line 301 of file dbus-server.c.
References _dbus_assert, NULL, and _dbus_watch_list_toggle_watch().
void _dbus_server_unref_unlocked | ( | DBusServer * | server | ) |
Like dbus_server_unref() but does not acquire the lock (must already be held)
server | the server. |
Definition at line 456 of file dbus-server.c.
References _dbus_assert, NULL, DBusServer::refcount, DBusAtomic::value, _dbus_atomic_dec(), DBusServer::disconnected, DBusServer::vtable, and DBusServerVTable::finalize.