D-Bus  1.4.10
Data Structures | Defines | Functions
DBusPendingCall implementation details
D-Bus secret internal implementation details

DBusPendingCall private implementation details. More...

Data Structures

struct  DBusPendingCall
 Implementation details of DBusPendingCall - all fields are private. More...

Defines

#define CONNECTION_LOCK(connection)   _dbus_connection_lock(connection)
 Internals of DBusPendingCall.
#define CONNECTION_UNLOCK(connection)   _dbus_connection_unlock(connection)
 shorter and more visible way to write _dbus_connection_unlock()

Functions

DBusPendingCall_dbus_pending_call_new_unlocked (DBusConnection *connection, int timeout_milliseconds, DBusTimeoutHandler timeout_handler)
 Creates a new pending reply object.
void _dbus_pending_call_set_reply_unlocked (DBusPendingCall *pending, DBusMessage *message)
 Sets the reply of a pending call with the given message, or if the message is NULL, by timing out the pending call.
void _dbus_pending_call_complete (DBusPendingCall *pending)
 Calls notifier function for the pending call and sets the call to completed.
void _dbus_pending_call_queue_timeout_error_unlocked (DBusPendingCall *pending, DBusConnection *connection)
 If the pending call hasn't been timed out, add its timeout error reply to the connection's incoming message queue.
dbus_bool_t _dbus_pending_call_is_timeout_added_unlocked (DBusPendingCall *pending)
 Checks to see if a timeout has been added.
void _dbus_pending_call_set_timeout_added_unlocked (DBusPendingCall *pending, dbus_bool_t is_added)
 Sets wether the timeout has been added.
DBusTimeout_dbus_pending_call_get_timeout_unlocked (DBusPendingCall *pending)
 Retrives the timeout.
dbus_uint32_t _dbus_pending_call_get_reply_serial_unlocked (DBusPendingCall *pending)
 Gets the reply's serial number.
void _dbus_pending_call_set_reply_serial_unlocked (DBusPendingCall *pending, dbus_uint32_t serial)
 Sets the reply's serial number.
DBusConnection_dbus_pending_call_get_connection_and_lock (DBusPendingCall *pending)
 Gets the connection associated with this pending call.
DBusConnection_dbus_pending_call_get_connection_unlocked (DBusPendingCall *pending)
 Gets the connection associated with this pending call.
dbus_bool_t _dbus_pending_call_set_timeout_error_unlocked (DBusPendingCall *pending, DBusMessage *message, dbus_uint32_t serial)
 Sets the reply message associated with the pending call to a timeout error.
DBusPendingCall_dbus_pending_call_ref_unlocked (DBusPendingCall *pending)
 Increments the reference count on a pending call, while the lock on its connection is already held.
void _dbus_pending_call_unref_and_unlock (DBusPendingCall *pending)
 Decrements the reference count on a pending call, freeing it if the count reaches 0.
dbus_bool_t _dbus_pending_call_get_completed_unlocked (DBusPendingCall *pending)
 Checks whether the pending call has received a reply yet, or not.
dbus_bool_t _dbus_pending_call_set_data_unlocked (DBusPendingCall *pending, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func)
 Stores a pointer on a DBusPendingCall, along with an optional function to be used for freeing the data when the data is set again, or when the pending call is finalized.

Detailed Description

DBusPendingCall private implementation details.

The guts of DBusPendingCall and its methods.


Define Documentation

#define CONNECTION_LOCK (   connection)    _dbus_connection_lock(connection)

Internals of DBusPendingCall.

Opaque object representing a reply message that we're waiting for. shorter and more visible way to write _dbus_connection_lock()

Definition at line 52 of file dbus-pending-call.c.

