| Current File : //usr/share/doc/dbus/api/dbus-pending-call_8c_source.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: dbus-pending-call.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">D-Bus
 <span id="projectnumber">1.8.20</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">dbus-pending-call.c</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */</span>
<a name="l00002"></a>00002 <span class="comment">/* dbus-pending-call.c Object representing a call in progress.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002, 2003 Red Hat Inc.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * Licensed under the Academic Free License version 2.1</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00010"></a>00010 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00011"></a>00011 <span class="comment"> * (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00019"></a>00019 <span class="comment"> * along with this program; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> *</span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#include <config.h></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "dbus-internals.h"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "dbus-connection-internal.h"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "dbus-message-internal.h"</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "dbus-pending-call-internal.h"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "dbus-pending-call.h"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "dbus-list.h"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "dbus-threads.h"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "dbus-test.h"</span>
<a name="l00033"></a>00033
<a name="l00053"></a><a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4">00053</a> <span class="preprocessor">#define CONNECTION_LOCK(connection) _dbus_connection_lock(connection)</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00057"></a><a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33">00057</a> <span class="preprocessor">#define CONNECTION_UNLOCK(connection) _dbus_connection_unlock(connection)</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span>
<a name="l00062"></a><a class="code" href="structDBusPendingCall.html">00062</a> <span class="keyword">struct </span><a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a>
<a name="l00063"></a>00063 {
<a name="l00064"></a><a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d">00064</a> <a class="code" href="structDBusAtomic.html" title="An atomic integer safe to increment or decrement from multiple threads.">DBusAtomic</a> <a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d" title="reference count">refcount</a>;
<a name="l00066"></a><a class="code" href="structDBusPendingCall.html#ad1b1c044ae4f9f94b05b4a5eb2f3917a">00066</a> <a class="code" href="structDBusDataSlotList.html" title="Data structure that stores the actual user data set at a given slot.">DBusDataSlotList</a> <a class="code" href="structDBusPendingCall.html#ad1b1c044ae4f9f94b05b4a5eb2f3917a" title="Data stored by allocated integer ID.">slot_list</a>;
<a name="l00068"></a><a class="code" href="structDBusPendingCall.html#a057527b236383b2f3436f4ed5ddc2d4b">00068</a> <a class="code" href="group__DBusConnection.html#ga90b8d85edb44420f7a8ea6baafb3bf88" title="Called when a pending call now has a reply available.">DBusPendingCallNotifyFunction</a> <span class="keyword">function</span>;
<a name="l00070"></a><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f">00070</a> <a class="code" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> *<a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>;
<a name="l00071"></a><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57">00071</a> <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *<a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a>;
<a name="l00072"></a><a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8">00072</a> <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *<a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8" title="Timeout.">timeout</a>;
<a name="l00074"></a><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c">00074</a> <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *<a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>;
<a name="l00076"></a><a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100">00076</a> <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> <a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100" title="Expected serial of reply.">reply_serial</a>;
<a name="l00078"></a><a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa">00078</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa" title="TRUE if completed.">completed</a> : 1;
<a name="l00079"></a><a class="code" href="structDBusPendingCall.html#a9e1230f62e6ada8af3903d299f2ff0b4">00079</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structDBusPendingCall.html#a9e1230f62e6ada8af3903d299f2ff0b4" title="Have added the timeout.">timeout_added</a> : 1;
<a name="l00080"></a>00080 };
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00083"></a>00083 _dbus_pending_call_trace_ref (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending_call,
<a name="l00084"></a>00084 <span class="keywordtype">int</span> old_refcount,
<a name="l00085"></a>00085 <span class="keywordtype">int</span> new_refcount,
<a name="l00086"></a>00086 <span class="keyword">const</span> <span class="keywordtype">char</span> *why)
<a name="l00087"></a>00087 {
<a name="l00088"></a>00088 <span class="preprocessor">#ifdef DBUS_ENABLE_VERBOSE_MODE</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span> <span class="keyword">static</span> <span class="keywordtype">int</span> enabled = -1;
<a name="l00090"></a>00090
<a name="l00091"></a>00091 _dbus_trace_ref (<span class="stringliteral">"DBusPendingCall"</span>, pending_call, old_refcount,
<a name="l00092"></a>00092 new_refcount, why, <span class="stringliteral">"DBUS_PENDING_CALL_TRACE"</span>, &enabled);
<a name="l00093"></a>00093 <span class="preprocessor">#endif</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>}
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> notify_user_data_slot = -1;
<a name="l00097"></a>00097
<a name="l00108"></a>00108 <a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a>*
<a name="l00109"></a><a class="code" href="group__DBusPendingCallInternals.html#ga3f2300d7a768783bc2fae0991bcc55df">00109</a> <a class="code" href="group__DBusPendingCallInternals.html#ga3f2300d7a768783bc2fae0991bcc55df" title="Creates a new pending reply object.">_dbus_pending_call_new_unlocked</a> (<a class="code" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> *connection,
<a name="l00110"></a>00110 <span class="keywordtype">int</span> timeout_milliseconds,
<a name="l00111"></a>00111 <a class="code" href="group__DBusTimeoutInternals.html#ga1533b9aa7bfe55ccb798ab041e4ce242" title="function to run when the timeout is handled">DBusTimeoutHandler</a> timeout_handler)
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 <a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending;
<a name="l00114"></a>00114 <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout;
<a name="l00115"></a>00115
<a name="l00116"></a>00116 _dbus_assert (timeout_milliseconds >= 0 || timeout_milliseconds == -1);
<a name="l00117"></a>00117
<a name="l00118"></a>00118 <span class="keywordflow">if</span> (timeout_milliseconds == -1)
<a name="l00119"></a>00119 timeout_milliseconds = _DBUS_DEFAULT_TIMEOUT_VALUE;
<a name="l00120"></a>00120
<a name="l00121"></a>00121 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusPendingCall.html#ga95614dad0ada70e3a20d9878339e3109" title="Allocates an integer ID to be used for storing application-specific data on any DBusPendingCall.">dbus_pending_call_allocate_data_slot</a> (&notify_user_data_slot))
<a name="l00122"></a>00122 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00123"></a>00123
<a name="l00124"></a>00124 pending = <a class="code" href="group__DBusMemory.html#gaba9d823abda7f4cadbaf5177d3b8b793" title="Safe macro for using dbus_malloc0().">dbus_new0</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a>, 1);
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="keywordflow">if</span> (pending == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128 <a class="code" href="group__DBusPendingCall.html#ga1eb6f342bba71b01266629f80be84617" title="Deallocates a global ID for DBusPendingCall data slots.">dbus_pending_call_free_data_slot</a> (&notify_user_data_slot);
<a name="l00129"></a>00129 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="keywordflow">if</span> (timeout_milliseconds != <a class="code" href="group__DBusPendingCall.html#ga21384c9c5b0da54f7d0a92012522f213" title="An integer constant representing an infinite timeout.">DBUS_TIMEOUT_INFINITE</a>)
<a name="l00133"></a>00133 {
<a name="l00134"></a>00134 timeout = <a class="code" href="group__DBusTimeoutInternals.html#ga3f63abde6bb7ebecf6fa8774ba501a26" title="Creates a new DBusTimeout, enabled by default.">_dbus_timeout_new</a> (timeout_milliseconds,
<a name="l00135"></a>00135 timeout_handler,
<a name="l00136"></a>00136 pending, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="keywordflow">if</span> (timeout == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00139"></a>00139 {
<a name="l00140"></a>00140 <a class="code" href="group__DBusPendingCall.html#ga1eb6f342bba71b01266629f80be84617" title="Deallocates a global ID for DBusPendingCall data slots.">dbus_pending_call_free_data_slot</a> (&notify_user_data_slot);
<a name="l00141"></a>00141 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (pending);
<a name="l00142"></a>00142 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144
<a name="l00145"></a>00145 pending-><a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8" title="Timeout.">timeout</a> = timeout;
<a name="l00146"></a>00146 }
<a name="l00147"></a>00147 <span class="keywordflow">else</span>
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149 pending-><a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8" title="Timeout.">timeout</a> = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151
<a name="l00152"></a>00152 <a class="code" href="group__DBusSysdeps.html#gae74c3fcf12acaeccdb152ef907de951c" title="Atomically increments an integer.">_dbus_atomic_inc</a> (&pending-><a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d" title="reference count">refcount</a>);
<a name="l00153"></a>00153 pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a> = connection;
<a name="l00154"></a>00154 <a class="code" href="group__DBusConnectionInternals.html#ga7151f75b5d2308ec80cfe893aba72aa1" title="Increments the reference count of a DBusConnection.">_dbus_connection_ref_unlocked</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <a class="code" href="group__DBusDataSlot.html#ga6de49b3a1210202215d40a5a19806992" title="Initializes a slot list.">_dbus_data_slot_list_init</a> (&pending-><a class="code" href="structDBusPendingCall.html#ad1b1c044ae4f9f94b05b4a5eb2f3917a" title="Data stored by allocated integer ID.">slot_list</a>);
<a name="l00157"></a>00157
<a name="l00158"></a>00158 _dbus_pending_call_trace_ref (pending, 0, 1, <span class="stringliteral">"new_unlocked"</span>);
<a name="l00159"></a>00159
<a name="l00160"></a>00160 <span class="keywordflow">return</span> pending;
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162
<a name="l00171"></a>00171 <span class="keywordtype">void</span>
<a name="l00172"></a><a class="code" href="group__DBusPendingCallInternals.html#ga4b8cc560549160aecd924037a872009d">00172</a> <a class="code" href="group__DBusPendingCallInternals.html#ga4b8cc560549160aecd924037a872009d" title="Sets the reply of a pending call with the given message, or if the message is NULL, by timing out the pending call.">_dbus_pending_call_set_reply_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00173"></a>00173 <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message)
<a name="l00174"></a>00174 {
<a name="l00175"></a>00175 <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00176"></a>00176 {
<a name="l00177"></a>00177 message = pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>-><a class="code" href="structDBusList.html#a29ab457bcf9092252bb0c4282c727055" title="Data stored at this element.">data</a>;
<a name="l00178"></a>00178 <a class="code" href="group__DBusList.html#gaa36d13444a050a923941c53650b72f9d" title="Frees all links in the list and sets the list head to NULL.">_dbus_list_clear</a> (&pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>);
<a name="l00179"></a>00179 }
<a name="l00180"></a>00180 <span class="keywordflow">else</span>
<a name="l00181"></a>00181 <a class="code" href="group__DBusMessage.html#ga834035e4817acd64adc8ca584bdf3982" title="Increments the reference count of a DBusMessage.">dbus_message_ref</a> (message);
<a name="l00182"></a>00182
<a name="l00183"></a>00183 _dbus_verbose (<span class="stringliteral">" handing message %p (%s) to pending call serial %u\n"</span>,
<a name="l00184"></a>00184 message,
<a name="l00185"></a>00185 <a class="code" href="group__DBusMessage.html#ga41cace31999105137772b6257ea540f9" title="Gets the type of a message.">dbus_message_get_type</a> (message) == <a class="code" href="group__DBusProtocol.html#ga4a9012edd7f22342f845e98150aeb858" title="Message type of a method return message, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_METHOD_RETURN</a> ?
<a name="l00186"></a>00186 <span class="stringliteral">"method return"</span> :
<a name="l00187"></a>00187 <a class="code" href="group__DBusMessage.html#ga41cace31999105137772b6257ea540f9" title="Gets the type of a message.">dbus_message_get_type</a> (message) == <a class="code" href="group__DBusProtocol.html#ga2b9423d95066313d73eeea8eeaf86812" title="Message type of an error reply message, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_ERROR</a> ?
<a name="l00188"></a>00188 <span class="stringliteral">"error"</span> : <span class="stringliteral">"other type"</span>,
<a name="l00189"></a>00189 pending-><a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100" title="Expected serial of reply.">reply_serial</a>);
<a name="l00190"></a>00190
<a name="l00191"></a>00191 _dbus_assert (pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a> == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00192"></a>00192 _dbus_assert (pending-><a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100" title="Expected serial of reply.">reply_serial</a> == <a class="code" href="group__DBusMessage.html#ga94c43b2b237d842a6b91da6f94818d47" title="Returns the serial that the message is a reply to or 0 if none.">dbus_message_get_reply_serial</a> (message));
<a name="l00193"></a>00193 pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a> = message;
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195
<a name="l00203"></a>00203 <span class="keywordtype">void</span>
<a name="l00204"></a><a class="code" href="group__DBusPendingCallInternals.html#ga6b10d157242e540fd18bd3db733dab5c">00204</a> <a class="code" href="group__DBusPendingCallInternals.html#ga6b10d157242e540fd18bd3db733dab5c" title="Calls notifier function for the pending call and sets the call to completed.">_dbus_pending_call_complete</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00205"></a>00205 {
<a name="l00206"></a>00206 _dbus_assert (!pending-><a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa" title="TRUE if completed.">completed</a>);
<a name="l00207"></a>00207
<a name="l00208"></a>00208 pending-><a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa" title="TRUE if completed.">completed</a> = <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00209"></a>00209
<a name="l00210"></a>00210 <span class="keywordflow">if</span> (pending-><a class="code" href="structDBusPendingCall.html#a057527b236383b2f3436f4ed5ddc2d4b" title="Notifier when reply arrives.">function</a>)
<a name="l00211"></a>00211 {
<a name="l00212"></a>00212 <span class="keywordtype">void</span> *user_data;
<a name="l00213"></a>00213 user_data = <a class="code" href="group__DBusPendingCall.html#ga5749f73b7ec7a8fe4f2e6a839e292806" title="Retrieves data previously set with dbus_pending_call_set_data().">dbus_pending_call_get_data</a> (pending,
<a name="l00214"></a>00214 notify_user_data_slot);
<a name="l00215"></a>00215
<a name="l00216"></a>00216 (* pending-><a class="code" href="structDBusPendingCall.html#a057527b236383b2f3436f4ed5ddc2d4b" title="Notifier when reply arrives.">function</a>) (pending, user_data);
<a name="l00217"></a>00217 }
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219
<a name="l00227"></a>00227 <span class="keywordtype">void</span>
<a name="l00228"></a><a class="code" href="group__DBusPendingCallInternals.html#ga1bc4de7652108d0629522a4e3adffcab">00228</a> <a class="code" href="group__DBusPendingCallInternals.html#ga1bc4de7652108d0629522a4e3adffcab" title="If the pending call hasn't been timed out, add its timeout error reply to the connection's incoming m...">_dbus_pending_call_queue_timeout_error_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00229"></a>00229 <a class="code" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> *connection)
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231 _dbus_assert (connection == pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00232"></a>00232
<a name="l00233"></a>00233 <span class="keywordflow">if</span> (pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>)
<a name="l00234"></a>00234 {
<a name="l00235"></a>00235 <a class="code" href="group__DBusConnectionInternals.html#gadb7a525dc6b566b575ee4f9b20028b04" title="Adds a link + message to the incoming message queue.">_dbus_connection_queue_synthesized_message_link</a> (connection,
<a name="l00236"></a>00236 pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>);
<a name="l00237"></a>00237 pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a> = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00238"></a>00238 }
<a name="l00239"></a>00239 }
<a name="l00240"></a>00240
<a name="l00247"></a>00247 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00248"></a><a class="code" href="group__DBusPendingCallInternals.html#gaf1e630b966722af540502329ed028254">00248</a> <a class="code" href="group__DBusPendingCallInternals.html#gaf1e630b966722af540502329ed028254" title="Checks to see if a timeout has been added.">_dbus_pending_call_is_timeout_added_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00249"></a>00249 {
<a name="l00250"></a>00250 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00251"></a>00251
<a name="l00252"></a>00252 <span class="keywordflow">return</span> pending-><a class="code" href="structDBusPendingCall.html#a9e1230f62e6ada8af3903d299f2ff0b4" title="Have added the timeout.">timeout_added</a>;
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254
<a name="l00255"></a>00255
<a name="l00262"></a>00262 <span class="keywordtype">void</span>
<a name="l00263"></a><a class="code" href="group__DBusPendingCallInternals.html#gafea13f8b9977d341e41201c407adea2a">00263</a> <a class="code" href="group__DBusPendingCallInternals.html#gafea13f8b9977d341e41201c407adea2a" title="Sets wether the timeout has been added.">_dbus_pending_call_set_timeout_added_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00264"></a>00264 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> is_added)
<a name="l00265"></a>00265 {
<a name="l00266"></a>00266 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00267"></a>00267
<a name="l00268"></a>00268 pending-><a class="code" href="structDBusPendingCall.html#a9e1230f62e6ada8af3903d299f2ff0b4" title="Have added the timeout.">timeout_added</a> = is_added;
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270
<a name="l00271"></a>00271
<a name="l00278"></a>00278 <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *
<a name="l00279"></a><a class="code" href="group__DBusPendingCallInternals.html#gaa9acac047b61c9a0eaff1977151e9e08">00279</a> <a class="code" href="group__DBusPendingCallInternals.html#gaa9acac047b61c9a0eaff1977151e9e08" title="Retrives the timeout.">_dbus_pending_call_get_timeout_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00280"></a>00280 {
<a name="l00281"></a>00281 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00282"></a>00282
<a name="l00283"></a>00283 <span class="keywordflow">return</span> pending-><a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8" title="Timeout.">timeout</a>;
<a name="l00284"></a>00284 }
<a name="l00285"></a>00285
<a name="l00292"></a>00292 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>
<a name="l00293"></a><a class="code" href="group__DBusPendingCallInternals.html#gaf5f3df36149bfe55d824eb08d00768fc">00293</a> <a class="code" href="group__DBusPendingCallInternals.html#gaf5f3df36149bfe55d824eb08d00768fc" title="Gets the reply's serial number.">_dbus_pending_call_get_reply_serial_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00294"></a>00294 {
<a name="l00295"></a>00295 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00296"></a>00296
<a name="l00297"></a>00297 <span class="keywordflow">return</span> pending-><a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100" title="Expected serial of reply.">reply_serial</a>;
<a name="l00298"></a>00298 }
<a name="l00299"></a>00299
<a name="l00306"></a>00306 <span class="keywordtype">void</span>
<a name="l00307"></a><a class="code" href="group__DBusPendingCallInternals.html#ga4c0325356df50a5dc103bdab3e7148f3">00307</a> <a class="code" href="group__DBusPendingCallInternals.html#ga4c0325356df50a5dc103bdab3e7148f3" title="Sets the reply's serial number.">_dbus_pending_call_set_reply_serial_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00308"></a>00308 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> serial)
<a name="l00309"></a>00309 {
<a name="l00310"></a>00310 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00311"></a>00311 _dbus_assert (pending-><a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100" title="Expected serial of reply.">reply_serial</a> == 0);
<a name="l00312"></a>00312
<a name="l00313"></a>00313 pending-><a class="code" href="structDBusPendingCall.html#ab6234d38b3f3ca8ff5de2d3cce8c3100" title="Expected serial of reply.">reply_serial</a> = serial;
<a name="l00314"></a>00314 }
<a name="l00315"></a>00315
<a name="l00322"></a>00322 <a class="code" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> *
<a name="l00323"></a><a class="code" href="group__DBusPendingCallInternals.html#ga68e5ff616e6a6563d83966c3d88b9b32">00323</a> <a class="code" href="group__DBusPendingCallInternals.html#ga68e5ff616e6a6563d83966c3d88b9b32" title="Gets the connection associated with this pending call.">_dbus_pending_call_get_connection_and_lock</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00324"></a>00324 {
<a name="l00325"></a>00325 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00326"></a>00326
<a name="l00327"></a>00327 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00328"></a>00328 <span class="keywordflow">return</span> pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>;
<a name="l00329"></a>00329 }
<a name="l00330"></a>00330
<a name="l00337"></a>00337 <a class="code" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> *
<a name="l00338"></a><a class="code" href="group__DBusPendingCallInternals.html#gae725060aa80d9df58dcee4f1fa108784">00338</a> <a class="code" href="group__DBusPendingCallInternals.html#gae725060aa80d9df58dcee4f1fa108784" title="Gets the connection associated with this pending call.">_dbus_pending_call_get_connection_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00339"></a>00339 {
<a name="l00340"></a>00340 _dbus_assert (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00341"></a>00341
<a name="l00342"></a>00342 <span class="keywordflow">return</span> pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>;
<a name="l00343"></a>00343 }
<a name="l00344"></a>00344
<a name="l00353"></a>00353 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00354"></a><a class="code" href="group__DBusPendingCallInternals.html#ga9901fc4c5fd2db9bf1ce2dcc9abf55fc">00354</a> <a class="code" href="group__DBusPendingCallInternals.html#ga9901fc4c5fd2db9bf1ce2dcc9abf55fc" title="Sets the reply message associated with the pending call to a timeout error.">_dbus_pending_call_set_timeout_error_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00355"></a>00355 <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message,
<a name="l00356"></a>00356 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> serial)
<a name="l00357"></a>00357 {
<a name="l00358"></a>00358 <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *reply_link;
<a name="l00359"></a>00359 <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *reply;
<a name="l00360"></a>00360
<a name="l00361"></a>00361 reply = <a class="code" href="group__DBusMessage.html#ga2ab896965aec97fb21293affeed36232" title="Creates a new message that is an error reply to another message.">dbus_message_new_error</a> (message, <a class="code" href="group__DBusProtocol.html#gade2cb1c5a6adf47af18672865f233b6d" title="No reply to a message expecting one, usually means a timeout occurred.">DBUS_ERROR_NO_REPLY</a>,
<a name="l00362"></a>00362 <span class="stringliteral">"Did not receive a reply. Possible causes include: "</span>
<a name="l00363"></a>00363 <span class="stringliteral">"the remote application did not send a reply, "</span>
<a name="l00364"></a>00364 <span class="stringliteral">"the message bus security policy blocked the reply, "</span>
<a name="l00365"></a>00365 <span class="stringliteral">"the reply timeout expired, or "</span>
<a name="l00366"></a>00366 <span class="stringliteral">"the network connection was broken."</span>);
<a name="l00367"></a>00367 <span class="keywordflow">if</span> (reply == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00368"></a>00368 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00369"></a>00369
<a name="l00370"></a>00370 reply_link = <a class="code" href="group__DBusList.html#gac20b9981531cef590d49a59240344cd8" title="Allocates a linked list node.">_dbus_list_alloc_link</a> (reply);
<a name="l00371"></a>00371 <span class="keywordflow">if</span> (reply_link == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00372"></a>00372 {
<a name="l00373"></a>00373 <span class="comment">/* it's OK to unref this, nothing that could have attached a callback</span>
<a name="l00374"></a>00374 <span class="comment"> * has ever seen it */</span>
<a name="l00375"></a>00375 <a class="code" href="group__DBusMessage.html#gab69441efe683918f6a82469c8763f464" title="Decrements the reference count of a DBusMessage, freeing the message if the count reaches 0...">dbus_message_unref</a> (reply);
<a name="l00376"></a>00376 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00377"></a>00377 }
<a name="l00378"></a>00378
<a name="l00379"></a>00379 pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a> = reply_link;
<a name="l00380"></a>00380
<a name="l00381"></a>00381 <a class="code" href="group__DBusPendingCallInternals.html#ga4c0325356df50a5dc103bdab3e7148f3" title="Sets the reply's serial number.">_dbus_pending_call_set_reply_serial_unlocked</a> (pending, serial);
<a name="l00382"></a>00382
<a name="l00383"></a>00383 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00384"></a>00384 }
<a name="l00385"></a>00385
<a name="l00393"></a>00393 <a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *
<a name="l00394"></a><a class="code" href="group__DBusPendingCallInternals.html#ga9d8987da3747604d370ffec2c5e1e10a">00394</a> <a class="code" href="group__DBusPendingCallInternals.html#ga9d8987da3747604d370ffec2c5e1e10a" title="Increments the reference count on a pending call, while the lock on its connection is already held...">_dbus_pending_call_ref_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00395"></a>00395 {
<a name="l00396"></a>00396 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> old_refcount;
<a name="l00397"></a>00397
<a name="l00398"></a>00398 old_refcount = <a class="code" href="group__DBusSysdeps.html#gae74c3fcf12acaeccdb152ef907de951c" title="Atomically increments an integer.">_dbus_atomic_inc</a> (&pending-><a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d" title="reference count">refcount</a>);
<a name="l00399"></a>00399 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
<a name="l00400"></a>00400 <span class="stringliteral">"ref_unlocked"</span>);
<a name="l00401"></a>00401
<a name="l00402"></a>00402 <span class="keywordflow">return</span> pending;
<a name="l00403"></a>00403 }
<a name="l00404"></a>00404
<a name="l00405"></a>00405
<a name="l00406"></a>00406 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00407"></a>00407 _dbus_pending_call_last_unref (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00408"></a>00408 {
<a name="l00409"></a>00409 <a class="code" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> *connection;
<a name="l00410"></a>00410
<a name="l00411"></a>00411 <span class="comment">/* If we get here, we should be already detached</span>
<a name="l00412"></a>00412 <span class="comment"> * from the connection, or never attached.</span>
<a name="l00413"></a>00413 <span class="comment"> */</span>
<a name="l00414"></a>00414 _dbus_assert (!pending-><a class="code" href="structDBusPendingCall.html#a9e1230f62e6ada8af3903d299f2ff0b4" title="Have added the timeout.">timeout_added</a>);
<a name="l00415"></a>00415
<a name="l00416"></a>00416 connection = pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>;
<a name="l00417"></a>00417
<a name="l00418"></a>00418 <span class="comment">/* this assumes we aren't holding connection lock... */</span>
<a name="l00419"></a>00419 <a class="code" href="group__DBusDataSlot.html#gabc399733376c462c3010271a2d431e73" title="Frees the data slot list and all data slots contained in it, calling application-provided free functi...">_dbus_data_slot_list_free</a> (&pending-><a class="code" href="structDBusPendingCall.html#ad1b1c044ae4f9f94b05b4a5eb2f3917a" title="Data stored by allocated integer ID.">slot_list</a>);
<a name="l00420"></a>00420
<a name="l00421"></a>00421 <span class="keywordflow">if</span> (pending-><a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8" title="Timeout.">timeout</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00422"></a>00422 <a class="code" href="group__DBusTimeoutInternals.html#gaea6359793576a2eec42e27267bae7bbd" title="Decrements the reference count of a DBusTimeout object and finalizes the object if the count reaches ...">_dbus_timeout_unref</a> (pending-><a class="code" href="structDBusPendingCall.html#af9dea193bf4ab249c280ff6abcb743f8" title="Timeout.">timeout</a>);
<a name="l00423"></a>00423
<a name="l00424"></a>00424 <span class="keywordflow">if</span> (pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>)
<a name="l00425"></a>00425 {
<a name="l00426"></a>00426 <a class="code" href="group__DBusMessage.html#gab69441efe683918f6a82469c8763f464" title="Decrements the reference count of a DBusMessage, freeing the message if the count reaches 0...">dbus_message_unref</a> ((<a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *)pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>-><a class="code" href="structDBusList.html#a29ab457bcf9092252bb0c4282c727055" title="Data stored at this element.">data</a>);
<a name="l00427"></a>00427 <a class="code" href="group__DBusList.html#ga6e824f717125ce40c549d5402e32610f" title="Frees a linked list node allocated with _dbus_list_alloc_link.">_dbus_list_free_link</a> (pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a>);
<a name="l00428"></a>00428 pending-><a class="code" href="structDBusPendingCall.html#a85252a169617a86f80462bfb53ca2f7c" title="Preallocated timeout response.">timeout_link</a> = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00429"></a>00429 }
<a name="l00430"></a>00430
<a name="l00431"></a>00431 <span class="keywordflow">if</span> (pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a>)
<a name="l00432"></a>00432 {
<a name="l00433"></a>00433 <a class="code" href="group__DBusMessage.html#gab69441efe683918f6a82469c8763f464" title="Decrements the reference count of a DBusMessage, freeing the message if the count reaches 0...">dbus_message_unref</a> (pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a>);
<a name="l00434"></a>00434 pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a> = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00435"></a>00435 }
<a name="l00436"></a>00436
<a name="l00437"></a>00437 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (pending);
<a name="l00438"></a>00438
<a name="l00439"></a>00439 <a class="code" href="group__DBusPendingCall.html#ga1eb6f342bba71b01266629f80be84617" title="Deallocates a global ID for DBusPendingCall data slots.">dbus_pending_call_free_data_slot</a> (&notify_user_data_slot);
<a name="l00440"></a>00440
<a name="l00441"></a>00441 <span class="comment">/* connection lock should not be held. */</span>
<a name="l00442"></a>00442 <span class="comment">/* Free the connection last to avoid a weird state while</span>
<a name="l00443"></a>00443 <span class="comment"> * calling out to application code where the pending exists</span>
<a name="l00444"></a>00444 <span class="comment"> * but not the connection.</span>
<a name="l00445"></a>00445 <span class="comment"> */</span>
<a name="l00446"></a>00446 <a class="code" href="group__DBusConnection.html#ga6385ff09bc108238c4429e7c195dab25" title="Decrements the reference count of a DBusConnection, and finalizes it if the count reaches zero...">dbus_connection_unref</a> (connection);
<a name="l00447"></a>00447 }
<a name="l00448"></a>00448
<a name="l00456"></a>00456 <span class="keywordtype">void</span>
<a name="l00457"></a><a class="code" href="group__DBusPendingCallInternals.html#ga26f09beed0dd6323cca0452abf344567">00457</a> <a class="code" href="group__DBusPendingCallInternals.html#ga26f09beed0dd6323cca0452abf344567" title="Decrements the reference count on a pending call, freeing it if the count reaches 0...">_dbus_pending_call_unref_and_unlock</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00458"></a>00458 {
<a name="l00459"></a>00459 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> old_refcount;
<a name="l00460"></a>00460
<a name="l00461"></a>00461 old_refcount = <a class="code" href="group__DBusSysdeps.html#ga3c50a069f795dceeb9172fe2b517bbdc" title="Atomically decrement an integer.">_dbus_atomic_dec</a> (&pending-><a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d" title="reference count">refcount</a>);
<a name="l00462"></a>00462 _dbus_assert (old_refcount > 0);
<a name="l00463"></a>00463 _dbus_pending_call_trace_ref (pending, old_refcount,
<a name="l00464"></a>00464 old_refcount - 1, <span class="stringliteral">"unref_and_unlock"</span>);
<a name="l00465"></a>00465
<a name="l00466"></a>00466 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00467"></a>00467
<a name="l00468"></a>00468 <span class="keywordflow">if</span> (old_refcount == 1)
<a name="l00469"></a>00469 _dbus_pending_call_last_unref (pending);
<a name="l00470"></a>00470 }
<a name="l00471"></a>00471
<a name="l00479"></a>00479 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00480"></a><a class="code" href="group__DBusPendingCallInternals.html#ga37bef4359b3c29629a57f5fe480690a1">00480</a> <a class="code" href="group__DBusPendingCallInternals.html#ga37bef4359b3c29629a57f5fe480690a1" title="Checks whether the pending call has received a reply yet, or not.">_dbus_pending_call_get_completed_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00481"></a>00481 {
<a name="l00482"></a>00482 <span class="keywordflow">return</span> pending-><a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa" title="TRUE if completed.">completed</a>;
<a name="l00483"></a>00483 }
<a name="l00484"></a>00484
<a name="l00485"></a>00485 <span class="keyword">static</span> <a class="code" href="structDBusDataSlotAllocator.html" title="An allocator that tracks a set of slot IDs.">DBusDataSlotAllocator</a> slot_allocator =
<a name="l00486"></a>00486 _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (pending_call_slots));
<a name="l00487"></a>00487
<a name="l00501"></a>00501 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00502"></a><a class="code" href="group__DBusPendingCallInternals.html#ga7d4196ca35b8df842c05a02dbb71c269">00502</a> <a class="code" href="group__DBusPendingCallInternals.html#ga7d4196ca35b8df842c05a02dbb71c269" title="Stores a pointer on a DBusPendingCall, along with an optional function to be used for freeing the dat...">_dbus_pending_call_set_data_unlocked</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00503"></a>00503 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> slot,
<a name="l00504"></a>00504 <span class="keywordtype">void</span> *data,
<a name="l00505"></a>00505 <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> free_data_func)
<a name="l00506"></a>00506 {
<a name="l00507"></a>00507 <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> old_free_func;
<a name="l00508"></a>00508 <span class="keywordtype">void</span> *old_data;
<a name="l00509"></a>00509 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> retval;
<a name="l00510"></a>00510
<a name="l00511"></a>00511 retval = <a class="code" href="group__DBusDataSlot.html#gad2952f9f686d96e7114fc49ab7452e1a" title="Stores a pointer in the data slot list, along with an optional function to be used for freeing the da...">_dbus_data_slot_list_set</a> (&slot_allocator,
<a name="l00512"></a>00512 &pending-><a class="code" href="structDBusPendingCall.html#ad1b1c044ae4f9f94b05b4a5eb2f3917a" title="Data stored by allocated integer ID.">slot_list</a>,
<a name="l00513"></a>00513 slot, data, free_data_func,
<a name="l00514"></a>00514 &old_free_func, &old_data);
<a name="l00515"></a>00515
<a name="l00516"></a>00516 <span class="comment">/* Drop locks to call out to app code */</span>
<a name="l00517"></a>00517 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00518"></a>00518
<a name="l00519"></a>00519 <span class="keywordflow">if</span> (retval)
<a name="l00520"></a>00520 {
<a name="l00521"></a>00521 <span class="keywordflow">if</span> (old_free_func)
<a name="l00522"></a>00522 (* old_free_func) (old_data);
<a name="l00523"></a>00523 }
<a name="l00524"></a>00524
<a name="l00525"></a>00525 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00526"></a>00526
<a name="l00527"></a>00527 <span class="keywordflow">return</span> retval;
<a name="l00528"></a>00528 }
<a name="l00529"></a>00529
<a name="l00576"></a>00576 <a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *
<a name="l00577"></a><a class="code" href="group__DBusPendingCall.html#ga334f6c6621583e15fdaf1a3f93dd2221">00577</a> <a class="code" href="group__DBusPendingCall.html#ga334f6c6621583e15fdaf1a3f93dd2221" title="Increments the reference count on a pending call.">dbus_pending_call_ref</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00578"></a>00578 {
<a name="l00579"></a>00579 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> old_refcount;
<a name="l00580"></a>00580
<a name="l00581"></a>00581 _dbus_return_val_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00582"></a>00582
<a name="l00583"></a>00583 old_refcount = <a class="code" href="group__DBusSysdeps.html#gae74c3fcf12acaeccdb152ef907de951c" title="Atomically increments an integer.">_dbus_atomic_inc</a> (&pending-><a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d" title="reference count">refcount</a>);
<a name="l00584"></a>00584 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
<a name="l00585"></a>00585 <span class="stringliteral">"ref"</span>);
<a name="l00586"></a>00586
<a name="l00587"></a>00587 <span class="keywordflow">return</span> pending;
<a name="l00588"></a>00588 }
<a name="l00589"></a>00589
<a name="l00596"></a>00596 <span class="keywordtype">void</span>
<a name="l00597"></a><a class="code" href="group__DBusPendingCall.html#gadaba15a74ba4925cdef52d4791cd3147">00597</a> <a class="code" href="group__DBusPendingCall.html#gadaba15a74ba4925cdef52d4791cd3147" title="Decrements the reference count on a pending call, freeing it if the count reaches 0...">dbus_pending_call_unref</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00598"></a>00598 {
<a name="l00599"></a>00599 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> old_refcount;
<a name="l00600"></a>00600
<a name="l00601"></a>00601 _dbus_return_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00602"></a>00602
<a name="l00603"></a>00603 old_refcount = <a class="code" href="group__DBusSysdeps.html#ga3c50a069f795dceeb9172fe2b517bbdc" title="Atomically decrement an integer.">_dbus_atomic_dec</a> (&pending-><a class="code" href="structDBusPendingCall.html#a952e3c744db112d49bbaffe0fe45048d" title="reference count">refcount</a>);
<a name="l00604"></a>00604 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount - 1,
<a name="l00605"></a>00605 <span class="stringliteral">"unref"</span>);
<a name="l00606"></a>00606
<a name="l00607"></a>00607 <span class="keywordflow">if</span> (old_refcount == 1)
<a name="l00608"></a>00608 _dbus_pending_call_last_unref(pending);
<a name="l00609"></a>00609 }
<a name="l00610"></a>00610
<a name="l00621"></a>00621 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00622"></a><a class="code" href="group__DBusPendingCall.html#ga16b67b418b1dc27cfdda6b20f7447670">00622</a> <a class="code" href="group__DBusPendingCall.html#ga16b67b418b1dc27cfdda6b20f7447670" title="Sets a notification function to be called when the reply is received or the pending call times out...">dbus_pending_call_set_notify</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00623"></a>00623 <a class="code" href="group__DBusConnection.html#ga90b8d85edb44420f7a8ea6baafb3bf88" title="Called when a pending call now has a reply available.">DBusPendingCallNotifyFunction</a> <span class="keyword">function</span>,
<a name="l00624"></a>00624 <span class="keywordtype">void</span> *user_data,
<a name="l00625"></a>00625 <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> free_user_data)
<a name="l00626"></a>00626 {
<a name="l00627"></a>00627 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> ret = <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00628"></a>00628
<a name="l00629"></a>00629 _dbus_return_val_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>);
<a name="l00630"></a>00630
<a name="l00631"></a>00631 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00632"></a>00632
<a name="l00633"></a>00633 <span class="comment">/* could invoke application code! */</span>
<a name="l00634"></a>00634 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusPendingCallInternals.html#ga7d4196ca35b8df842c05a02dbb71c269" title="Stores a pointer on a DBusPendingCall, along with an optional function to be used for freeing the dat...">_dbus_pending_call_set_data_unlocked</a> (pending, notify_user_data_slot,
<a name="l00635"></a>00635 user_data, free_user_data))
<a name="l00636"></a>00636 <span class="keywordflow">goto</span> out;
<a name="l00637"></a>00637
<a name="l00638"></a>00638 pending-><a class="code" href="structDBusPendingCall.html#a057527b236383b2f3436f4ed5ddc2d4b" title="Notifier when reply arrives.">function</a> = <span class="keyword">function</span>;
<a name="l00639"></a>00639 ret = <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00640"></a>00640
<a name="l00641"></a>00641 out:
<a name="l00642"></a>00642 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00643"></a>00643
<a name="l00644"></a>00644 <span class="keywordflow">return</span> ret;
<a name="l00645"></a>00645 }
<a name="l00646"></a>00646
<a name="l00662"></a>00662 <span class="keywordtype">void</span>
<a name="l00663"></a><a class="code" href="group__DBusPendingCall.html#ga6530d18f891d3ca5f5df87ea7c2b155c">00663</a> <a class="code" href="group__DBusPendingCall.html#ga6530d18f891d3ca5f5df87ea7c2b155c" title="Cancels the pending call, such that any reply or error received will just be ignored.">dbus_pending_call_cancel</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00664"></a>00664 {
<a name="l00665"></a>00665 _dbus_return_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00666"></a>00666
<a name="l00667"></a>00667 <a class="code" href="group__DBusConnectionInternals.html#ga968196bee49659e75c54b53d7c85fa51" title="Removes a pending call from the connection, such that the pending reply will be ignored.">_dbus_connection_remove_pending_call</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>,
<a name="l00668"></a>00668 pending);
<a name="l00669"></a>00669 }
<a name="l00670"></a>00670
<a name="l00678"></a>00678 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00679"></a><a class="code" href="group__DBusPendingCall.html#gacbf33ae8a1cc125628f9ea44d175c159">00679</a> <a class="code" href="group__DBusPendingCall.html#gacbf33ae8a1cc125628f9ea44d175c159" title="Checks whether the pending call has received a reply yet, or not.">dbus_pending_call_get_completed</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00680"></a>00680 {
<a name="l00681"></a>00681 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> completed;
<a name="l00682"></a>00682
<a name="l00683"></a>00683 _dbus_return_val_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>);
<a name="l00684"></a>00684
<a name="l00685"></a>00685 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00686"></a>00686 completed = pending-><a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa" title="TRUE if completed.">completed</a>;
<a name="l00687"></a>00687 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00688"></a>00688
<a name="l00689"></a>00689 <span class="keywordflow">return</span> completed;
<a name="l00690"></a>00690 }
<a name="l00691"></a>00691
<a name="l00701"></a>00701 <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>*
<a name="l00702"></a><a class="code" href="group__DBusPendingCall.html#ga5a738928c2369fef093ce00658903d06">00702</a> <a class="code" href="group__DBusPendingCall.html#ga5a738928c2369fef093ce00658903d06" title="Gets the reply, or returns NULL if none has been received yet.">dbus_pending_call_steal_reply</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00703"></a>00703 {
<a name="l00704"></a>00704 <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00705"></a>00705
<a name="l00706"></a>00706 _dbus_return_val_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00707"></a>00707 _dbus_return_val_if_fail (pending-><a class="code" href="structDBusPendingCall.html#ac9b0b400f7d555e4e2b3eb1e5f4c26aa" title="TRUE if completed.">completed</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00708"></a>00708 _dbus_return_val_if_fail (pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00709"></a>00709
<a name="l00710"></a>00710 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00711"></a>00711
<a name="l00712"></a>00712 message = pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a>;
<a name="l00713"></a>00713 pending-><a class="code" href="structDBusPendingCall.html#a30c043b7cc468ab01fce6596dac1da57" title="Reply (after we've received it)">reply</a> = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00714"></a>00714
<a name="l00715"></a>00715 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00716"></a>00716
<a name="l00717"></a>00717 _dbus_message_trace_ref (message, -1, -1, <span class="stringliteral">"dbus_pending_call_steal_reply"</span>);
<a name="l00718"></a>00718 <span class="keywordflow">return</span> message;
<a name="l00719"></a>00719 }
<a name="l00720"></a>00720
<a name="l00736"></a>00736 <span class="keywordtype">void</span>
<a name="l00737"></a><a class="code" href="group__DBusPendingCall.html#ga67b99f749a7f477c7b5d70f2acee5452">00737</a> <a class="code" href="group__DBusPendingCall.html#ga67b99f749a7f477c7b5d70f2acee5452" title="Block until the pending call is completed.">dbus_pending_call_block</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending)
<a name="l00738"></a>00738 {
<a name="l00739"></a>00739 _dbus_return_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00740"></a>00740
<a name="l00741"></a>00741 <a class="code" href="group__DBusConnectionInternals.html#gad5e725e66dc16a411544e25675fb9fba" title="Blocks until a pending call times out or gets a reply.">_dbus_connection_block_pending_call</a> (pending);
<a name="l00742"></a>00742 }
<a name="l00743"></a>00743
<a name="l00758"></a>00758 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00759"></a><a class="code" href="group__DBusPendingCall.html#ga95614dad0ada70e3a20d9878339e3109">00759</a> <a class="code" href="group__DBusPendingCall.html#ga95614dad0ada70e3a20d9878339e3109" title="Allocates an integer ID to be used for storing application-specific data on any DBusPendingCall.">dbus_pending_call_allocate_data_slot</a> (<a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> *slot_p)
<a name="l00760"></a>00760 {
<a name="l00761"></a>00761 _dbus_return_val_if_fail (slot_p != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>);
<a name="l00762"></a>00762
<a name="l00763"></a>00763 <span class="keywordflow">return</span> <a class="code" href="group__DBusDataSlot.html#gaf61f2bd0148bace4f67a2d6d97b26ea9" title="Allocates an integer ID to be used for storing data in a DBusDataSlotList.">_dbus_data_slot_allocator_alloc</a> (&slot_allocator,
<a name="l00764"></a>00764 slot_p);
<a name="l00765"></a>00765 }
<a name="l00766"></a>00766
<a name="l00778"></a>00778 <span class="keywordtype">void</span>
<a name="l00779"></a><a class="code" href="group__DBusPendingCall.html#ga1eb6f342bba71b01266629f80be84617">00779</a> <a class="code" href="group__DBusPendingCall.html#ga1eb6f342bba71b01266629f80be84617" title="Deallocates a global ID for DBusPendingCall data slots.">dbus_pending_call_free_data_slot</a> (<a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> *slot_p)
<a name="l00780"></a>00780 {
<a name="l00781"></a>00781 _dbus_return_if_fail (slot_p != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00782"></a>00782 _dbus_return_if_fail (*slot_p >= 0);
<a name="l00783"></a>00783
<a name="l00784"></a>00784 <a class="code" href="group__DBusDataSlot.html#ga059c50a24cd9fc984e918e6159841633" title="Deallocates an ID previously allocated with _dbus_data_slot_allocator_alloc().">_dbus_data_slot_allocator_free</a> (&slot_allocator, slot_p);
<a name="l00785"></a>00785 }
<a name="l00786"></a>00786
<a name="l00800"></a>00800 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00801"></a><a class="code" href="group__DBusPendingCall.html#ga9295e7e602c41c6501b69bc995907e1b">00801</a> <a class="code" href="group__DBusPendingCall.html#ga9295e7e602c41c6501b69bc995907e1b" title="Stores a pointer on a DBusPendingCall, along with an optional function to be used for freeing the dat...">dbus_pending_call_set_data</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00802"></a>00802 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> slot,
<a name="l00803"></a>00803 <span class="keywordtype">void</span> *data,
<a name="l00804"></a>00804 <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> free_data_func)
<a name="l00805"></a>00805 {
<a name="l00806"></a>00806 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> retval;
<a name="l00807"></a>00807
<a name="l00808"></a>00808 _dbus_return_val_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>);
<a name="l00809"></a>00809 _dbus_return_val_if_fail (slot >= 0, <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>);
<a name="l00810"></a>00810
<a name="l00811"></a>00811
<a name="l00812"></a>00812 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00813"></a>00813 retval = <a class="code" href="group__DBusPendingCallInternals.html#ga7d4196ca35b8df842c05a02dbb71c269" title="Stores a pointer on a DBusPendingCall, along with an optional function to be used for freeing the dat...">_dbus_pending_call_set_data_unlocked</a> (pending, slot, data, free_data_func);
<a name="l00814"></a>00814 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00815"></a>00815 <span class="keywordflow">return</span> retval;
<a name="l00816"></a>00816 }
<a name="l00817"></a>00817
<a name="l00826"></a>00826 <span class="keywordtype">void</span>*
<a name="l00827"></a><a class="code" href="group__DBusPendingCall.html#ga5749f73b7ec7a8fe4f2e6a839e292806">00827</a> <a class="code" href="group__DBusPendingCall.html#ga5749f73b7ec7a8fe4f2e6a839e292806" title="Retrieves data previously set with dbus_pending_call_set_data().">dbus_pending_call_get_data</a> (<a class="code" href="structDBusPendingCall.html" title="Implementation details of DBusPendingCall - all fields are private.">DBusPendingCall</a> *pending,
<a name="l00828"></a>00828 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> slot)
<a name="l00829"></a>00829 {
<a name="l00830"></a>00830 <span class="keywordtype">void</span> *res;
<a name="l00831"></a>00831
<a name="l00832"></a>00832 _dbus_return_val_if_fail (pending != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00833"></a>00833
<a name="l00834"></a>00834 <a class="code" href="group__DBusPendingCallInternals.html#ga99fcbae5b8f2ed2cc019cab85f63d4e4" title="Internals of DBusPendingCall.">CONNECTION_LOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00835"></a>00835 res = <a class="code" href="group__DBusDataSlot.html#ga43f741229f0c38788442601e2750ec66" title="Retrieves data previously set with _dbus_data_slot_list_set_data().">_dbus_data_slot_list_get</a> (&slot_allocator,
<a name="l00836"></a>00836 &pending-><a class="code" href="structDBusPendingCall.html#ad1b1c044ae4f9f94b05b4a5eb2f3917a" title="Data stored by allocated integer ID.">slot_list</a>,
<a name="l00837"></a>00837 slot);
<a name="l00838"></a>00838 <a class="code" href="group__DBusPendingCallInternals.html#gab21a3014fa3cacf2a580e079321abc33" title="shorter and more visible way to write _dbus_connection_unlock()">CONNECTION_UNLOCK</a> (pending-><a class="code" href="structDBusPendingCall.html#adaee5e70f04e503f25b8c4202fd4747f" title="Connections we're associated with.">connection</a>);
<a name="l00839"></a>00839
<a name="l00840"></a>00840 <span class="keywordflow">return</span> res;
<a name="l00841"></a>00841 }
<a name="l00842"></a>00842
</pre></div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:31 for D-Bus by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>