Current File : //usr/share/doc/dbus/api/group__DBusServer.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: DBusServer</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><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">DBusServer</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>Server that listens for new connections.  
<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">typedef struct <a class="el" href="structDBusServer.html">DBusServer</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga39dc10dc2cbe727cf312c51b25b4341e">DBusServer</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">An opaque object representing a server that listens for connections from other applications.  <a href="#ga39dc10dc2cbe727cf312c51b25b4341e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga8478cd198973f6a6cb224ec23175faa7">DBusNewConnectionFunction</a> )(<a class="el" href="structDBusServer.html">DBusServer</a> *server, <a class="el" href="structDBusConnection.html">DBusConnection</a> *new_connection, void *data)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when a new connection to the server is available.  <a href="#ga8478cd198973f6a6cb224ec23175faa7"></a><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"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga4c83cf9f2c186afa97decdc25ac163d8">dbus_server_listen</a> (const char *address, <a class="el" href="structDBusError.html">DBusError</a> *error)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Listens for new connections on the given address.  <a href="#ga4c83cf9f2c186afa97decdc25ac163d8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gabe1c14264ef6bf3e5fe446ab9bf8b913">dbus_server_ref</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the reference count of a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>.  <a href="#gabe1c14264ef6bf3e5fe446ab9bf8b913"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga95d0b6cb9795b4919aa08f667807c555">dbus_server_unref</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrements the reference count of a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>.  <a href="#ga95d0b6cb9795b4919aa08f667807c555"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga1ff306fbaaa608306b0619ba5c0029a1">dbus_server_disconnect</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the server's address and stops listening for new clients.  <a href="#ga1ff306fbaaa608306b0619ba5c0029a1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga93c36d8b42a3f2a4f3706a0c3609b3d1">dbus_server_get_is_connected</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a> if the server is still listening for new connections.  <a href="#ga93c36d8b42a3f2a4f3706a0c3609b3d1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga63a133dc2786afed48c87127baa96927">dbus_server_get_address</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the address of the server, as a newly-allocated string which must be freed by the caller.  <a href="#ga63a133dc2786afed48c87127baa96927"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga3b2920b3c65836113781d9dd00d1e139">dbus_server_get_id</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller.  <a href="#ga3b2920b3c65836113781d9dd00d1e139"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gaa14d9109e04adccffd9a40460c28c53b">dbus_server_set_new_connection_function</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server, <a class="el" href="group__DBusServer.html#ga8478cd198973f6a6cb224ec23175faa7">DBusNewConnectionFunction</a> function, void *data, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> free_data_function)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a function to be used for handling new connections.  <a href="#gaa14d9109e04adccffd9a40460c28c53b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gaa5723810ea52e9f1815062fd91395892">dbus_server_set_watch_functions</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server, <a class="el" href="group__DBusConnection.html#ga9188ca3fd89c957dc269dbe8601b270e">DBusAddWatchFunction</a> add_function, <a class="el" href="group__DBusConnection.html#gaaab846a872d938b27503129551ea0c62">DBusRemoveWatchFunction</a> remove_function, <a class="el" href="group__DBusConnection.html#gace13544ff3075b5fccbce896682ec6ff">DBusWatchToggledFunction</a> toggled_function, void *data, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> free_data_function)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the watch functions for the server.  <a href="#gaa5723810ea52e9f1815062fd91395892"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gacafa42ffc063a7386db40a975c32d530">dbus_server_set_timeout_functions</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server, <a class="el" href="group__DBusConnection.html#ga01a45587090d82ee97b5042b49037a08">DBusAddTimeoutFunction</a> add_function, <a class="el" href="group__DBusConnection.html#ga13aae9d5981de45abca0db1717dc7daf">DBusRemoveTimeoutFunction</a> remove_function, <a class="el" href="group__DBusConnection.html#ga62eea9a2032ae15b6738534b93d18e86">DBusTimeoutToggledFunction</a> toggled_function, void *data, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> free_data_function)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the timeout functions for the server.  <a href="#gacafa42ffc063a7386db40a975c32d530"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga309e5f1510c74c4b221d12d874d53341">dbus_server_set_auth_mechanisms</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server, const char **mechanisms)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the authentication mechanisms that this server offers to clients, as a <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>-terminated array of mechanism names.  <a href="#ga309e5f1510c74c4b221d12d874d53341"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#ga05d280cd92ea5bb0d49bbe5b1fb1d5c2">dbus_server_allocate_data_slot</a> (<a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> *slot_p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates an integer ID to be used for storing application-specific data on any <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>.  <a href="#ga05d280cd92ea5bb0d49bbe5b1fb1d5c2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gac6ebc6105e32ab38ef0ac60dec6d5bc8">dbus_server_free_data_slot</a> (<a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> *slot_p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Deallocates a global ID for server data slots.  <a href="#gac6ebc6105e32ab38ef0ac60dec6d5bc8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gab9ecb216dc9c40b0c7d370673fb9b269">dbus_server_set_data</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server, int slot, void *data, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> free_data_func)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores a pointer on a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>, along with an optional function to be used for freeing the data when the data is set again, or when the server is finalized.  <a href="#gab9ecb216dc9c40b0c7d370673fb9b269"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusServer.html#gac2bfa9f2e06c4347fefe537b233660d3">dbus_server_get_data</a> (<a class="el" href="structDBusServer.html">DBusServer</a> *server, int slot)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves data previously set with <a class="el" href="group__DBusServer.html#gab9ecb216dc9c40b0c7d370673fb9b269" title="Stores a pointer on a DBusServer, along with an optional function to be used for freeing the data whe...">dbus_server_set_data()</a>.  <a href="#gac2bfa9f2e06c4347fefe537b233660d3"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Server that listens for new connections. </p>
<p>A <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> represents a server that other applications can connect to. Each connection from another application is represented by a <a class="el" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a>.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000046">Todo:</a></b></dt><dd><p class="startdd">Thread safety hasn't been tested much for <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> </p>
<p class="enddd">Need notification to apps of disconnection, may matter for some transports </p>
</dd></dl>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga8478cd198973f6a6cb224ec23175faa7"></a><!-- doxytag: member="dbus&#45;server.h::DBusNewConnectionFunction" ref="ga8478cd198973f6a6cb224ec23175faa7" args=")(DBusServer *server, DBusConnection *new_connection, void *data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(*  <a class="el" href="group__DBusServer.html#ga8478cd198973f6a6cb224ec23175faa7">DBusNewConnectionFunction</a>)(<a class="el" href="structDBusServer.html">DBusServer</a> *server, <a class="el" href="structDBusConnection.html">DBusConnection</a> *new_connection, void *data)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called when a new connection to the server is available. </p>
<p>Must reference and save the new connection, or close the new connection. Set with <a class="el" href="group__DBusServer.html#gaa14d9109e04adccffd9a40460c28c53b" title="Sets a function to be used for handling new connections.">dbus_server_set_new_connection_function()</a>. </p>

