Typedefs | |
typedef DBusPendingCall | DBusPendingCall |
Opaque data type representing a message pending. | |
Functions | |
void | dbus_pending_call_ref (DBusPendingCall *pending) |
Increments the reference count on a pending call. | |
void | dbus_pending_call_unref (DBusPendingCall *pending) |
Decrements the reference count on a pending call, freeing it if the count reaches 0. | |
dbus_bool_t | dbus_pending_call_set_notify (DBusPendingCall *pending, DBusPendingCallNotifyFunction function, void *user_data, DBusFreeFunction free_user_data) |
Sets a notification function to be called when the reply is received or the pending call times out. | |
void | dbus_pending_call_cancel (DBusPendingCall *pending) |
Cancels the pending call, such that any reply or error received will just be ignored. | |
dbus_bool_t | dbus_pending_call_get_completed (DBusPendingCall *pending) |
Checks whether the pending call has received a reply yet, or not. | |
DBusMessage * | dbus_pending_call_get_reply (DBusPendingCall *pending) |
Gets the reply, or returns NULL if none has been received yet. | |
void | dbus_pending_call_block (DBusPendingCall *pending) |
Block until the pending call is completed. | |
dbus_bool_t | dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p) |
Allocates an integer ID to be used for storing application-specific data on any DBusPendingCall. | |
void | dbus_pending_call_free_data_slot (dbus_int32_t *slot_p) |
Deallocates a global ID for DBusPendingCall data slots. | |
dbus_bool_t | dbus_pending_call_set_data (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. | |
void * | dbus_pending_call_get_data (DBusPendingCall *pending, dbus_int32_t slot) |
Retrieves data previously set with dbus_pending_call_set_data(). |
A DBusPendingCall is an object representing an expected reply. A DBusPendingCall can be created when you send a message that should have a reply.
|
Allocates an integer ID to be used for storing application-specific data on any DBusPendingCall. The allocated ID may then be used with dbus_pending_call_set_data() and dbus_pending_call_get_data(). The passed-in slot must be initialized to -1, and is filled in with the slot ID. If the passed-in slot is not -1, it's assumed to be already allocated, and its refcount is incremented. The allocated slot is global, i.e. all DBusPendingCall objects will have a slot with the given integer ID reserved.
Definition at line 326 of file dbus-pending-call.c. References _dbus_data_slot_allocator_alloc(), _DBUS_LOCK_NAME, and dbus_int32_t. Referenced by _dbus_pending_call_new(). |
|
Block until the pending call is completed. The blocking is as with dbus_connection_send_with_reply_and_block(); it does not enter the main loop or process other messages, it simply waits for the reply in question. If the pending call is already completed, this function returns immediately.
Definition at line 290 of file dbus-pending-call.c. References _dbus_connection_block_for_reply(), _dbus_connection_lock(), _dbus_pending_call_complete_and_unlock(), connection, dbus_message_unref(), dbus_pending_call_get_completed(), dbus_timeout_get_interval(), reply_serial, and timeout. Referenced by dbus_gproxy_end_call(). |
|
Cancels the pending call, such that any reply or error received will just be ignored. Drops at least one reference to the DBusPendingCall so will free the call if nobody else is holding a reference.
Definition at line 236 of file dbus-pending-call.c. References _dbus_connection_remove_pending_call(), and connection. |
|
Deallocates a global ID for DBusPendingCall data slots. dbus_pending_call_get_data() and dbus_pending_call_set_data() may no longer be used with this slot. Existing data stored on existing DBusPendingCall objects will be freed when the DBusPendingCall is finalized, but may not be retrieved (and may only be replaced if someone else reallocates the slot). When the refcount on the passed-in slot reaches 0, it is set to -1.
Definition at line 345 of file dbus-pending-call.c. References _dbus_data_slot_allocator_free(), and dbus_int32_t. Referenced by _dbus_pending_call_new(), and dbus_pending_call_unref(). |
|
Checks whether the pending call has received a reply yet, or not.
Definition at line 252 of file dbus-pending-call.c. References completed. Referenced by dbus_pending_call_block(). |
|
Retrieves data previously set with dbus_pending_call_set_data(). The slot must still be allocated (must not have been freed).
Definition at line 401 of file dbus-pending-call.c. References _dbus_data_slot_list_get(), dbus_int32_t, NULL, and slot_list. Referenced by _dbus_pending_call_notify(). |
|
Gets the reply, or returns NULL if none has been received yet. The reference count is not incremented on the returned message, so you have to keep a reference count on the pending call (or add one to the message).
Definition at line 270 of file dbus-pending-call.c. References reply. Referenced by dbus_gproxy_end_call(). |
|
Increments the reference count on a pending call.
Definition at line 143 of file dbus-pending-call.c. References _dbus_atomic_inc(), NULL, and refcount. Referenced by _dbus_pending_call_complete_and_unlock(), and dbus_connection_send_with_reply(). |
|
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().
Definition at line 366 of file dbus-pending-call.c. References _dbus_data_slot_list_set(), dbus_bool_t, dbus_int32_t, DBusFreeFunction, FALSE, NULL, and slot_list. Referenced by dbus_pending_call_set_notify(). |
|
Sets a notification function to be called when the reply is received or the pending call times out.
Definition at line 209 of file dbus-pending-call.c. References dbus_pending_call_set_data(), DBusFreeFunction, FALSE, function, NULL, and TRUE. |
|
Decrements the reference count on a pending call, freeing it if the count reaches 0.
Definition at line 157 of file dbus-pending-call.c. References _dbus_assert, _dbus_atomic_dec(), _dbus_data_slot_list_free(), _dbus_list_free_link(), _dbus_timeout_unref(), connection, DBusList::data, dbus_bool_t, dbus_free(), dbus_message_unref(), dbus_pending_call_free_data_slot(), NULL, refcount, reply, slot_list, timeout, timeout_added, and timeout_link. Referenced by _dbus_pending_call_complete_and_unlock(), and dbus_connection_send_with_reply(). |