D-Bus 1.15.12
Data Structures | Typedefs | Functions
DBusServer implementation details

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

void _dbus_server_trace_ref (DBusServer *server, int old_refcount, int new_refcount, const char *why)
 
dbus_bool_t _dbus_server_init_base (DBusServer *server, const DBusServerVTable *vtable, const DBusString *address, DBusError *error)
 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_all_watches (DBusServer *server, dbus_bool_t enabled)
 Toggles all 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)
 

Detailed Description

Implementation details of DBusServer.

Typedef Documentation

◆ DBusTimeoutAddFunction

typedef dbus_bool_t(* DBusTimeoutAddFunction) (DBusTimeoutList *list, DBusTimeout *timeout)

Function to be called in protected_change_timeout() with refcount held.

Definition at line 338 of file dbus-server.c.

◆ DBusTimeoutRemoveFunction

typedef void(* DBusTimeoutRemoveFunction) (DBusTimeoutList *list, DBusTimeout *timeout)

Function to be called in protected_change_timeout() with refcount held.

Definition at line 341 of file dbus-server.c.

◆ DBusTimeoutToggleFunction

typedef void(* DBusTimeoutToggleFunction) (DBusTimeoutList *list, DBusTimeout *timeout, dbus_bool_t enabled)

Function to be called in protected_change_timeout() with refcount held.

Definition at line 344 of file dbus-server.c.

◆ DBusWatchAddFunction

typedef dbus_bool_t(* DBusWatchAddFunction) (DBusWatchList *list, DBusWatch *watch)

Function to be called in protected_change_watch() with refcount held.

Definition at line 231 of file dbus-server.c.

◆ DBusWatchRemoveFunction

typedef void(* DBusWatchRemoveFunction) (DBusWatchList *list, DBusWatch *watch)

Function to be called in protected_change_watch() with refcount held.

Definition at line 234 of file dbus-server.c.

◆ DBusWatchToggleFunction

typedef void(* DBusWatchToggleFunction) (DBusWatchList *list, DBusWatch *watch, dbus_bool_t enabled)

Function to be called in protected_change_watch() with refcount held.

Definition at line 237 of file dbus-server.c.

Function Documentation

◆ _dbus_server_add_timeout()

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.

Parameters
serverthe server.
timeoutthe timeout to add.

Definition at line 406 of file dbus-server.c.

References _dbus_timeout_list_add_timeout(), FALSE, and NULL.

◆ _dbus_server_add_watch()

dbus_bool_t _dbus_server_add_watch ( DBusServer server,
DBusWatch watch 
)

Adds a watch for this server, chaining out to application-provided watch handlers.

Parameters
serverthe server.
watchthe watch to add.

Definition at line 297 of file dbus-server.c.

References _dbus_watch_list_add_watch(), FALSE, and NULL.

Referenced by _dbus_server_new_for_socket().

◆ _dbus_server_finalize_base()

void _dbus_server_finalize_base ( DBusServer server)

◆ _dbus_server_init_base()

dbus_bool_t _dbus_server_init_base ( DBusServer server,
const DBusServerVTable vtable,
const DBusString address,
DBusError error 
)

◆ _dbus_server_ref_unlocked()

void _dbus_server_ref_unlocked ( DBusServer server)

Like dbus_server_ref() but does not acquire the lock (must already be held)

Parameters
serverthe server.

Definition at line 457 of file dbus-server.c.

References _dbus_assert, _dbus_atomic_inc(), NULL, and DBusServer::refcount.

◆ _dbus_server_remove_timeout()

void _dbus_server_remove_timeout ( DBusServer server,
DBusTimeout timeout 
)

Removes a timeout previously added with _dbus_server_add_timeout().

Parameters
serverthe server.
timeoutthe timeout to remove.

Definition at line 421 of file dbus-server.c.

References _dbus_timeout_list_remove_timeout(), FALSE, and NULL.

◆ _dbus_server_remove_watch()

void _dbus_server_remove_watch ( DBusServer server,
DBusWatch watch 
)

Removes a watch previously added with _dbus_server_remove_watch().

Parameters
serverthe server.
watchthe watch to remove.

Definition at line 313 of file dbus-server.c.

References _dbus_watch_list_remove_watch(), FALSE, and NULL.

◆ _dbus_server_toggle_all_watches()

void _dbus_server_toggle_all_watches ( DBusServer server,
dbus_bool_t  enabled 
)

Toggles all watch and notifies app via server's DBusWatchToggledFunction if available.

Parameters
serverthe server.
enabledwhether to enable or disable

Definition at line 331 of file dbus-server.c.

References _dbus_watch_list_toggle_all_watches(), and DBusServer::watches.

◆ _dbus_server_toggle_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.

It's an error to call this function on a timeout that was not previously added.

Parameters
serverthe server.
timeoutthe timeout to toggle.
enabledwhether to enable or disable

Definition at line 440 of file dbus-server.c.

References _dbus_timeout_list_toggle_timeout(), and NULL.

◆ _dbus_server_trace_ref()

void _dbus_server_trace_ref ( DBusServer server,
int  old_refcount,
int  new_refcount,
const char *  why 
)

Definition at line 59 of file dbus-server.c.

◆ _dbus_server_unref_unlocked()

void _dbus_server_unref_unlocked ( DBusServer server)

Like dbus_server_unref() but does not acquire the lock (must already be held)

Parameters
serverthe server.

Definition at line 476 of file dbus-server.c.

References _dbus_assert, _dbus_atomic_dec(), DBusServer::disconnected, DBusServerVTable::finalize, NULL, DBusServer::refcount, and DBusServer::vtable.