<p>Definition at line <a class="el" href="dbus-server_8h_source.html#l00047">47</a> of file <a class="el" href="dbus-server_8h_source.html">dbus-server.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga39dc10dc2cbe727cf312c51b25b4341e"></a><!-- doxytag: member="dbus&#45;server.h::DBusServer" ref="ga39dc10dc2cbe727cf312c51b25b4341e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structDBusServer.html">DBusServer</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>An opaque object representing a server that listens for connections from other applications. </p>
<p>Each time a connection is made, a new <a class="el" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> is created and made available via an application-provided DBusNewConnectionFunction. The DBusNewConnectionFunction is provided with <a class="el" href="group__DBusServer.html#gaa14d9109e04adccffd9a40460c28c53b" title="Sets a function to be used for handling new connections.">dbus_server_set_new_connection_function()</a>. </p>

<p>Definition at line <a class="el" href="dbus-server_8h_source.html#l00042">42</a> of file <a class="el" href="dbus-server_8h_source.html">dbus-server.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga05d280cd92ea5bb0d49bbe5b1fb1d5c2"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_allocate_data_slot" ref="ga05d280cd92ea5bb0d49bbe5b1fb1d5c2" args="(dbus_int32_t *slot_p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusServer.html#ga05d280cd92ea5bb0d49bbe5b1fb1d5c2">dbus_server_allocate_data_slot</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> *&#160;</td>
          <td class="paramname"><em>slot_p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Allocates an integer ID to be used for storing application-specific data on any <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>. </p>
