Current File : //usr/share/doc/dbus/api/dbus-timeout_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-timeout.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
   &#160;<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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;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&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">dbus-timeout.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: &quot;gnu&quot;; indent-tabs-mode: nil; -*- */</span>
<a name="l00002"></a>00002 <span class="comment">/* dbus-timeout.c DBusTimeout implementation</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2003  CodeFactory AB</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 &lt;config.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;dbus-internals.h&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;dbus-timeout.h&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;dbus-list.h&quot;</span>
<a name="l00028"></a>00028 
<a name="l00040"></a><a class="code" href="structDBusTimeout.html">00040</a> <span class="keyword">struct </span><a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>
<a name="l00041"></a>00041 {
<a name="l00042"></a><a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e">00042</a>   <span class="keywordtype">int</span> <a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e" title="Reference count.">refcount</a>;                                
<a name="l00043"></a><a class="code" href="structDBusTimeout.html#a8772f07a4695be987e7d0fea1b80ba16">00043</a>   <span class="keywordtype">int</span> <a class="code" href="structDBusTimeout.html#a8772f07a4695be987e7d0fea1b80ba16" title="Timeout interval in milliseconds.">interval</a>;                                
<a name="l00045"></a><a class="code" href="structDBusTimeout.html#a362a61722d3fae5c18c93654a57aa377">00045</a>   <a class="code" href="group__DBusTimeoutInternals.html#ga1533b9aa7bfe55ccb798ab041e4ce242" title="function to run when the timeout is handled">DBusTimeoutHandler</a> <a class="code" href="structDBusTimeout.html#a362a61722d3fae5c18c93654a57aa377" title="Timeout handler.">handler</a>;                  
<a name="l00046"></a><a class="code" href="structDBusTimeout.html#a58a22bfb2f7f0543745c2d56fa9f63a1">00046</a>   <span class="keywordtype">void</span> *<a class="code" href="structDBusTimeout.html#a58a22bfb2f7f0543745c2d56fa9f63a1" title="Timeout handler data.">handler_data</a>;                          
<a name="l00047"></a><a class="code" href="structDBusTimeout.html#aadd5adfcf8896e0529df439548f351cc">00047</a>   <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> <a class="code" href="structDBusTimeout.html#aadd5adfcf8896e0529df439548f351cc" title="Free the timeout handler data.">free_handler_data_function</a>; 
<a name="l00049"></a><a class="code" href="structDBusTimeout.html#a16cb374453e70f3951d02bcba73c1845">00049</a>   <span class="keywordtype">void</span> *<a class="code" href="structDBusTimeout.html#a16cb374453e70f3951d02bcba73c1845" title="Application data.">data</a>;                                  
<a name="l00050"></a><a class="code" href="structDBusTimeout.html#af7ff88e58a10f4ed49a0838e0c930be0">00050</a>   <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> <a class="code" href="structDBusTimeout.html#af7ff88e58a10f4ed49a0838e0c930be0" title="Free the application data.">free_data_function</a>;         
<a name="l00051"></a><a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503">00051</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503" title="True if timeout is active.">enabled</a> : 1;                    
<a name="l00052"></a>00052 };
<a name="l00053"></a>00053 
<a name="l00062"></a>00062 <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>*
<a name="l00063"></a><a class="code" href="group__DBusTimeoutInternals.html#ga3f63abde6bb7ebecf6fa8774ba501a26">00063</a> <a class="code" href="group__DBusTimeoutInternals.html#ga3f63abde6bb7ebecf6fa8774ba501a26" title="Creates a new DBusTimeout, enabled by default.">_dbus_timeout_new</a> (<span class="keywordtype">int</span>                 interval,
<a name="l00064"></a>00064                    <a class="code" href="group__DBusTimeoutInternals.html#ga1533b9aa7bfe55ccb798ab041e4ce242" title="function to run when the timeout is handled">DBusTimeoutHandler</a>  handler,
<a name="l00065"></a>00065                    <span class="keywordtype">void</span>               *data,
<a name="l00066"></a>00066                    <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a>    free_data_function)
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068   <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070   timeout = <a class="code" href="group__DBusMemory.html#gaba9d823abda7f4cadbaf5177d3b8b793" title="Safe macro for using dbus_malloc0().">dbus_new0</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>, 1);
<a name="l00071"></a>00071   <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="l00072"></a>00072     <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="l00073"></a>00073   
<a name="l00074"></a>00074   timeout-&gt;<a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e" title="Reference count.">refcount</a> = 1;
<a name="l00075"></a>00075   timeout-&gt;<a class="code" href="structDBusTimeout.html#a8772f07a4695be987e7d0fea1b80ba16" title="Timeout interval in milliseconds.">interval</a> = interval;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077   timeout-&gt;<a class="code" href="structDBusTimeout.html#a362a61722d3fae5c18c93654a57aa377" title="Timeout handler.">handler</a> = handler;
<a name="l00078"></a>00078   timeout-&gt;<a class="code" href="structDBusTimeout.html#a58a22bfb2f7f0543745c2d56fa9f63a1" title="Timeout handler data.">handler_data</a> = data;
<a name="l00079"></a>00079   timeout-&gt;<a class="code" href="structDBusTimeout.html#aadd5adfcf8896e0529df439548f351cc" title="Free the timeout handler data.">free_handler_data_function</a> = free_data_function;
<a name="l00080"></a>00080 
<a name="l00081"></a>00081   timeout-&gt;<a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503" title="True if timeout is active.">enabled</a> = <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00082"></a>00082   
<a name="l00083"></a>00083   <span class="keywordflow">return</span> timeout;
<a name="l00084"></a>00084 }
<a name="l00085"></a>00085 
<a name="l00092"></a>00092 <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *
<a name="l00093"></a><a class="code" href="group__DBusTimeoutInternals.html#gadf014caa89efb09ae72c300ae5c4fda5">00093</a> <a class="code" href="group__DBusTimeoutInternals.html#gadf014caa89efb09ae72c300ae5c4fda5" title="Increments the reference count of a DBusTimeout object.">_dbus_timeout_ref</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout)
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095   timeout-&gt;<a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e" title="Reference count.">refcount</a> += 1;
<a name="l00096"></a>00096 
<a name="l00097"></a>00097   <span class="keywordflow">return</span> timeout;
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099 
<a name="l00106"></a>00106 <span class="keywordtype">void</span>
<a name="l00107"></a><a class="code" href="group__DBusTimeoutInternals.html#gaea6359793576a2eec42e27267bae7bbd">00107</a> <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> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout)
<a name="l00108"></a>00108 {
<a name="l00109"></a>00109   _dbus_assert (timeout != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00110"></a>00110   _dbus_assert (timeout-&gt;<a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e" title="Reference count.">refcount</a> &gt; 0);
<a name="l00111"></a>00111   
<a name="l00112"></a>00112   timeout-&gt;<a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e" title="Reference count.">refcount</a> -= 1;
<a name="l00113"></a>00113   <span class="keywordflow">if</span> (timeout-&gt;<a class="code" href="structDBusTimeout.html#a1b2b2eadd3e162b213384cbd6d1e941e" title="Reference count.">refcount</a> == 0)
<a name="l00114"></a>00114     {
<a name="l00115"></a>00115       <a class="code" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60" title="Sets data which can be retrieved with dbus_timeout_get_data().">dbus_timeout_set_data</a> (timeout, <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>); <span class="comment">/* call free_data_function */</span>
<a name="l00116"></a>00116 
<a name="l00117"></a>00117       <span class="keywordflow">if</span> (timeout-&gt;<a class="code" href="structDBusTimeout.html#aadd5adfcf8896e0529df439548f351cc" title="Free the timeout handler data.">free_handler_data_function</a>)
<a name="l00118"></a>00118         (* timeout-&gt;<a class="code" href="structDBusTimeout.html#aadd5adfcf8896e0529df439548f351cc" title="Free the timeout handler data.">free_handler_data_function</a>) (timeout-&gt;<a class="code" href="structDBusTimeout.html#a58a22bfb2f7f0543745c2d56fa9f63a1" title="Timeout handler data.">handler_data</a>);
<a name="l00119"></a>00119       
<a name="l00120"></a>00120       <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> (timeout);
<a name="l00121"></a>00121     }
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 
<a name="l00133"></a>00133 <span class="keywordtype">void</span>
<a name="l00134"></a><a class="code" href="group__DBusTimeoutInternals.html#gadbd32136416a555ad737b533c8e713ef">00134</a> <a class="code" href="group__DBusTimeoutInternals.html#gadbd32136416a555ad737b533c8e713ef" title="Changes the timeout interval.">_dbus_timeout_set_interval</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout,
<a name="l00135"></a>00135                             <span class="keywordtype">int</span>          interval)
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137   _dbus_assert (interval &gt;= 0);
<a name="l00138"></a>00138   
<a name="l00139"></a>00139   timeout-&gt;<a class="code" href="structDBusTimeout.html#a8772f07a4695be987e7d0fea1b80ba16" title="Timeout interval in milliseconds.">interval</a> = interval;
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141 
<a name="l00152"></a>00152 <span class="keywordtype">void</span>
<a name="l00153"></a><a class="code" href="group__DBusTimeoutInternals.html#ga1b85d28ab11e4e2f8916b786e13dbcc4">00153</a> <a class="code" href="group__DBusTimeoutInternals.html#ga1b85d28ab11e4e2f8916b786e13dbcc4" title="Changes the timeout&#39;s enabled-ness.">_dbus_timeout_set_enabled</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>  *timeout,
<a name="l00154"></a>00154                            <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   enabled)
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156   timeout-&gt;<a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503" title="True if timeout is active.">enabled</a> = enabled != <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 
<a name="l00159"></a>00159 
<a name="l00176"></a><a class="code" href="structDBusTimeoutList.html">00176</a> <span class="keyword">struct </span><a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a>
<a name="l00177"></a>00177 {
<a name="l00178"></a><a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80">00178</a>   <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>; 
<a name="l00180"></a><a class="code" href="structDBusTimeoutList.html#aab57481c712e47f9157d23bc6731972e">00180</a>   <a class="code" href="group__DBusConnection.html#ga01a45587090d82ee97b5042b49037a08" title="Called when libdbus needs a new timeout to be monitored by the main loop.">DBusAddTimeoutFunction</a> <a class="code" href="structDBusTimeoutList.html#aab57481c712e47f9157d23bc6731972e" title="Callback for adding a timeout.">add_timeout_function</a>;       
<a name="l00181"></a><a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55">00181</a>   <a class="code" href="group__DBusConnection.html#ga13aae9d5981de45abca0db1717dc7daf" title="Called when libdbus no longer needs a timeout to be monitored by the main loop.">DBusRemoveTimeoutFunction</a> <a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55" title="Callback for removing a timeout.">remove_timeout_function</a>; 
<a name="l00182"></a><a class="code" href="structDBusTimeoutList.html#a198efba668450ebafa97e9d5197fcc2e">00182</a>   <a class="code" href="group__DBusConnection.html#ga62eea9a2032ae15b6738534b93d18e86" title="Called when dbus_timeout_get_enabled() may return a different value than it did before.">DBusTimeoutToggledFunction</a> <a class="code" href="structDBusTimeoutList.html#a198efba668450ebafa97e9d5197fcc2e" title="Callback when timeout is enabled/disabled or changes interval.">timeout_toggled_function</a>; 
<a name="l00183"></a><a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb">00183</a>   <span class="keywordtype">void</span> *<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a>;                                
<a name="l00184"></a><a class="code" href="structDBusTimeoutList.html#ac93efcdc11b6e68d19f1e57e0bff72f7">00184</a>   <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a> <a class="code" href="structDBusTimeoutList.html#ac93efcdc11b6e68d19f1e57e0bff72f7" title="Free function for timeout callback data.">timeout_free_data_function</a>;       
<a name="l00185"></a>00185 };
<a name="l00186"></a>00186 
<a name="l00193"></a>00193 <a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a>*
<a name="l00194"></a><a class="code" href="group__DBusTimeoutInternals.html#ga5b122b35cdb3926b7dc2d084ddff9d62">00194</a> <a class="code" href="group__DBusTimeoutInternals.html#ga5b122b35cdb3926b7dc2d084ddff9d62" title="Creates a new timeout list.">_dbus_timeout_list_new</a> (<span class="keywordtype">void</span>)
<a name="l00195"></a>00195 {
<a name="l00196"></a>00196   <a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a> *timeout_list;
<a name="l00197"></a>00197 
<a name="l00198"></a>00198   timeout_list = <a class="code" href="group__DBusMemory.html#gaba9d823abda7f4cadbaf5177d3b8b793" title="Safe macro for using dbus_malloc0().">dbus_new0</a> (<a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a>, 1);
<a name="l00199"></a>00199   <span class="keywordflow">if</span> (timeout_list == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00200"></a>00200     <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="l00201"></a>00201 
<a name="l00202"></a>00202   <span class="keywordflow">return</span> timeout_list;
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 
<a name="l00210"></a>00210 <span class="keywordtype">void</span>
<a name="l00211"></a><a class="code" href="group__DBusTimeoutInternals.html#ga1b399ef2d7f128e59bb32dbb5b590e1b">00211</a> <a class="code" href="group__DBusTimeoutInternals.html#ga1b399ef2d7f128e59bb32dbb5b590e1b" title="Frees a DBusTimeoutList.">_dbus_timeout_list_free</a> (<a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a> *timeout_list)
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213   <span class="comment">/* free timeout_data and remove timeouts as a side effect */</span>
<a name="l00214"></a>00214   <a class="code" href="group__DBusTimeoutInternals.html#ga6760d1963b870b45f855501e38b49fd9" title="Sets the timeout functions.">_dbus_timeout_list_set_functions</a> (timeout_list,
<a name="l00215"></a>00215                                     <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 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 class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00216"></a>00216 
<a name="l00217"></a>00217   <a class="code" href="group__DBusList.html#ga8dd69084b53361803a765e6d53d5b9d1" title="Calls the given function for each element in the list.">_dbus_list_foreach</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>,
<a name="l00218"></a>00218                       (DBusForeachFunction) <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>,
<a name="l00219"></a>00219                       <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00220"></a>00220   <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> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>);
<a name="l00221"></a>00221 
<a name="l00222"></a>00222   <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> (timeout_list);
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224 
<a name="l00238"></a>00238 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00239"></a><a class="code" href="group__DBusTimeoutInternals.html#ga6760d1963b870b45f855501e38b49fd9">00239</a> <a class="code" href="group__DBusTimeoutInternals.html#ga6760d1963b870b45f855501e38b49fd9" title="Sets the timeout functions.">_dbus_timeout_list_set_functions</a> (<a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a>           *timeout_list,
<a name="l00240"></a>00240                                   <a class="code" href="group__DBusConnection.html#ga01a45587090d82ee97b5042b49037a08" title="Called when libdbus needs a new timeout to be monitored by the main loop.">DBusAddTimeoutFunction</a>     add_function,
<a name="l00241"></a>00241                                   <a class="code" href="group__DBusConnection.html#ga13aae9d5981de45abca0db1717dc7daf" title="Called when libdbus no longer needs a timeout to be monitored by the main loop.">DBusRemoveTimeoutFunction</a>  remove_function,
<a name="l00242"></a>00242                                   <a class="code" href="group__DBusConnection.html#ga62eea9a2032ae15b6738534b93d18e86" title="Called when dbus_timeout_get_enabled() may return a different value than it did before.">DBusTimeoutToggledFunction</a> toggled_function,
<a name="l00243"></a>00243                                   <span class="keywordtype">void</span>                      *data,
<a name="l00244"></a>00244                                   <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a>           free_data_function)
<a name="l00245"></a>00245 {
<a name="l00246"></a>00246   <span class="comment">/* Add timeouts with the new function, failing on OOM */</span>
<a name="l00247"></a>00247   <span class="keywordflow">if</span> (add_function != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00248"></a>00248     {
<a name="l00249"></a>00249       <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *link;
<a name="l00250"></a>00250       
<a name="l00251"></a>00251       link = <a class="code" href="group__DBusList.html#ga1e26ce4fb4acb50593bd5ed2f4eeb3ae" title="Gets the first link in the list.">_dbus_list_get_first_link</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>);
<a name="l00252"></a>00252       <span class="keywordflow">while</span> (link != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00253"></a>00253         {
<a name="l00254"></a>00254           <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *next = <a class="code" href="group__DBusList.html#gaede4ace46d5ee497d75074bfec4490a2" title="Gets the next link in the list, or NULL if there are no more links.">_dbus_list_get_next_link</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>,
<a name="l00255"></a>00255                                                      link);
<a name="l00256"></a>00256       
<a name="l00257"></a>00257           <span class="keywordflow">if</span> (!(* add_function) (link-&gt;<a class="code" href="structDBusList.html#a29ab457bcf9092252bb0c4282c727055" title="Data stored at this element.">data</a>, data))
<a name="l00258"></a>00258             {
<a name="l00259"></a>00259               <span class="comment">/* remove it all again and return FALSE */</span>
<a name="l00260"></a>00260               <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *link2;
<a name="l00261"></a>00261               
<a name="l00262"></a>00262               link2 = <a class="code" href="group__DBusList.html#ga1e26ce4fb4acb50593bd5ed2f4eeb3ae" title="Gets the first link in the list.">_dbus_list_get_first_link</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>);
<a name="l00263"></a>00263               <span class="keywordflow">while</span> (link2 != link)
<a name="l00264"></a>00264                 {
<a name="l00265"></a>00265                   <a class="code" href="structDBusList.html" title="A node in a linked list.">DBusList</a> *next = <a class="code" href="group__DBusList.html#gaede4ace46d5ee497d75074bfec4490a2" title="Gets the next link in the list, or NULL if there are no more links.">_dbus_list_get_next_link</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>,
<a name="l00266"></a>00266                                                              link2);
<a name="l00267"></a>00267 
<a name="l00268"></a>00268                   (* remove_function) (link2-&gt;<a class="code" href="structDBusList.html#a29ab457bcf9092252bb0c4282c727055" title="Data stored at this element.">data</a>, data);
<a name="l00269"></a>00269                   
<a name="l00270"></a>00270                   link2 = next;
<a name="l00271"></a>00271                 }
<a name="l00272"></a>00272 
<a name="l00273"></a>00273               <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00274"></a>00274             }
<a name="l00275"></a>00275       
<a name="l00276"></a>00276           link = next;
<a name="l00277"></a>00277         }
<a name="l00278"></a>00278     }
<a name="l00279"></a>00279   
<a name="l00280"></a>00280   <span class="comment">/* Remove all current timeouts from previous timeout handlers */</span>
<a name="l00281"></a>00281 
<a name="l00282"></a>00282   <span class="keywordflow">if</span> (timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55" title="Callback for removing a timeout.">remove_timeout_function</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00283"></a>00283     {
<a name="l00284"></a>00284       <a class="code" href="group__DBusList.html#ga8dd69084b53361803a765e6d53d5b9d1" title="Calls the given function for each element in the list.">_dbus_list_foreach</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>,
<a name="l00285"></a>00285                           (DBusForeachFunction) timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55" title="Callback for removing a timeout.">remove_timeout_function</a>,
<a name="l00286"></a>00286                           timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a>);
<a name="l00287"></a>00287     }
<a name="l00288"></a>00288 
<a name="l00289"></a>00289   <span class="keywordflow">if</span> (timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#ac93efcdc11b6e68d19f1e57e0bff72f7" title="Free function for timeout callback data.">timeout_free_data_function</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00290"></a>00290     (* timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#ac93efcdc11b6e68d19f1e57e0bff72f7" title="Free function for timeout callback data.">timeout_free_data_function</a>) (timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a>);
<a name="l00291"></a>00291 
<a name="l00292"></a>00292   timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#aab57481c712e47f9157d23bc6731972e" title="Callback for adding a timeout.">add_timeout_function</a> = add_function;
<a name="l00293"></a>00293   timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55" title="Callback for removing a timeout.">remove_timeout_function</a> = remove_function;
<a name="l00294"></a>00294   timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a198efba668450ebafa97e9d5197fcc2e" title="Callback when timeout is enabled/disabled or changes interval.">timeout_toggled_function</a> = toggled_function;
<a name="l00295"></a>00295   timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a> = data;
<a name="l00296"></a>00296   timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#ac93efcdc11b6e68d19f1e57e0bff72f7" title="Free function for timeout callback data.">timeout_free_data_function</a> = free_data_function;
<a name="l00297"></a>00297 
<a name="l00298"></a>00298   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00299"></a>00299 }
<a name="l00300"></a>00300 
<a name="l00309"></a>00309 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00310"></a><a class="code" href="group__DBusTimeoutInternals.html#ga14955f061551ece122808b9e6ddc0757">00310</a> <a class="code" href="group__DBusTimeoutInternals.html#ga14955f061551ece122808b9e6ddc0757" title="Adds a new timeout to the timeout list, invoking the application DBusAddTimeoutFunction if appropriat...">_dbus_timeout_list_add_timeout</a> (<a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a> *timeout_list,
<a name="l00311"></a>00311                                 <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>     *timeout)
<a name="l00312"></a>00312 {
<a name="l00313"></a>00313   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusList.html#gad99045e79db46159babe69718f343053" title="Appends a value to the list.">_dbus_list_append</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>, timeout))
<a name="l00314"></a>00314     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00315"></a>00315 
<a name="l00316"></a>00316   <a class="code" href="group__DBusTimeoutInternals.html#gadf014caa89efb09ae72c300ae5c4fda5" title="Increments the reference count of a DBusTimeout object.">_dbus_timeout_ref</a> (timeout);
<a name="l00317"></a>00317 
<a name="l00318"></a>00318   <span class="keywordflow">if</span> (timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#aab57481c712e47f9157d23bc6731972e" title="Callback for adding a timeout.">add_timeout_function</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00319"></a>00319     {
<a name="l00320"></a>00320       <span class="keywordflow">if</span> (!(* timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#aab57481c712e47f9157d23bc6731972e" title="Callback for adding a timeout.">add_timeout_function</a>) (timeout,
<a name="l00321"></a>00321                                                    timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a>))
<a name="l00322"></a>00322         {
<a name="l00323"></a>00323           <a class="code" href="group__DBusList.html#gad93f1fc853914144e94fc7a7dc0945aa" title="Removes a value from the list.">_dbus_list_remove_last</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>, timeout);
<a name="l00324"></a>00324           <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> (timeout);
<a name="l00325"></a>00325           <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00326"></a>00326         }
<a name="l00327"></a>00327     }
<a name="l00328"></a>00328 
<a name="l00329"></a>00329   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00330"></a>00330 }
<a name="l00331"></a>00331 
<a name="l00339"></a>00339 <span class="keywordtype">void</span>
<a name="l00340"></a><a class="code" href="group__DBusTimeoutInternals.html#gaec0ffafdcac87f23878a2ddded044822">00340</a> <a class="code" href="group__DBusTimeoutInternals.html#gaec0ffafdcac87f23878a2ddded044822" title="Removes a timeout from the timeout list, invoking the application&#39;s DBusRemoveTimeoutFunction if appr...">_dbus_timeout_list_remove_timeout</a> (<a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a> *timeout_list,
<a name="l00341"></a>00341                                    <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>     *timeout)
<a name="l00342"></a>00342 {
<a name="l00343"></a>00343   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusList.html#ga202e6ac8ad3e4a9d4413e0248ffcf3e3" title="Removes a value from the list.">_dbus_list_remove</a> (&amp;timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a56d9070375880b7d931f887564981f80" title="Timeout objects.">timeouts</a>, timeout))
<a name="l00344"></a>00344     _dbus_assert_not_reached (<span class="stringliteral">&quot;Nonexistent timeout was removed&quot;</span>);
<a name="l00345"></a>00345 
<a name="l00346"></a>00346   <span class="keywordflow">if</span> (timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55" title="Callback for removing a timeout.">remove_timeout_function</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00347"></a>00347     (* timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a51d25b272b950c3f63b3b71926940a55" title="Callback for removing a timeout.">remove_timeout_function</a>) (timeout,
<a name="l00348"></a>00348                                                timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a>);
<a name="l00349"></a>00349 
<a name="l00350"></a>00350   <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> (timeout);
<a name="l00351"></a>00351 }
<a name="l00352"></a>00352 
<a name="l00361"></a>00361 <span class="keywordtype">void</span>
<a name="l00362"></a><a class="code" href="group__DBusTimeoutInternals.html#ga3d1ee0968a47651c5428ebf48711b217">00362</a> <a class="code" href="group__DBusTimeoutInternals.html#ga3d1ee0968a47651c5428ebf48711b217" title="Sets a timeout to the given enabled state, invoking the application&#39;s DBusTimeoutToggledFunction if a...">_dbus_timeout_list_toggle_timeout</a> (<a class="code" href="structDBusTimeoutList.html" title="DBusTimeoutList implementation details.">DBusTimeoutList</a>           *timeout_list,
<a name="l00363"></a>00363                                    <a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>               *timeout,
<a name="l00364"></a>00364                                    <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>                enabled)
<a name="l00365"></a>00365 {
<a name="l00366"></a>00366   enabled = !!enabled;
<a name="l00367"></a>00367   
<a name="l00368"></a>00368   <span class="keywordflow">if</span> (enabled == timeout-&gt;<a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503" title="True if timeout is active.">enabled</a>)
<a name="l00369"></a>00369     <span class="keywordflow">return</span>;
<a name="l00370"></a>00370 
<a name="l00371"></a>00371   timeout-&gt;<a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503" title="True if timeout is active.">enabled</a> = enabled;
<a name="l00372"></a>00372   
<a name="l00373"></a>00373   <span class="keywordflow">if</span> (timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a198efba668450ebafa97e9d5197fcc2e" title="Callback when timeout is enabled/disabled or changes interval.">timeout_toggled_function</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00374"></a>00374     (* timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#a198efba668450ebafa97e9d5197fcc2e" title="Callback when timeout is enabled/disabled or changes interval.">timeout_toggled_function</a>) (timeout,
<a name="l00375"></a>00375                                                 timeout_list-&gt;<a class="code" href="structDBusTimeoutList.html#af26804f9320628b977e7afeeea3750eb" title="Data for timeout callbacks.">timeout_data</a>);
<a name="l00376"></a>00376 }
<a name="l00377"></a>00377 
<a name="l00415"></a>00415 <span class="keywordtype">int</span>
<a name="l00416"></a><a class="code" href="group__DBusTimeout.html#ga67ba21b6189438875c6007ee79da5e37">00416</a> <a class="code" href="group__DBusTimeout.html#ga67ba21b6189438875c6007ee79da5e37" title="Gets the timeout interval.">dbus_timeout_get_interval</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout)
<a name="l00417"></a>00417 {
<a name="l00418"></a>00418   <span class="keywordflow">return</span> timeout-&gt;<a class="code" href="structDBusTimeout.html#a8772f07a4695be987e7d0fea1b80ba16" title="Timeout interval in milliseconds.">interval</a>;
<a name="l00419"></a>00419 }
<a name="l00420"></a>00420 
<a name="l00428"></a>00428 <span class="keywordtype">void</span>*
<a name="l00429"></a><a class="code" href="group__DBusTimeout.html#ga7c561ec66daa2f53a274485f10c827c7">00429</a> <a class="code" href="group__DBusTimeout.html#ga7c561ec66daa2f53a274485f10c827c7" title="Gets data previously set with dbus_timeout_set_data() or NULL if none.">dbus_timeout_get_data</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout)
<a name="l00430"></a>00430 {
<a name="l00431"></a>00431   <span class="keywordflow">return</span> timeout-&gt;<a class="code" href="structDBusTimeout.html#a16cb374453e70f3951d02bcba73c1845" title="Application data.">data</a>;
<a name="l00432"></a>00432 }
<a name="l00433"></a>00433 
<a name="l00445"></a>00445 <span class="keywordtype">void</span>
<a name="l00446"></a><a class="code" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60">00446</a> <a class="code" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60" title="Sets data which can be retrieved with dbus_timeout_get_data().">dbus_timeout_set_data</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>      *timeout,
<a name="l00447"></a>00447                        <span class="keywordtype">void</span>             *data,
<a name="l00448"></a>00448                        <a class="code" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5" title="The type of a function which frees a block of memory.">DBusFreeFunction</a>  free_data_function)
<a name="l00449"></a>00449 {
<a name="l00450"></a>00450   <span class="keywordflow">if</span> (timeout-&gt;<a class="code" href="structDBusTimeout.html#af7ff88e58a10f4ed49a0838e0c930be0" title="Free the application data.">free_data_function</a> != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00451"></a>00451     (* timeout-&gt;<a class="code" href="structDBusTimeout.html#af7ff88e58a10f4ed49a0838e0c930be0" title="Free the application data.">free_data_function</a>) (timeout-&gt;<a class="code" href="structDBusTimeout.html#a16cb374453e70f3951d02bcba73c1845" title="Application data.">data</a>);
<a name="l00452"></a>00452 
<a name="l00453"></a>00453   timeout-&gt;<a class="code" href="structDBusTimeout.html#a16cb374453e70f3951d02bcba73c1845" title="Application data.">data</a> = data;
<a name="l00454"></a>00454   timeout-&gt;<a class="code" href="structDBusTimeout.html#af7ff88e58a10f4ed49a0838e0c930be0" title="Free the application data.">free_data_function</a> = free_data_function;
<a name="l00455"></a>00455 }
<a name="l00456"></a>00456 
<a name="l00471"></a>00471 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00472"></a><a class="code" href="group__DBusTimeout.html#ga038b67c8d3db2624a1e4a8bc45f25d12">00472</a> <a class="code" href="group__DBusTimeout.html#ga038b67c8d3db2624a1e4a8bc45f25d12" title="Calls the timeout handler for this timeout.">dbus_timeout_handle</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout)
<a name="l00473"></a>00473 {
<a name="l00474"></a>00474   <span class="keywordflow">return</span> (* timeout-&gt;<a class="code" href="structDBusTimeout.html#a362a61722d3fae5c18c93654a57aa377" title="Timeout handler.">handler</a>) (timeout-&gt;<a class="code" href="structDBusTimeout.html#a58a22bfb2f7f0543745c2d56fa9f63a1" title="Timeout handler data.">handler_data</a>);
<a name="l00475"></a>00475 }
<a name="l00476"></a>00476 
<a name="l00477"></a>00477 
<a name="l00485"></a>00485 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00486"></a><a class="code" href="group__DBusTimeout.html#ga58954b2edb45ec1632529d35525ea45c">00486</a> <a class="code" href="group__DBusTimeout.html#ga58954b2edb45ec1632529d35525ea45c" title="Returns whether a timeout is enabled or not.">dbus_timeout_get_enabled</a> (<a class="code" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> *timeout)
<a name="l00487"></a>00487 {
<a name="l00488"></a>00488   <span class="keywordflow">return</span> timeout-&gt;<a class="code" href="structDBusTimeout.html#a35ac546656105d0fe1929d4e3d224503" title="True if timeout is active.">enabled</a>;
<a name="l00489"></a>00489 }
<a name="l00490"></a>00490 
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:32 for D-Bus by &#160;<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>