| Current File : //usr/share/doc/dbus/api/group__DBusWatch.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: DBusWatch</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">DBusWatch</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 file descriptor to be watched.
<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="gaa5aa1734b328af3a18116d4a8a157721"></a><!-- doxytag: member="DBusWatch::DBusWatch" ref="gaa5aa1734b328af3a18116d4a8a157721" args="" -->
typedef struct <a class="el" href="structDBusWatch.html">DBusWatch</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusWatch.html#gaa5aa1734b328af3a18116d4a8a157721">DBusWatch</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opaque object representing a file descriptor to be watched for changes in readability, writability, or hangup. <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 <a class="el" href="group__DBusMacros.html#ga7b014fa99f6ef38c1aa5a9c02468e3a0">DBUS_DEPRECATED</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusWatch.html#ga62d7e86fe386ed48fb90d443b3a2ce7a">dbus_watch_get_fd</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated former name of <a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d" title="Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descripto...">dbus_watch_get_unix_fd()</a>. <a href="#ga62d7e86fe386ed48fb90d443b3a2ce7a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d">dbus_watch_get_unix_fd</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descriptor. <a href="#ga15df7f6120ead3e09bec8a70d3c43c0d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusWatch.html#ga91308f393d41b31babda17c83833517f">dbus_watch_get_socket</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a socket to be watched, on UNIX this will return -1 if our transport is not socket-based so <a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d" title="Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descripto...">dbus_watch_get_unix_fd()</a> is preferred. <a href="#ga91308f393d41b31babda17c83833517f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBUS_EXPORT unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusWatch.html#gaf172a2b1d1f82333e67cec8d99c9204a">dbus_watch_get_flags</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets flags from DBusWatchFlags indicating what conditions should be monitored on the file descriptor. <a href="#gaf172a2b1d1f82333e67cec8d99c9204a"></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__DBusWatch.html#ga8dcdbd07f15a56207af4a36cb005da77">dbus_watch_get_data</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets data previously set with <a class="el" href="group__DBusWatch.html#ga5c75a65cf0680956cc0188d86a05cfae" title="Sets data which can be retrieved with dbus_watch_get_data().">dbus_watch_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="#ga8dcdbd07f15a56207af4a36cb005da77"></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__DBusWatch.html#ga5c75a65cf0680956cc0188d86a05cfae">dbus_watch_set_data</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch, 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__DBusWatch.html#ga8dcdbd07f15a56207af4a36cb005da77" title="Gets data previously set with dbus_watch_set_data() or NULL if none.">dbus_watch_get_data()</a>. <a href="#ga5c75a65cf0680956cc0188d86a05cfae"></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__DBusWatch.html#gac2acdb1794450ac01a43ec4c3e07ebf7">dbus_watch_handle</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch, unsigned int flags)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Called to notify the D-Bus library when a previously-added watch is ready for reading or writing, or has an exception such as a hangup. <a href="#gac2acdb1794450ac01a43ec4c3e07ebf7"></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__DBusWatch.html#gae7a91e6d4d1bc187419c47c522e33a8f">dbus_watch_get_enabled</a> (<a class="el" href="structDBusWatch.html">DBusWatch</a> *watch)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether a watch is enabled or not. <a href="#gae7a91e6d4d1bc187419c47c522e33a8f"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Object representing a file descriptor to be watched. </p>
<p>Types and functions related to <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a>. A watch represents a file descriptor that the main loop needs to monitor, as in Qt's QSocketNotifier or GLib's g_io_add_watch().</p>
<p>Use <a class="el" href="group__DBusConnection.html#gaebf031eb444b4f847606aa27daa3d8e6" title="Sets the watch functions for the connection.">dbus_connection_set_watch_functions()</a> or <a class="el" href="group__DBusServer.html#gaa5723810ea52e9f1815062fd91395892" title="Sets the watch functions for the server.">dbus_server_set_watch_functions()</a> to be notified when libdbus needs to add or remove watches. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga8dcdbd07f15a56207af4a36cb005da77"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_get_data" ref="ga8dcdbd07f15a56207af4a36cb005da77" args="(DBusWatch *watch)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * <a class="el" href="group__DBusWatch.html#ga8dcdbd07f15a56207af4a36cb005da77">dbus_watch_get_data</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets data previously set with <a class="el" href="group__DBusWatch.html#ga5c75a65cf0680956cc0188d86a05cfae" title="Sets data which can be retrieved with dbus_watch_get_data().">dbus_watch_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">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</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-watch_8c_source.html#l00623">623</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00050">data</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
</div>
</div>
<a class="anchor" id="gae7a91e6d4d1bc187419c47c522e33a8f"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_get_enabled" ref="gae7a91e6d4d1bc187419c47c522e33a8f" args="(DBusWatch *watch)" -->
<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__DBusWatch.html#gae7a91e6d4d1bc187419c47c522e33a8f">dbus_watch_get_enabled</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns whether a watch 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">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</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 watch is enabled </dd></dl>
<p>Definition at line <a class="el" href="dbus-watch_8c_source.html#l00667">667</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00052">enabled</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
</div>
</div>
<a class="anchor" id="ga62d7e86fe386ed48fb90d443b3a2ce7a"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_get_fd" ref="ga62d7e86fe386ed48fb90d443b3a2ce7a" args="(DBusWatch *watch)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__DBusWatch.html#ga62d7e86fe386ed48fb90d443b3a2ce7a">dbus_watch_get_fd</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deprecated former name of <a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d" title="Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descripto...">dbus_watch_get_unix_fd()</a>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the file descriptor to watch. </dd></dl>
<p>Definition at line <a class="el" href="dbus-watch_8c_source.html#l00536">536</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00557">dbus_watch_get_unix_fd()</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
</div>
</div>
<a class="anchor" id="gaf172a2b1d1f82333e67cec8d99c9204a"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_get_flags" ref="gaf172a2b1d1f82333e67cec8d99c9204a" args="(DBusWatch *watch)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="group__DBusWatch.html#gaf172a2b1d1f82333e67cec8d99c9204a">dbus_watch_get_flags</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets flags from DBusWatchFlags indicating what conditions should be monitored on the file descriptor. </p>
<p>The flags returned will only contain DBUS_WATCH_READABLE and DBUS_WATCH_WRITABLE, never DBUS_WATCH_HANGUP or DBUS_WATCH_ERROR; all watches implicitly include a watch for hangups, errors, and other exceptional conditions.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the conditions to watch. </dd></dl>
<p>Definition at line <a class="el" href="dbus-watch_8c_source.html#l00607">607</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00044">flags</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-watch_8c_source.html#l00296">_dbus_watch_list_set_functions()</a>.</p>
</div>
</div>
<a class="anchor" id="ga91308f393d41b31babda17c83833517f"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_get_socket" ref="ga91308f393d41b31babda17c83833517f" args="(DBusWatch *watch)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__DBusWatch.html#ga91308f393d41b31babda17c83833517f">dbus_watch_get_socket</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a socket to be watched, on UNIX this will return -1 if our transport is not socket-based so <a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d" title="Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descripto...">dbus_watch_get_unix_fd()</a> is preferred. </p>
<p>On Windows, <a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d" title="Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descripto...">dbus_watch_get_unix_fd()</a> returns -1 but this function returns a Winsock socket (assuming the transport is socket-based, as it always is for now).</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the socket to watch. </dd></dl>
<p>Definition at line <a class="el" href="dbus-watch_8c_source.html#l00586">586</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00043">fd</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-transport_8c_source.html#l00889">_dbus_transport_handle_watch()</a>, <a class="el" href="dbus-watch_8c_source.html#l00376">_dbus_watch_list_add_watch()</a>, <a class="el" href="dbus-watch_8c_source.html#l00409">_dbus_watch_list_remove_watch()</a>, <a class="el" href="dbus-watch_8c_source.html#l00296">_dbus_watch_list_set_functions()</a>, <a class="el" href="dbus-watch_8c_source.html#l00436">_dbus_watch_list_toggle_watch()</a>, <a class="el" href="dbus-watch_8c_source.html#l00557">dbus_watch_get_unix_fd()</a>, and <a class="el" href="dbus-watch_8c_source.html#l00642">dbus_watch_set_data()</a>.</p>
</div>
</div>
<a class="anchor" id="ga15df7f6120ead3e09bec8a70d3c43c0d"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_get_unix_fd" ref="ga15df7f6120ead3e09bec8a70d3c43c0d" args="(DBusWatch *watch)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__DBusWatch.html#ga15df7f6120ead3e09bec8a70d3c43c0d">dbus_watch_get_unix_fd</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descriptor. </p>
<p>On UNIX this is preferred to <a class="el" href="group__DBusWatch.html#ga91308f393d41b31babda17c83833517f" title="Returns a socket to be watched, on UNIX this will return -1 if our transport is not socket-based so d...">dbus_watch_get_socket()</a> since it works with more kinds of <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a>.</p>
<p>Always returns -1 on Windows. On Windows you use <a class="el" href="group__DBusWatch.html#ga91308f393d41b31babda17c83833517f" title="Returns a socket to be watched, on UNIX this will return -1 if our transport is not socket-based so d...">dbus_watch_get_socket()</a> to get a Winsock socket to watch.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a> object. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the file descriptor to watch. </dd></dl>
<p>Definition at line <a class="el" href="dbus-watch_8c_source.html#l00557">557</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00586">dbus_watch_get_socket()</a>, <a class="el" href="dbus-watch_8c_source.html#l00043">fd</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-watch_8c_source.html#l00536">dbus_watch_get_fd()</a>.</p>
</div>
</div>
<a class="anchor" id="gac2acdb1794450ac01a43ec4c3e07ebf7"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_handle" ref="gac2acdb1794450ac01a43ec4c3e07ebf7" args="(DBusWatch *watch, unsigned int flags)" -->
<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__DBusWatch.html#gac2acdb1794450ac01a43ec4c3e07ebf7">dbus_watch_handle</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"><em>flags</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Called to notify the D-Bus library when a previously-added watch is ready for reading or writing, or has an exception such as a hangup. </p>
<p>If this function returns <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>, then the file descriptor may still be ready for reading or writing, but more memory is needed in order to do the reading or writing. If you ignore the <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a> return, your application may spin in a busy loop on the file descriptor until memory becomes available, but nothing more catastrophic should happen.</p>
<p><a class="el" href="group__DBusWatch.html#gac2acdb1794450ac01a43ec4c3e07ebf7" title="Called to notify the D-Bus library when a previously-added watch is ready for reading or writing...">dbus_watch_handle()</a> cannot be called during the DBusAddWatchFunction, as the connection will not be ready to handle that watch yet.</p>
<p>It is not allowed to reference a <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a> after it has been passed to remove_function.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</a> object. </td></tr>
<tr><td class="paramname">flags</td><td>the poll condition using <a class="el" href="group__DBusConnection.html#ga0556779e61aeb19eb9cf6b6466bd1b98" title="Indicates the status of a DBusWatch.">DBusWatchFlags</a> values </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-watch_8c_source.html#l00698">698</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-internals_8c_source.html#l00258">_dbus_warn_check_failed()</a>, <a class="el" href="dbus-watch_8c_source.html#l00185">_dbus_watch_sanitize_condition()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="dbus-watch_8c_source.html#l00043">fd</a>, <a class="el" href="dbus-watch_8c_source.html#l00044">flags</a>, <a class="el" href="dbus-watch_8c_source.html#l00046">handler</a>, <a class="el" href="dbus-watch_8c_source.html#l00047">handler_data</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.</p>
</div>
</div>
<a class="anchor" id="ga5c75a65cf0680956cc0188d86a05cfae"></a><!-- doxytag: member="dbus-connection.h::dbus_watch_set_data" ref="ga5c75a65cf0680956cc0188d86a05cfae" args="(DBusWatch *watch, 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__DBusWatch.html#ga5c75a65cf0680956cc0188d86a05cfae">dbus_watch_set_data</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusWatch.html">DBusWatch</a> * </td>
<td class="paramname"><em>watch</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__DBusWatch.html#ga8dcdbd07f15a56207af4a36cb005da77" title="Gets data previously set with dbus_watch_set_data() or NULL if none.">dbus_watch_get_data()</a>. </p>
<p>Intended for use by the DBusAddWatchFunction and DBusRemoveWatchFunction to store their own data. For example with Qt you might store the QSocketNotifier for this watch and with GLib you might store a GSource.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">watch</td><td>the <a class="el" href="structDBusWatch.html" title="Implementation of DBusWatch.">DBusWatch</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-watch_8c_source.html#l00642">642</a> of file <a class="el" href="dbus-watch_8c_source.html">dbus-watch.c</a>.</p>
<p>References <a class="el" href="dbus-watch_8c_source.html#l00050">data</a>, <a class="el" href="dbus-watch_8c_source.html#l00586">dbus_watch_get_socket()</a>, <a class="el" href="dbus-watch_8c_source.html#l00051">free_data_function</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-watch_8c_source.html#l00138">_dbus_watch_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>