<p>The allocated ID may then be used with <a class="el" href="group__DBusServer.html#gab9ecb216dc9c40b0c7d370673fb9b269" title="Stores a pointer on a DBusServer, along with an optional function to be used for freeing the data whe...">dbus_server_set_data()</a> and <a class="el" href="group__DBusServer.html#gac2bfa9f2e06c4347fefe537b233660d3" title="Retrieves data previously set with dbus_server_set_data().">dbus_server_get_data()</a>. The slot must be initialized with -1. If a nonnegative slot is passed in, the refcount is incremented on that slot, rather than creating a new slot.</p>
<p>The allocated slot is global, i.e. all <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> objects will have a slot with the given integer ID reserved.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">slot_p</td><td>address of global variable storing the slot ID </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 &quot;0&quot;.">FALSE</a> on no memory </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l01080">1080</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-dataslot_8c_source.html#l00069">_dbus_data_slot_allocator_alloc()</a>.</p>

</div>
</div>
<a class="anchor" id="ga1ff306fbaaa608306b0619ba5c0029a1"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_disconnect" ref="ga1ff306fbaaa608306b0619ba5c0029a1" args="(DBusServer *server)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusServer.html#ga1ff306fbaaa608306b0619ba5c0029a1">dbus_server_disconnect</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Releases the server's address and stops listening for new clients. </p>
<p>If called more than once, only the first call has an effect. Does not modify the server's reference count.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00770">770</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-server_8c_source.html#l00687">dbus_server_ref()</a>, <a class="el" href="dbus-server_8c_source.html#l00720">dbus_server_unref()</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00048">DBusServerVTable::disconnect</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00087">disconnected</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00059">vtable</a>.</p>