Referenced by _dbus_connection_lock(), dbus_connection_has_messages_to_send(), _dbus_connection_remove_pending_call(), _dbus_connection_new_for_transport(), _dbus_connection_handle_watch(), _dbus_connection_close_possibly_shared(), _dbus_connection_close_if_only_one_ref(), _dbus_connection_block_pending_call(), dbus_connection_ref(), dbus_connection_unref(), dbus_connection_close(), dbus_connection_get_is_connected(), dbus_connection_get_is_authenticated(), dbus_connection_get_is_anonymous(), dbus_connection_get_server_id(), dbus_connection_can_send_type(), dbus_connection_set_exit_on_disconnect(), dbus_connection_preallocate_send(), dbus_connection_send_preallocated(), dbus_connection_send(), dbus_connection_send_with_reply(), dbus_connection_send_with_reply_and_block(), dbus_connection_flush(), dbus_connection_borrow_message(), dbus_connection_return_message(), dbus_connection_steal_borrowed_message(), dbus_connection_pop_message(), dbus_connection_get_dispatch_status(), dbus_connection_dispatch(), dbus_connection_set_watch_functions(), dbus_connection_set_timeout_functions(), dbus_connection_set_wakeup_main_function(), dbus_connection_set_dispatch_status_function(), dbus_connection_get_socket(), dbus_connection_get_unix_user(), dbus_connection_get_unix_process_id(), dbus_connection_get_adt_audit_session_data(), dbus_connection_set_unix_user_function(), dbus_connection_get_windows_user(), dbus_connection_set_windows_user_function(), dbus_connection_set_allow_anonymous(), dbus_connection_set_route_peer_messages(), dbus_connection_add_filter(), dbus_connection_remove_filter(), dbus_connection_try_register_object_path(), dbus_connection_register_object_path(), dbus_connection_try_register_fallback(), dbus_connection_register_fallback(), dbus_connection_unregister_object_path(), dbus_connection_get_object_path_data(), dbus_connection_list_registered(), dbus_connection_set_max_message_size(), dbus_connection_get_max_message_size(), dbus_connection_set_max_message_unix_fds(), dbus_connection_get_max_message_unix_fds(), dbus_connection_set_max_received_size(), dbus_connection_get_max_received_size(), dbus_connection_set_max_received_unix_fds(), dbus_connection_get_max_received_unix_fds(), dbus_connection_get_outgoing_size(), dbus_connection_get_outgoing_unix_fds(), _dbus_pending_call_get_connection_and_lock(), _dbus_pending_call_set_data_unlocked(), dbus_pending_call_ref(), dbus_pending_call_unref(), dbus_pending_call_set_notify(), dbus_pending_call_get_completed(), dbus_pending_call_steal_reply(), dbus_pending_call_set_data(), and dbus_pending_call_get_data().


Function Documentation

void _dbus_pending_call_complete ( DBusPendingCall pending)

Calls notifier function for the pending call and sets the call to completed.

Parameters:
pendingthe pending call

Definition at line 185 of file dbus-pending-call.c.

References _dbus_assert, DBusPendingCall::completed, TRUE, DBusPendingCall::function, and dbus_pending_call_get_data().

dbus_bool_t _dbus_pending_call_get_completed_unlocked ( DBusPendingCall pending)

Checks whether the pending call has received a reply yet, or not.

Assumes connection lock is held.

Parameters:
pendingthe pending call
Returns:
TRUE if a reply has been received

Definition at line 454 of file dbus-pending-call.c.

References DBusPendingCall::completed.

Referenced by _dbus_connection_do_iteration_unlocked(), and _dbus_connection_block_pending_call().

DBusConnection* _dbus_pending_call_get_connection_and_lock ( DBusPendingCall pending)

Gets the connection associated with this pending call.

Parameters:
pendingthe pending_call
Returns:
the connection associated with the pending call

Definition at line 304 of file dbus-pending-call.c.

References _dbus_assert, NULL, CONNECTION_LOCK, and DBusPendingCall::connection.

Referenced by _dbus_connection_block_pending_call().

DBusConnection* _dbus_pending_call_get_connection_unlocked ( DBusPendingCall pending)

Gets the connection associated with this pending call.

Parameters:
pendingthe pending_call
Returns:
the connection associated with the pending call

Definition at line 319 of file dbus-pending-call.c.

References _dbus_assert, NULL, and DBusPendingCall::connection.

dbus_uint32_t _dbus_pending_call_get_reply_serial_unlocked ( DBusPendingCall pending)

Gets the reply's serial number.

Parameters:
pendingthe pending_call
Returns:
a serial number for the reply or 0

Definition at line 274 of file dbus-pending-call.c.

References _dbus_assert, NULL, and DBusPendingCall::reply_serial.

Referenced by _dbus_connection_do_iteration_unlocked(), and _dbus_connection_block_pending_call().

DBusTimeout* _dbus_pending_call_get_timeout_unlocked ( DBusPendingCall pending)

Retrives the timeout.

Parameters:
pendingthe pending_call
Returns:
a timeout object or NULL if call has no timeout

Definition at line 260 of file dbus-pending-call.c.

References _dbus_assert, NULL, and DBusPendingCall::timeout.

Referenced by _dbus_connection_queue_received_message_link(), and _dbus_connection_block_pending_call().

dbus_bool_t _dbus_pending_call_is_timeout_added_unlocked ( DBusPendingCall pending)

Checks to see if a timeout has been added.

Parameters:
pendingthe pending_call
Returns:
TRUE if there is a timeout or FALSE if not

Definition at line 229 of file dbus-pending-call.c.

References _dbus_assert, NULL, and DBusPendingCall::timeout_added.

Referenced by _dbus_connection_queue_received_message_link().

DBusPendingCall* _dbus_pending_call_new_unlocked ( DBusConnection connection,
int  timeout_milliseconds,
DBusTimeoutHandler  timeout_handler 
)

Creates a new pending reply object.

Parameters:
connectionconnection where reply will arrive
timeout_millisecondslength of timeout, -1 for default, INT_MAX for no timeout
timeout_handlertimeout handler, takes pending call as data
Returns:
a new DBusPendingCall or NULL if no memory.

Definition at line 92 of file dbus-pending-call.c.

