| Current File : //usr/share/doc/dbus/api/group__DBusTimeout.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: DBusTimeout</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><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">DBusTimeout</div> </div>
<div class="ingroups"><a class="el" href="group__DBus.html">D-Bus low-level public API</a></div></div><!--header-->
<div class="contents">
<p>Object representing a timeout.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6f0a4887747250a5fc9daeeb32b2d6af"></a><!-- doxytag: member="DBusTimeout::DBusTimeout" ref="ga6f0a4887747250a5fc9daeeb32b2d6af" args="" -->
typedef struct <a class="el" href="structDBusTimeout.html">DBusTimeout</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTimeout.html#ga6f0a4887747250a5fc9daeeb32b2d6af">DBusTimeout</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opaque object representing a timeout. <br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTimeout.html#ga67ba21b6189438875c6007ee79da5e37">dbus_timeout_get_interval</a> (<a class="el" href="structDBusTimeout.html">DBusTimeout</a> *timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the timeout interval. <a href="#ga67ba21b6189438875c6007ee79da5e37"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTimeout.html#ga7c561ec66daa2f53a274485f10c827c7">dbus_timeout_get_data</a> (<a class="el" href="structDBusTimeout.html">DBusTimeout</a> *timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets data previously set with <a class="el" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60" title="Sets data which can be retrieved with dbus_timeout_get_data().">dbus_timeout_set_data()</a> or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if none. <a href="#ga7c561ec66daa2f53a274485f10c827c7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60">dbus_timeout_set_data</a> (<a class="el" href="structDBusTimeout.html">DBusTimeout</a> *timeout, void *data, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> free_data_function)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets data which can be retrieved with <a class="el" 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 href="#ga88712006f7772174504a0fba0a0ddd60"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTimeout.html#ga038b67c8d3db2624a1e4a8bc45f25d12">dbus_timeout_handle</a> (<a class="el" href="structDBusTimeout.html">DBusTimeout</a> *timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Calls the timeout handler for this timeout. <a href="#ga038b67c8d3db2624a1e4a8bc45f25d12"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTimeout.html#ga58954b2edb45ec1632529d35525ea45c">dbus_timeout_get_enabled</a> (<a class="el" href="structDBusTimeout.html">DBusTimeout</a> *timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether a timeout is enabled or not. <a href="#ga58954b2edb45ec1632529d35525ea45c"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Object representing a timeout. </p>
<p>Types and functions related to <a class="el" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a>. A timeout represents a timeout that the main loop needs to monitor, as in Qt's QTimer or GLib's g_timeout_add().</p>
<p>Use <a class="el" href="group__DBusConnection.html#gab3cbc68eec427e9ce1783b25d44fe93c" title="Sets the timeout functions for the connection.">dbus_connection_set_timeout_functions()</a> or <a class="el" href="group__DBusServer.html#gacafa42ffc063a7386db40a975c32d530" title="Sets the timeout functions for the server.">dbus_server_set_timeout_functions()</a> to be notified when libdbus needs to add or remove timeouts. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga7c561ec66daa2f53a274485f10c827c7"></a><!-- doxytag: member="dbus-connection.h::dbus_timeout_get_data" ref="ga7c561ec66daa2f53a274485f10c827c7" args="(DBusTimeout *timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * <a class="el" href="group__DBusTimeout.html#ga7c561ec66daa2f53a274485f10c827c7">dbus_timeout_get_data</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusTimeout.html">DBusTimeout</a> * </td>
<td class="paramname"><em>timeout</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets data previously set with <a class="el" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60" title="Sets data which can be retrieved with dbus_timeout_get_data().">dbus_timeout_set_data()</a> or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if none. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timeout</td><td>the <a class="el" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>previously-set data. </dd></dl>
<p>Definition at line <a class="el" href="dbus-timeout_8c_source.html#l00429">429</a> of file <a class="el" href="dbus-timeout_8c_source.html">dbus-timeout.c</a>.</p>
<p>References <a class="el" href="dbus-timeout_8c_source.html#l00049">data</a>.</p>
</div>
</div>
<a class="anchor" id="ga58954b2edb45ec1632529d35525ea45c"></a><!-- doxytag: member="dbus-connection.h::dbus_timeout_get_enabled" ref="ga58954b2edb45ec1632529d35525ea45c" args="(DBusTimeout *timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusTimeout.html#ga58954b2edb45ec1632529d35525ea45c">dbus_timeout_get_enabled</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusTimeout.html">DBusTimeout</a> * </td>
<td class="paramname"><em>timeout</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns whether a timeout is enabled or not. </p>
<p>If not enabled, it should not be polled by the main loop.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timeout</td><td>the <a class="el" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> object </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a> if the timeout is enabled </dd></dl>
<p>Definition at line <a class="el" href="dbus-timeout_8c_source.html#l00486">486</a> of file <a class="el" href="dbus-timeout_8c_source.html">dbus-timeout.c</a>.</p>
<p>References <a class="el" href="dbus-timeout_8c_source.html#l00051">enabled</a>.</p>
</div>
</div>
<a class="anchor" id="ga67ba21b6189438875c6007ee79da5e37"></a><!-- doxytag: member="dbus-connection.h::dbus_timeout_get_interval" ref="ga67ba21b6189438875c6007ee79da5e37" args="(DBusTimeout *timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__DBusTimeout.html#ga67ba21b6189438875c6007ee79da5e37">dbus_timeout_get_interval</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusTimeout.html">DBusTimeout</a> * </td>
<td class="paramname"><em>timeout</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the timeout interval. </p>
<p>The <a class="el" href="group__DBusTimeout.html#ga038b67c8d3db2624a1e4a8bc45f25d12" title="Calls the timeout handler for this timeout.">dbus_timeout_handle()</a> should be called each time this interval elapses, starting after it elapses once.</p>
<p>The interval may change during the life of the timeout; if so, the timeout will be disabled and re-enabled (calling the "timeout toggled function") to notify you of the change.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timeout</td><td>the <a class="el" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the interval in milliseconds. </dd></dl>
<p>Definition at line <a class="el" href="dbus-timeout_8c_source.html#l00416">416</a> of file <a class="el" href="dbus-timeout_8c_source.html">dbus-timeout.c</a>.</p>
<p>References <a class="el" href="dbus-timeout_8c_source.html#l00043">interval</a>.</p>
<p>Referenced by <a class="el" href="dbus-connection_8c_source.html#l02379">_dbus_connection_block_pending_call()</a>.</p>
</div>
</div>
<a class="anchor" id="ga038b67c8d3db2624a1e4a8bc45f25d12"></a><!-- doxytag: member="dbus-connection.h::dbus_timeout_handle" ref="ga038b67c8d3db2624a1e4a8bc45f25d12" args="(DBusTimeout *timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusTimeout.html#ga038b67c8d3db2624a1e4a8bc45f25d12">dbus_timeout_handle</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusTimeout.html">DBusTimeout</a> * </td>
<td class="paramname"><em>timeout</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Calls the timeout handler for this timeout. </p>
<p>This function should be called when the timeout occurs.</p>
<p>If this function returns <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>, then there wasn't enough memory to handle the timeout. Typically just letting the timeout fire again next time it naturally times out is an adequate response to that problem, but you could try to do more if you wanted.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timeout</td><td>the <a class="el" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a> if there wasn't enough memory </dd></dl>
<p>Definition at line <a class="el" href="dbus-timeout_8c_source.html#l00472">472</a> of file <a class="el" href="dbus-timeout_8c_source.html">dbus-timeout.c</a>.</p>
<p>References <a class="el" href="dbus-timeout_8c_source.html#l00045">handler</a>, and <a class="el" href="dbus-timeout_8c_source.html#l00046">handler_data</a>.</p>
</div>
</div>
<a class="anchor" id="ga88712006f7772174504a0fba0a0ddd60"></a><!-- doxytag: member="dbus-connection.h::dbus_timeout_set_data" ref="ga88712006f7772174504a0fba0a0ddd60" args="(DBusTimeout *timeout, void *data, DBusFreeFunction free_data_function)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__DBusTimeout.html#ga88712006f7772174504a0fba0a0ddd60">dbus_timeout_set_data</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusTimeout.html">DBusTimeout</a> * </td>
<td class="paramname"><em>timeout</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> </td>
<td class="paramname"><em>free_data_function</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets data which can be retrieved with <a class="el" href="group__DBusTimeout.html#ga7c561ec66daa2f53a274485f10c827c7" title="Gets data previously set with dbus_timeout_set_data() or NULL if none.">dbus_timeout_get_data()</a>. </p>
<p>Intended for use by the DBusAddTimeoutFunction and DBusRemoveTimeoutFunction to store their own data. For example with Qt you might store the QTimer for this timeout and with GLib you might store a g_timeout_add result id.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timeout</td><td>the <a class="el" href="structDBusTimeout.html" title="Internals of DBusTimeout.">DBusTimeout</a> object. </td></tr>
<tr><td class="paramname">data</td><td>the data. </td></tr>
<tr><td class="paramname">free_data_function</td><td>function to be called to free the data. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-timeout_8c_source.html#l00446">446</a> of file <a class="el" href="dbus-timeout_8c_source.html">dbus-timeout.c</a>.</p>
<p>References <a class="el" href="dbus-timeout_8c_source.html#l00049">data</a>, <a class="el" href="dbus-timeout_8c_source.html#l00050">free_data_function</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-timeout_8c_source.html#l00107">_dbus_timeout_unref()</a>.</p>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:34 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>