index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
DBusPendingCall
[
group__DBus.html
D-BUS low-level public API
]
Pending reply to a method call message.
#_details
More...
Typedefs
typedef
structDBusPendingCall.html
DBusPendingCall
group__DBusPendingCall.html#ga12
DBusPendingCall
Opaque data type representing a message pending.
Functions
structDBusPendingCall.html
DBusPendingCall
*
group__DBusPendingCall.html#ga1
dbus_pending_call_ref
(
structDBusPendingCall.html
DBusPendingCall
*pending)
Increments the reference count on a pending call.
#ga1
void
group__DBusPendingCall.html#ga2
dbus_pending_call_unref
(
structDBusPendingCall.html
DBusPendingCall
*pending)
Decrements the reference count on a pending call, freeing it if the count reaches 0.
#ga2
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusPendingCall.html#ga3
dbus_pending_call_set_notify
(
structDBusPendingCall.html
DBusPendingCall
*pending, DBusPendingCallNotifyFunction function, void *user_data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_user_data)
Sets a notification function to be called when the reply is received or the pending call times out.
#ga3
void
group__DBusPendingCall.html#ga4
dbus_pending_call_cancel
(
structDBusPendingCall.html
DBusPendingCall
*pending)
Cancels the pending call, such that any reply or error received will just be ignored.
#ga4
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusPendingCall.html#ga5
dbus_pending_call_get_completed
(
structDBusPendingCall.html
DBusPendingCall
*pending)
Checks whether the pending call has received a reply yet, or not.
#ga5
structDBusMessage.html
DBusMessage
*
group__DBusPendingCall.html#ga6
dbus_pending_call_steal_reply
(
structDBusPendingCall.html
DBusPendingCall
*pending)
Gets the reply, or returns
group__DBusMacros.html#ga4
NULL
if none has been received yet.
#ga6
void
group__DBusPendingCall.html#ga7
dbus_pending_call_block
(
structDBusPendingCall.html
DBusPendingCall
*pending)
Block until the pending call is completed.
#ga7
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusPendingCall.html#ga8
dbus_pending_call_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
Allocates an integer ID to be used for storing application-specific data on any
structDBusPendingCall.html
DBusPendingCall
.
#ga8
void
group__DBusPendingCall.html#ga9
dbus_pending_call_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
Deallocates a global ID for
structDBusPendingCall.html
DBusPendingCall
data slots.
#ga9
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusPendingCall.html#ga10
dbus_pending_call_set_data
(
structDBusPendingCall.html
DBusPendingCall
*pending,
group__DBusTypes.html#ga4
dbus_int32_t
slot, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func)
Stores a pointer on a
structDBusPendingCall.html
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.
#ga10
void *
group__DBusPendingCall.html#ga11
dbus_pending_call_get_data
(
structDBusPendingCall.html
DBusPendingCall
*pending,
group__DBusTypes.html#ga4
dbus_int32_t
slot)
Retrieves data previously set with
group__DBusPendingCall.html#ga10
dbus_pending_call_set_data()
.
#ga11
Detailed Description
Pending reply to a method call message.
A
structDBusPendingCall.html
DBusPendingCall
is an object representing an expected reply. A
structDBusPendingCall.html
DBusPendingCall
can be created when you send a message that should have a reply.
Function Documentation
group__DBusTypes.html#ga2
dbus_bool_t
dbus_pending_call_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_p
)
Allocates an integer ID to be used for storing application-specific data on any
structDBusPendingCall.html
DBusPendingCall
.
The allocated ID may then be used with
group__DBusPendingCall.html#ga10
dbus_pending_call_set_data()
and
group__DBusPendingCall.html#ga11
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
structDBusPendingCall.html
DBusPendingCall
objects will have a slot with the given integer ID reserved.
Parameters:
slot_p
address of a global variable storing the slot
Returns:
group__DBusMacros.html#ga3
FALSE
on failure (no memory)
Definition at line
dbus-pending-call_8c-source.html#l00331
331
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-dataslot_8c-source.html#l00067
_dbus_data_slot_allocator_alloc()
, and
dbus-internals_8h-source.html#l00267
_DBUS_LOCK_NAME
.
Referenced by
dbus-pending-call_8c-source.html#l00052
_dbus_pending_call_new()
.
void dbus_pending_call_block
(
structDBusPendingCall.html
DBusPendingCall
*
pending
)
Block until the pending call is completed.
The blocking is as with
group__DBusConnection.html#ga26
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.
todo.html#_todo000059
Todo:
when you start blocking, the timeout is reset, but it should really only use time remaining since the pending call was created.
Parameters:
pending
the pending call
Definition at line
dbus-pending-call_8c-source.html#l00308
308
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-connection_8c-source.html#l02571
_dbus_connection_block_pending_call()
.
Referenced by
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
.
void dbus_pending_call_cancel
(
structDBusPendingCall.html
DBusPendingCall
*
pending
)
Cancels the pending call, such that any reply or error received will just be ignored.
Drops the dbus library's internal reference to the
structDBusPendingCall.html
DBusPendingCall
so will free the call if nobody else is holding a reference. However you usually get a reference from
group__DBusConnection.html#ga20
dbus_connection_send()
so probably your app owns a ref also.
Parameters:
pending
the pending call
Definition at line
dbus-pending-call_8c-source.html#l00249
249
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-connection_8c-source.html#l00859
_dbus_connection_remove_pending_call()
, and
dbus-connection-internal_8h-source.html#l00111
connection
.
Referenced by
dbus-gproxy_8c-source.html#l02412
dbus_g_proxy_cancel_call()
.
void dbus_pending_call_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_p
)
Deallocates a global ID for
structDBusPendingCall.html
DBusPendingCall
data slots.
group__DBusPendingCall.html#ga11
dbus_pending_call_get_data()
and
group__DBusPendingCall.html#ga10
dbus_pending_call_set_data()
may no longer be used with this slot. Existing data stored on existing
structDBusPendingCall.html
DBusPendingCall
objects will be freed when the
structDBusPendingCall.html
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.
Parameters:
slot_p
address storing the slot to deallocate
Definition at line
dbus-pending-call_8c-source.html#l00350
350
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-dataslot_8c-source.html#l00161
_dbus_data_slot_allocator_free()
.
Referenced by
dbus-pending-call_8c-source.html#l00052
_dbus_pending_call_new()
, and
dbus-pending-call_8c-source.html#l00170
dbus_pending_call_unref()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_pending_call_get_completed
(
structDBusPendingCall.html
DBusPendingCall
*
pending
)
Checks whether the pending call has received a reply yet, or not.
todo.html#_todo000058
Todo:
not thread safe? I guess it has to lock though it sucks
Parameters:
pending
the pending call
Returns:
group__DBusMacros.html#ga2
TRUE
if a reply has been received
Definition at line
dbus-pending-call_8c-source.html#l00265
265
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-connection-internal_8h-source.html#l00119
completed
.
Referenced by
dbus-connection_8c-source.html#l02571
_dbus_connection_block_pending_call()
.
void* dbus_pending_call_get_data
(
structDBusPendingCall.html
DBusPendingCall
*
pending
,
group__DBusTypes.html#ga4
dbus_int32_t
slot
)
Retrieves data previously set with
group__DBusPendingCall.html#ga10
dbus_pending_call_set_data()
.
The slot must still be allocated (must not have been freed).
Parameters:
pending
the pending_call
slot
the slot to get data from
Returns:
the data, or
group__DBusMacros.html#ga4
NULL
if not found
Definition at line
dbus-pending-call_8c-source.html#l00406
406
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-dataslot_8c-source.html#l00295
_dbus_data_slot_list_get()
,
group__DBusMacros.html#ga4
NULL
, and
dbus-connection-internal_8h-source.html#l00107
slot_list
.
Referenced by
dbus-pending-call_8c-source.html#l00111
_dbus_pending_call_notify()
.
structDBusPendingCall.html
DBusPendingCall
* dbus_pending_call_ref
(
structDBusPendingCall.html
DBusPendingCall
*
pending
)
Increments the reference count on a pending call.
Parameters:
pending
the pending call object
Returns:
the pending call object
Definition at line
dbus-pending-call_8c-source.html#l00154
154
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-sysdeps_8c-source.html#l01809
_dbus_atomic_inc()
,
group__DBusMacros.html#ga4
NULL
, and
dbus-connection-internal_8h-source.html#l00105
refcount
.
Referenced by
dbus-connection_8c-source.html#l02571
_dbus_connection_block_pending_call()
, and
dbus-connection_8c-source.html#l00875
_dbus_pending_call_complete_and_unlock()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_pending_call_set_data
(
structDBusPendingCall.html
DBusPendingCall
*
pending
,
group__DBusTypes.html#ga4
dbus_int32_t
slot
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func
)
Stores a pointer on a
structDBusPendingCall.html
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
group__DBusPendingCall.html#ga8
dbus_pending_call_allocate_data_slot()
.
Parameters:
pending
the pending_call
slot
the slot number
data
the data to store
free_data_func
finalizer function for the data
Returns:
group__DBusMacros.html#ga2
TRUE
if there was enough memory to store the data
Definition at line
dbus-pending-call_8c-source.html#l00371
371
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-dataslot_8c-source.html#l00233
_dbus_data_slot_list_set()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
dbus-connection-internal_8h-source.html#l00107
slot_list
.
Referenced by
dbus-pending-call_8c-source.html#l00222
dbus_pending_call_set_notify()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_pending_call_set_notify
(
structDBusPendingCall.html
DBusPendingCall
*
pending
,
DBusPendingCallNotifyFunction
function
,
void *
user_data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_user_data
)
Sets a notification function to be called when the reply is received or the pending call times out.
Parameters:
pending
the pending call
function
notifier function
user_data
data to pass to notifier function
free_user_data
function to free the user data
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-pending-call_8c-source.html#l00222
222
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-pending-call_8c-source.html#l00371
dbus_pending_call_set_data()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
structDBusMessage.html
DBusMessage
* dbus_pending_call_steal_reply
(
structDBusPendingCall.html
DBusPendingCall
*
pending
)
Gets the reply, or returns
group__DBusMacros.html#ga4
NULL
if none has been received yet.
Ownership of the reply message passes to the caller. This function can only be called once per pending call, since the reply message is tranferred to the caller.
Parameters:
pending
the pending call
Returns:
the reply message or
group__DBusMacros.html#ga4
NULL
.
Definition at line
dbus-pending-call_8c-source.html#l00280
280
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-connection-internal_8h-source.html#l00119
completed
,
group__DBusMacros.html#ga4
NULL
, and
dbus-connection-internal_8h-source.html#l00112
reply
.
Referenced by
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
.
void dbus_pending_call_unref
(
structDBusPendingCall.html
DBusPendingCall
*
pending
)
Decrements the reference count on a pending call, freeing it if the count reaches 0.
Parameters:
pending
the pending call object
Definition at line
dbus-pending-call_8c-source.html#l00170
170
of file
dbus-pending-call_8c-source.html
dbus-pending-call.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01832
_dbus_atomic_dec()
,
dbus-dataslot_8c-source.html#l00348
_dbus_data_slot_list_free()
,
dbus-list_8c-source.html#l00233
_dbus_list_free_link()
,
dbus-timeout_8c-source.html#l00106
_dbus_timeout_unref()
,
dbus-connection-internal_8h-source.html#l00111
connection
,
dbus-list_8h-source.html#l00039
DBusList::data
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-pending-call_8c-source.html#l00350
dbus_pending_call_free_data_slot()
,
group__DBusMacros.html#ga4
NULL
,
dbus-connection-internal_8h-source.html#l00105
refcount
,
dbus-connection-internal_8h-source.html#l00112
reply
,
dbus-connection-internal_8h-source.html#l00107
slot_list
,
dbus-connection-internal_8h-source.html#l00113
timeout
,
dbus-connection-internal_8h-source.html#l00120
timeout_added
, and
dbus-connection-internal_8h-source.html#l00115
timeout_link
.
Referenced by
dbus-connection_8c-source.html#l02571
_dbus_connection_block_pending_call()
,
dbus-connection_8c-source.html#l00875
_dbus_pending_call_complete_and_unlock()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-connection_8c-source.html#l02416
dbus_connection_send_with_reply()
, and
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