References _dbus_assert, dbus_pending_call_allocate_data_slot(), NULL, dbus_new0, dbus_pending_call_free_data_slot(), _DBUS_INT_MAX, _dbus_timeout_new(), dbus_free(), DBusPendingCall::timeout, DBusPendingCall::refcount, DBusAtomic::value, DBusPendingCall::connection, _dbus_connection_ref_unlocked(), _dbus_data_slot_list_init(), and DBusPendingCall::slot_list.

Referenced by dbus_connection_send_with_reply().

void _dbus_pending_call_queue_timeout_error_unlocked ( DBusPendingCall pending,
DBusConnection connection 
)

If the pending call hasn't been timed out, add its timeout error reply to the connection's incoming message queue.

Parameters:
pendingthe pending call
connectionthe connection the call was sent to

Definition at line 209 of file dbus-pending-call.c.

References _dbus_assert, DBusPendingCall::connection, DBusPendingCall::timeout_link, _dbus_connection_queue_synthesized_message_link(), and NULL.

DBusPendingCall* _dbus_pending_call_ref_unlocked ( DBusPendingCall pending)

Increments the reference count on a pending call, while the lock on its connection is already held.

Parameters:
pendingthe pending call object
Returns:
the pending call object

Definition at line 373 of file dbus-pending-call.c.

References DBusPendingCall::refcount, and DBusAtomic::value.

dbus_bool_t _dbus_pending_call_set_data_unlocked ( DBusPendingCall pending,
dbus_int32_t  slot,
void *  data,
DBusFreeFunction  free_data_func 
)

Stores a pointer on a DBusPendingCall, along with an optional function to be used for freeing the data when the data is set again, or when the pending call is finalized.

The slot number must have been allocated with dbus_pending_call_allocate_data_slot().

Parameters:
pendingthe pending_call
slotthe slot number
datathe data to store
free_data_funcfinalizer function for the data
Returns:
TRUE if there was enough memory to store the data

Definition at line 476 of file dbus-pending-call.c.

References _dbus_data_slot_list_set(), DBusPendingCall::slot_list, CONNECTION_UNLOCK, DBusPendingCall::connection, and CONNECTION_LOCK.

Referenced by dbus_pending_call_set_notify(), and dbus_pending_call_set_data().

void _dbus_pending_call_set_reply_serial_unlocked ( DBusPendingCall pending,
dbus_uint32_t  serial 
)

Sets the reply's serial number.

Parameters:
pendingthe pending_call
serialthe serial number

Definition at line 288 of file dbus-pending-call.c.

References _dbus_assert, NULL, and DBusPendingCall::reply_serial.

Referenced by _dbus_pending_call_set_timeout_error_unlocked().

void _dbus_pending_call_set_reply_unlocked ( DBusPendingCall pending,
DBusMessage message 
)

Sets the reply of a pending call with the given message, or if the message is NULL, by timing out the pending call.

Parameters:
pendingthe pending call
messagethe message to complete the call with, or NULL to time out the call

Definition at line 153 of file dbus-pending-call.c.

References NULL, DBusPendingCall::timeout_link, DBusList::data, _dbus_list_clear(), dbus_message_ref(), dbus_message_get_type(), DBUS_MESSAGE_TYPE_METHOD_RETURN, DBUS_MESSAGE_TYPE_ERROR, DBusPendingCall::reply_serial, _dbus_assert, DBusPendingCall::reply, and dbus_message_get_reply_serial().

void _dbus_pending_call_set_timeout_added_unlocked ( DBusPendingCall pending,
dbus_bool_t  is_added 
)

Sets wether the timeout has been added.

Parameters:
pendingthe pending_call
is_addedwhether or not a timeout is added

Definition at line 244 of file dbus-pending-call.c.

References _dbus_assert, NULL, and DBusPendingCall::timeout_added.

Referenced by _dbus_connection_queue_received_message_link().

dbus_bool_t _dbus_pending_call_set_timeout_error_unlocked ( DBusPendingCall pending,
DBusMessage message,
dbus_uint32_t  serial 
)

Sets the reply message associated with the pending call to a timeout error.

Parameters:
pendingthe pending_call
messagethe message we are sending the error reply to
serialserial number for the reply
Returns:
FALSE on OOM

Definition at line 335 of file dbus-pending-call.c.

References dbus_message_new_error(), DBUS_ERROR_NO_REPLY, NULL, FALSE, _dbus_list_alloc_link(), dbus_message_unref(), DBusPendingCall::timeout_link, _dbus_pending_call_set_reply_serial_unlocked(), and TRUE.

Referenced by dbus_connection_send_with_reply().

void _dbus_pending_call_unref_and_unlock ( DBusPendingCall pending)

Decrements the reference count on a pending call, freeing it if the count reaches 0.

Assumes connection lock is already held.

Parameters:
pendingthe pending call object

Definition at line 432 of file dbus-pending-call.c.

References _dbus_assert, DBusPendingCall::refcount, DBusAtomic::value, CONNECTION_UNLOCK, and DBusPendingCall::connection.