</div>
</div>
<a class="anchor" id="gac6ebc6105e32ab38ef0ac60dec6d5bc8"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_free_data_slot" ref="gac6ebc6105e32ab38ef0ac60dec6d5bc8" args="(dbus_int32_t *slot_p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusServer.html#gac6ebc6105e32ab38ef0ac60dec6d5bc8">dbus_server_free_data_slot</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> *&#160;</td>
          <td class="paramname"><em>slot_p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Deallocates a global ID for server data slots. </p>
<p><a class="el" href="group__DBusServer.html#gac2bfa9f2e06c4347fefe537b233660d3" title="Retrieves data previously set with dbus_server_set_data().">dbus_server_get_data()</a> and <a class="el" href="group__DBusServer.html#gab9ecb216dc9c40b0c7d370673fb9b269" title="Stores a pointer on a DBusServer, along with an optional function to be used for freeing the data whe...">dbus_server_set_data()</a> may no longer be used with this slot. Existing data stored on existing <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> objects will be freed when the server is finalized, but may not be retrieved (and may only be replaced if someone else reallocates the slot).</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">slot_p</td><td>address of the slot to deallocate </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l01098">1098</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-dataslot_8c_source.html#l00154">_dbus_data_slot_allocator_free()</a>.</p>

</div>
</div>
<a class="anchor" id="ga63a133dc2786afed48c87127baa96927"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_get_address" ref="ga63a133dc2786afed48c87127baa96927" args="(DBusServer *server)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT char * <a class="el" href="group__DBusServer.html#ga63a133dc2786afed48c87127baa96927">dbus_server_get_address</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the address of the server, as a newly-allocated string which must be freed by the caller. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the address or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if no memory </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00818">818</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-internals_8c_source.html#l00527">_dbus_strdup()</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00069">address</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>

</div>
</div>
<a class="anchor" id="gac2bfa9f2e06c4347fefe537b233660d3"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_get_data" ref="gac2bfa9f2e06c4347fefe537b233660d3" args="(DBusServer *server, int slot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT void * <a class="el" href="group__DBusServer.html#gac2bfa9f2e06c4347fefe537b233660d3">dbus_server_get_data</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>slot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Retrieves data previously set with <a class="el" href="group__DBusServer.html#gab9ecb216dc9c40b0c7d370673fb9b269" title="Stores a pointer on a DBusServer, along with an optional function to be used for freeing the data whe...">dbus_server_set_data()</a>. </p>
<p>The slot must still be allocated (must not have been freed).</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server </td></tr>
    <tr><td class="paramname">slot</td><td>the slot to get data from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the data, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if not found </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l01159">1159</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-dataslot_8c_source.html#l00285">_dbus_data_slot_list_get()</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00074">slot_list</a>.</p>

</div>
</div>
<a class="anchor" id="ga3b2920b3c65836113781d9dd00d1e139"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_get_id" ref="ga3b2920b3c65836113781d9dd00d1e139" args="(DBusServer *server)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT char * <a class="el" href="group__DBusServer.html#ga3b2920b3c65836113781d9dd00d1e139">dbus_server_get_id</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller. </p>
<p>This ID is normally used by clients to tell when two <a class="el" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> would be equivalent (because the server address passed to <a class="el" href="group__DBusConnection.html#gacd32f819820266598c6b6847dfddaf9c" title="Gets a connection to a remote address.">dbus_connection_open()</a> will have the same guid in the two cases). <a class="el" href="group__DBusConnection.html#gacd32f819820266598c6b6847dfddaf9c" title="Gets a connection to a remote address.">dbus_connection_open()</a> can re-use an existing connection with the same ID instead of opening a new connection.</p>
<p>This is an ID unique to each <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>. Remember that a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> represents only one mode of connecting, so e.g. a bus daemon can listen on multiple addresses which will mean it has multiple <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> each with their own ID.</p>
<p>The ID is not a UUID in the sense of RFC4122; the details are explained in the D-Bus specification.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the id of the server or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if no memory </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00854">854</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-string_8c_source.html#l00655">_dbus_string_copy_data()</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00064">guid_hex</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>

</div>
</div>
<a class="anchor" id="ga93c36d8b42a3f2a4f3706a0c3609b3d1"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_get_is_connected" ref="ga93c36d8b42a3f2a4f3706a0c3609b3d1" args="(DBusServer *server)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusServer.html#ga93c36d8b42a3f2a4f3706a0c3609b3d1">dbus_server_get_is_connected</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a> if the server is still listening for new connections. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00797">797</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-server-protected_8h_source.html#l00087">disconnected</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="ga4c83cf9f2c186afa97decdc25ac163d8"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_listen" ref="ga4c83cf9f2c186afa97decdc25ac163d8" args="(const char *address, DBusError *error)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="structDBusServer.html">DBusServer</a> * <a class="el" href="group__DBusServer.html#ga4c83cf9f2c186afa97decdc25ac163d8">dbus_server_listen</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structDBusError.html">DBusError</a> *&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Listens for new connections on the given address. </p>
<p>If there are multiple semicolon-separated address entries in the address, tries each one and listens on the first one that works.</p>
<p>Returns <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> and sets error if listening fails for any reason. Otherwise returns a new <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>. <a class="el" href="group__DBusServer.html#gaa14d9109e04adccffd9a40460c28c53b" title="Sets a function to be used for handling new connections.">dbus_server_set_new_connection_function()</a>, <a class="el" href="group__DBusServer.html#gaa5723810ea52e9f1815062fd91395892" title="Sets the watch functions for the server.">dbus_server_set_watch_functions()</a>, and <a class="el" href="group__DBusServer.html#gacafa42ffc063a7386db40a975c32d530" title="Sets the timeout functions for the server.">dbus_server_set_timeout_functions()</a> should be called immediately to render the server fully functional.</p>
<p>To free the server, applications must call first <a class="el" href="group__DBusServer.html#ga1ff306fbaaa608306b0619ba5c0029a1" title="Releases the server&#39;s address and stops listening for new clients.">dbus_server_disconnect()</a> and then <a class="el" href="group__DBusServer.html#ga95d0b6cb9795b4919aa08f667807c555" title="Decrements the reference count of a DBusServer.">dbus_server_unref()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>the address of this server. </td></tr>
    <tr><td class="paramname">error</td><td>location to store reason for failure. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a new <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> on failure. </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00549">549</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-address_8c_source.html#l00189">dbus_address_entries_free()</a>, <a class="el" href="dbus-address_8c_source.html#l00227">dbus_address_entry_get_method()</a>, <a class="el" href="dbus-protocol_8h_source.html#l00382">DBUS_ERROR_ADDRESS_IN_USE</a>, <a class="el" href="dbus-protocol_8h_source.html#l00362">DBUS_ERROR_BAD_ADDRESS</a>, <a class="el" href="dbus-errors_8c_source.html#l00211">dbus_error_free()</a>, <a class="el" href="dbus-errors_8h_source.html#l00062">DBUS_ERROR_INIT</a>, <a class="el" href="dbus-errors_8c_source.html#l00329">dbus_error_is_set()</a>, <a class="el" href="dbus-errors_8c_source.html#l00279">dbus_move_error()</a>, <a class="el" href="dbus-address_8c_source.html#l00363">dbus_parse_address()</a>, <a class="el" href="dbus-errors_8c_source.html#l00354">dbus_set_error()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</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="gabe1c14264ef6bf3e5fe446ab9bf8b913"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_ref" ref="gabe1c14264ef6bf3e5fe446ab9bf8b913" args="(DBusServer *server)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="structDBusServer.html">DBusServer</a> * <a class="el" href="group__DBusServer.html#gabe1c14264ef6bf3e5fe446ab9bf8b913">dbus_server_ref</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Increments the reference count of a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the server </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00687">687</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02524">_dbus_atomic_dec()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02501">_dbus_atomic_inc()</a>, <a class="el" href="dbus-internals_8c_source.html#l00893">_dbus_return_if_fail_warning_format</a>, <a class="el" href="dbus-internals_8c_source.html#l00258">_dbus_warn_check_failed()</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00058">refcount</a>.</p>

<p>Referenced by <a class="el" href="dbus-server_8c_source.html#l00770">dbus_server_disconnect()</a>.</p>

</div>
</div>
<a class="anchor" id="ga309e5f1510c74c4b221d12d874d53341"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_set_auth_mechanisms" ref="ga309e5f1510c74c4b221d12d874d53341" args="(DBusServer *server, const char **mechanisms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusServer.html#ga309e5f1510c74c4b221d12d874d53341">dbus_server_set_auth_mechanisms</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>mechanisms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the authentication mechanisms that this server offers to clients, as a <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>-terminated array of mechanism names. </p>
<p>This function only affects connections created <em>after</em> it is called. Pass <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> instead of an array to use all available mechanisms (this is the default behavior).</p>
<p>The D-Bus specification describes some of the supported mechanisms.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server </td></tr>
    <tr><td class="paramname">mechanisms</td><td><a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>-terminated array of mechanisms </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 &quot;0&quot;.">FALSE</a> if no memory </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l01033">1033</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-internals_8c_source.html#l00578">_dbus_dup_string_array()</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00085">auth_mechanisms</a>, <a class="el" href="dbus-memory_8c_source.html#l00749">dbus_free_string_array()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</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="gab9ecb216dc9c40b0c7d370673fb9b269"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_set_data" ref="gab9ecb216dc9c40b0c7d370673fb9b269" args="(DBusServer *server, int slot, void *data, DBusFreeFunction free_data_func)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusServer.html#gab9ecb216dc9c40b0c7d370673fb9b269">dbus_server_set_data</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>slot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</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>&#160;</td>
          <td class="paramname"><em>free_data_func</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Stores a pointer on a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>, along with an optional function to be used for freeing the data when the data is set again, or when the server is finalized. </p>
<p>The slot number must have been allocated with <a class="el" href="group__DBusServer.html#ga05d280cd92ea5bb0d49bbe5b1fb1d5c2" title="Allocates an integer ID to be used for storing application-specific data on any DBusServer.">dbus_server_allocate_data_slot()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server </td></tr>
    <tr><td class="paramname">slot</td><td>the slot number </td></tr>
    <tr><td class="paramname">data</td><td>the data to store </td></tr>
    <tr><td class="paramname">free_data_func</td><td>finalizer function for the data </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 &quot;1&quot;.">TRUE</a> if there was enough memory to store the data </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l01119">1119</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-dataslot_8c_source.html#l00221">_dbus_data_slot_list_set()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00074">slot_list</a>.</p>

</div>
</div>
<a class="anchor" id="gaa14d9109e04adccffd9a40460c28c53b"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_set_new_connection_function" ref="gaa14d9109e04adccffd9a40460c28c53b" args="(DBusServer *server, DBusNewConnectionFunction function, void *data, DBusFreeFunction free_data_function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusServer.html#gaa14d9109e04adccffd9a40460c28c53b">dbus_server_set_new_connection_function</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusServer.html#ga8478cd198973f6a6cb224ec23175faa7">DBusNewConnectionFunction</a>&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</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>&#160;</td>
          <td class="paramname"><em>free_data_function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a function to be used for handling new connections. </p>
<p>The given function is passed each new connection as the connection is created. If the new connection function increments the connection's reference count, the connection will stay alive. Otherwise, the connection will be unreferenced and closed. The new connection function may also close the connection itself, which is considered good form if the connection is not wanted.</p>
<p>The connection here is private in the sense of <a class="el" href="group__DBusConnection.html#ga434e3fc7ee420fd30e2f05e57ff26b1d" title="Opens a new, dedicated connection to a remote address.">dbus_connection_open_private()</a>, so if the new connection function keeps a reference it must arrange for the connection to be closed. i.e. libdbus does not own this connection once the new connection function takes a reference.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
    <tr><td class="paramname">function</td><td>a function to handle new connections. </td></tr>
    <tr><td class="paramname">data</td><td>data to pass to the new connection handler. </td></tr>
    <tr><td class="paramname">free_data_function</td><td>function to free the data. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00889">889</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-server-protected_8h_source.html#l00079">new_connection_data</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00081">new_connection_free_data_function</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00077">new_connection_function</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>

<p>Referenced by <a class="el" href="dbus-server_8c_source.html#l00193">_dbus_server_finalize_base()</a>.</p>

</div>
</div>
<a class="anchor" id="gacafa42ffc063a7386db40a975c32d530"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_set_timeout_functions" ref="gacafa42ffc063a7386db40a975c32d530" args="(DBusServer *server, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusServer.html#gacafa42ffc063a7386db40a975c32d530">dbus_server_set_timeout_functions</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusConnection.html#ga01a45587090d82ee97b5042b49037a08">DBusAddTimeoutFunction</a>&#160;</td>
          <td class="paramname"><em>add_function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusConnection.html#ga13aae9d5981de45abca0db1717dc7daf">DBusRemoveTimeoutFunction</a>&#160;</td>
          <td class="paramname"><em>remove_function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusConnection.html#ga62eea9a2032ae15b6738534b93d18e86">DBusTimeoutToggledFunction</a>&#160;</td>
          <td class="paramname"><em>toggled_function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</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>&#160;</td>
          <td class="paramname"><em>free_data_function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the timeout functions for the server. </p>
<p>These functions are responsible for making the application's main loop aware of timeouts.</p>
<p>This function behaves exactly like <a class="el" href="group__DBusConnection.html#gab3cbc68eec427e9ce1783b25d44fe93c" title="Sets the timeout functions for the connection.">dbus_connection_set_timeout_functions()</a>; see the documentation for that routine.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
    <tr><td class="paramname">add_function</td><td>function to add a timeout. </td></tr>
    <tr><td class="paramname">remove_function</td><td>function to remove a timeout. </td></tr>
    <tr><td class="paramname">toggled_function</td><td>function to notify when the timeout is enabled/disabled </td></tr>
    <tr><td class="paramname">data</td><td>data to pass to add_function and remove_function. </td></tr>
    <tr><td class="paramname">free_data_function</td><td>function to be called to free the data. </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 &quot;0&quot;.">FALSE</a> on failure (no memory) </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00982">982</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-timeout_8c_source.html#l00239">_dbus_timeout_list_set_functions()</a>, <a class="el" href="dbus-internals_8c_source.html#l00258">_dbus_warn_check_failed()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00067">timeouts</a>.</p>

</div>
</div>
<a class="anchor" id="gaa5723810ea52e9f1815062fd91395892"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_set_watch_functions" ref="gaa5723810ea52e9f1815062fd91395892" args="(DBusServer *server, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusServer.html#gaa5723810ea52e9f1815062fd91395892">dbus_server_set_watch_functions</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusConnection.html#ga9188ca3fd89c957dc269dbe8601b270e">DBusAddWatchFunction</a>&#160;</td>
          <td class="paramname"><em>add_function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusConnection.html#gaaab846a872d938b27503129551ea0c62">DBusRemoveWatchFunction</a>&#160;</td>
          <td class="paramname"><em>remove_function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__DBusConnection.html#gace13544ff3075b5fccbce896682ec6ff">DBusWatchToggledFunction</a>&#160;</td>
          <td class="paramname"><em>toggled_function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</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>&#160;</td>
          <td class="paramname"><em>free_data_function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the watch functions for the server. </p>
<p>These functions are responsible for making the application's main loop aware of file descriptors that need to be monitored for events.</p>
<p>This function behaves exactly like <a class="el" href="group__DBusConnection.html#gaebf031eb444b4f847606aa27daa3d8e6" title="Sets the watch functions for the connection.">dbus_connection_set_watch_functions()</a>; see the documentation for that routine.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
    <tr><td class="paramname">add_function</td><td>function to begin monitoring a new descriptor. </td></tr>
    <tr><td class="paramname">remove_function</td><td>function to stop monitoring a descriptor. </td></tr>
    <tr><td class="paramname">toggled_function</td><td>function to notify when the watch is enabled/disabled </td></tr>
    <tr><td class="paramname">data</td><td>data to pass to add_function and remove_function. </td></tr>
    <tr><td class="paramname">free_data_function</td><td>function to be called to free the data. </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 &quot;0&quot;.">FALSE</a> on failure (no memory) </dd></dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00929">929</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.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#l00296">_dbus_watch_list_set_functions()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00066">watches</a>.</p>

</div>
</div>
<a class="anchor" id="ga95d0b6cb9795b4919aa08f667807c555"></a><!-- doxytag: member="dbus&#45;server.c::dbus_server_unref" ref="ga95d0b6cb9795b4919aa08f667807c555" args="(DBusServer *server)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusServer.html#ga95d0b6cb9795b4919aa08f667807c555">dbus_server_unref</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusServer.html">DBusServer</a> *&#160;</td>
          <td class="paramname"><em>server</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decrements the reference count of a <a class="el" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a>. </p>
<p>Finalizes the server if the reference count reaches zero.</p>
<p>The server must be disconnected before the refcount reaches zero.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">server</td><td>the server. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dbus-server_8c_source.html#l00720">720</a> of file <a class="el" href="dbus-server_8c_source.html">dbus-server.c</a>.</p>

<p>References <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02524">_dbus_atomic_dec()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02501">_dbus_atomic_inc()</a>, <a class="el" href="dbus-internals_8c_source.html#l00893">_dbus_return_if_fail_warning_format</a>, <a class="el" href="dbus-internals_8c_source.html#l00258">_dbus_warn_check_failed()</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00087">disconnected</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00045">DBusServerVTable::finalize</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="dbus-server-protected_8h_source.html#l00058">refcount</a>, and <a class="el" href="dbus-server-protected_8h_source.html#l00059">vtable</a>.</p>

<p>Referenced by <a class="el" href="dbus-server_8c_source.html#l00770">dbus_server_disconnect()</a>.</p>

</div>
</div>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:33 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>