| Current File : //usr/share/doc/dbus/api/group__DBusDataSlot.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: Data slots</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="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Data slots</div> </div>
<div class="ingroups"><a class="el" href="group__DBusInternals.html">D-Bus secret internal implementation details</a></div></div><!--header-->
<div class="contents">
<p>Storing data by ID.
<a href="#details">More...</a></p>
<table class="memberdecls">
<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="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#ga49236838eb414100f691a22ad5210cb5">_dbus_data_slot_allocator_init</a> (<a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> *allocator, DBusGlobalLock lock)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes a data slot allocator object, used to assign integer IDs for data slots. <a href="#ga49236838eb414100f691a22ad5210cb5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#gaf61f2bd0148bace4f67a2d6d97b26ea9">_dbus_data_slot_allocator_alloc</a> (<a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> *allocator, <a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> *slot_id_p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates an integer ID to be used for storing data in a <a class="el" href="structDBusDataSlotList.html" title="Data structure that stores the actual user data set at a given slot.">DBusDataSlotList</a>. <a href="#gaf61f2bd0148bace4f67a2d6d97b26ea9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#ga059c50a24cd9fc984e918e6159841633">_dbus_data_slot_allocator_free</a> (<a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> *allocator, <a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> *slot_id_p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocates an ID previously allocated with <a class="el" href="group__DBusDataSlot.html#gaf61f2bd0148bace4f67a2d6d97b26ea9" title="Allocates an integer ID to be used for storing data in a DBusDataSlotList.">_dbus_data_slot_allocator_alloc()</a>. <a href="#ga059c50a24cd9fc984e918e6159841633"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#ga6de49b3a1210202215d40a5a19806992">_dbus_data_slot_list_init</a> (<a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> *list)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes a slot list. <a href="#ga6de49b3a1210202215d40a5a19806992"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#gad2952f9f686d96e7114fc49ab7452e1a">_dbus_data_slot_list_set</a> (<a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> *allocator, <a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> *list, int slot, void *data, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> free_data_func, <a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> *old_free_func, void **old_data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Stores a pointer in the data slot list, along with an optional function to be used for freeing the data when the data is set again, or when the slot list is finalized. <a href="#gad2952f9f686d96e7114fc49ab7452e1a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#ga43f741229f0c38788442601e2750ec66">_dbus_data_slot_list_get</a> (<a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> *allocator, <a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> *list, int slot)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves data previously set with _dbus_data_slot_list_set_data(). <a href="#ga43f741229f0c38788442601e2750ec66"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#ga3c96d2ca263ba397b4da2956a49ae282">_dbus_data_slot_list_clear</a> (<a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> *list)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees all data slots contained in the list, calling application-provided free functions if they exist. <a href="#ga3c96d2ca263ba397b4da2956a49ae282"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusDataSlot.html#gabc399733376c462c3010271a2d431e73">_dbus_data_slot_list_free</a> (<a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> *list)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees the data slot list and all data slots contained in it, calling application-provided free functions if they exist. <a href="#gabc399733376c462c3010271a2d431e73"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Storing data by ID. </p>
<p>Types and functions related to storing data by an allocated ID. This is used for <a class="el" href="group__DBusConnection.html#ga845b4942399f43dd4ac644de7cb9e3ff" title="Stores a pointer on a DBusConnection, along with an optional function to be used for freeing the data...">dbus_connection_set_data()</a>, <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>, etc. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf61f2bd0148bace4f67a2d6d97b26ea9"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_allocator_alloc" ref="gaf61f2bd0148bace4f67a2d6d97b26ea9" args="(DBusDataSlotAllocator *allocator, dbus_int32_t *slot_id_p)" -->
<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__DBusDataSlot.html#gaf61f2bd0148bace4f67a2d6d97b26ea9">_dbus_data_slot_allocator_alloc</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> * </td>
<td class="paramname"><em>allocator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> * </td>
<td class="paramname"><em>slot_id_p</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Allocates an integer ID to be used for storing data in a <a class="el" href="structDBusDataSlotList.html" title="Data structure that stores the actual user data set at a given slot.">DBusDataSlotList</a>. </p>
<p>If the value at *slot_id_p is not -1, this function just increments the refcount for the existing slot ID. If the value is -1, a new slot ID is allocated and stored at *slot_id_p.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">allocator</td><td>the allocator </td></tr>
<tr><td class="paramname">slot_id_p</td><td>address to fill with the slot ID </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> on success </dd></dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00069">69</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00057">DBusDataSlotAllocator::allocated_slots</a>, <a class="el" href="dbus-memory_8c_source.html#l00601">dbus_realloc()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00060">DBusDataSlotAllocator::lock</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00058">DBusDataSlotAllocator::n_allocated_slots</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00059">DBusDataSlotAllocator::n_used_slots</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00049">DBusAllocatedSlot::refcount</a>, and <a class="el" href="dbus-dataslot_8h_source.html#l00048">DBusAllocatedSlot::slot_id</a>.</p>
<p>Referenced by <a class="el" href="dbus-connection_8c_source.html#l05920">dbus_connection_allocate_data_slot()</a>, <a class="el" href="dbus-message_8c_source.html#l04560">dbus_message_allocate_data_slot()</a>, <a class="el" href="dbus-pending-call_8c_source.html#l00759">dbus_pending_call_allocate_data_slot()</a>, and <a class="el" href="dbus-server_8c_source.html#l01080">dbus_server_allocate_data_slot()</a>.</p>
</div>
</div>
<a class="anchor" id="ga059c50a24cd9fc984e918e6159841633"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_allocator_free" ref="ga059c50a24cd9fc984e918e6159841633" args="(DBusDataSlotAllocator *allocator, dbus_int32_t *slot_id_p)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__DBusDataSlot.html#ga059c50a24cd9fc984e918e6159841633">_dbus_data_slot_allocator_free</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> * </td>
<td class="paramname"><em>allocator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8">dbus_int32_t</a> * </td>
<td class="paramname"><em>slot_id_p</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deallocates an ID previously allocated with <a class="el" href="group__DBusDataSlot.html#gaf61f2bd0148bace4f67a2d6d97b26ea9" title="Allocates an integer ID to be used for storing data in a DBusDataSlotList.">_dbus_data_slot_allocator_alloc()</a>. </p>
<p>Existing data stored on existing <a class="el" href="structDBusDataSlotList.html" title="Data structure that stores the actual user data set at a given slot.">DBusDataSlotList</a> objects with this ID will be freed when the data list is finalized, but may not be retrieved (and may only be replaced if someone else reallocates the slot). The slot value is reset to -1 if this is the last unref.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">allocator</td><td>the allocator </td></tr>
<tr><td class="paramname">slot_id_p</td><td>address where we store the slot </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00154">154</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00057">DBusDataSlotAllocator::allocated_slots</a>, <a class="el" href="dbus-memory_8c_source.html#l00701">dbus_free()</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00060">DBusDataSlotAllocator::lock</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00058">DBusDataSlotAllocator::n_allocated_slots</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00059">DBusDataSlotAllocator::n_used_slots</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00049">DBusAllocatedSlot::refcount</a>, and <a class="el" href="dbus-dataslot_8h_source.html#l00048">DBusAllocatedSlot::slot_id</a>.</p>
<p>Referenced by <a class="el" href="dbus-connection_8c_source.html#l05938">dbus_connection_free_data_slot()</a>, <a class="el" href="dbus-message_8c_source.html#l04578">dbus_message_free_data_slot()</a>, <a class="el" href="dbus-pending-call_8c_source.html#l00779">dbus_pending_call_free_data_slot()</a>, and <a class="el" href="dbus-server_8c_source.html#l01098">dbus_server_free_data_slot()</a>.</p>
</div>
</div>
<a class="anchor" id="ga49236838eb414100f691a22ad5210cb5"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_allocator_init" ref="ga49236838eb414100f691a22ad5210cb5" args="(DBusDataSlotAllocator *allocator, DBusGlobalLock lock)" -->
<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__DBusDataSlot.html#ga49236838eb414100f691a22ad5210cb5">_dbus_data_slot_allocator_init</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> * </td>
<td class="paramname"><em>allocator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DBusGlobalLock </td>
<td class="paramname"><em>lock</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a data slot allocator object, used to assign integer IDs for data slots. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">allocator</td><td>the allocator to initialize </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00046">46</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00057">DBusDataSlotAllocator::allocated_slots</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00060">DBusDataSlotAllocator::lock</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00058">DBusDataSlotAllocator::n_allocated_slots</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00059">DBusDataSlotAllocator::n_used_slots</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="ga3c96d2ca263ba397b4da2956a49ae282"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_list_clear" ref="ga3c96d2ca263ba397b4da2956a49ae282" args="(DBusDataSlotList *list)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__DBusDataSlot.html#ga3c96d2ca263ba397b4da2956a49ae282">_dbus_data_slot_list_clear</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> * </td>
<td class="paramname"><em>list</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees all data slots contained in the list, calling application-provided free functions if they exist. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">list</td><td>the list to clear </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00317">317</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00038">data</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00039">free_data_func</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-dataslot_8h_source.html#l00071">DBusDataSlotList::slots</a>.</p>
<p>Referenced by <a class="el" href="dbus-dataslot_8c_source.html#l00340">_dbus_data_slot_list_free()</a>.</p>
</div>
</div>
<a class="anchor" id="gabc399733376c462c3010271a2d431e73"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_list_free" ref="gabc399733376c462c3010271a2d431e73" args="(DBusDataSlotList *list)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__DBusDataSlot.html#gabc399733376c462c3010271a2d431e73">_dbus_data_slot_list_free</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> * </td>
<td class="paramname"><em>list</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees the data slot list and all data slots contained in it, calling application-provided free functions if they exist. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">list</td><td>the list to free </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00340">340</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8c_source.html#l00317">_dbus_data_slot_list_clear()</a>, <a class="el" href="dbus-memory_8c_source.html#l00701">dbus_free()</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00072">DBusDataSlotList::n_slots</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-dataslot_8h_source.html#l00071">DBusDataSlotList::slots</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="ga43f741229f0c38788442601e2750ec66"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_list_get" ref="ga43f741229f0c38788442601e2750ec66" args="(DBusDataSlotAllocator *allocator, DBusDataSlotList *list, int slot)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* <a class="el" href="group__DBusDataSlot.html#ga43f741229f0c38788442601e2750ec66">_dbus_data_slot_list_get</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> * </td>
<td class="paramname"><em>allocator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> * </td>
<td class="paramname"><em>list</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>slot</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Retrieves data previously set with _dbus_data_slot_list_set_data(). </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">allocator</td><td>the allocator slot was allocated from </td></tr>
<tr><td class="paramname">list</td><td>the data slot list </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-dataslot_8c_source.html#l00285">285</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00057">DBusDataSlotAllocator::allocated_slots</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00038">data</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00060">DBusDataSlotAllocator::lock</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00072">DBusDataSlotList::n_slots</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00048">DBusAllocatedSlot::slot_id</a>, and <a class="el" href="dbus-dataslot_8h_source.html#l00071">DBusDataSlotList::slots</a>.</p>
<p>Referenced by <a class="el" href="dbus-connection_8c_source.html#l06017">dbus_connection_get_data()</a>, <a class="el" href="dbus-message_8c_source.html#l04635">dbus_message_get_data()</a>, <a class="el" href="dbus-pending-call_8c_source.html#l00827">dbus_pending_call_get_data()</a>, and <a class="el" href="dbus-server_8c_source.html#l01159">dbus_server_get_data()</a>.</p>
</div>
</div>
<a class="anchor" id="ga6de49b3a1210202215d40a5a19806992"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_list_init" ref="ga6de49b3a1210202215d40a5a19806992" args="(DBusDataSlotList *list)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__DBusDataSlot.html#ga6de49b3a1210202215d40a5a19806992">_dbus_data_slot_list_init</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> * </td>
<td class="paramname"><em>list</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a slot list. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">list</td><td>the list to initialize. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00197">197</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00072">DBusDataSlotList::n_slots</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="dbus-dataslot_8h_source.html#l00071">DBusDataSlotList::slots</a>.</p>
<p>Referenced by <a class="el" href="dbus-connection_8c_source.html#l01249">_dbus_connection_new_for_transport()</a>, <a class="el" href="dbus-pending-call_8c_source.html#l00109">_dbus_pending_call_new_unlocked()</a>, and <a class="el" href="dbus-server_8c_source.html#l00111">_dbus_server_init_base()</a>.</p>
</div>
</div>
<a class="anchor" id="gad2952f9f686d96e7114fc49ab7452e1a"></a><!-- doxytag: member="dbus-dataslot.c::_dbus_data_slot_list_set" ref="gad2952f9f686d96e7114fc49ab7452e1a" args="(DBusDataSlotAllocator *allocator, DBusDataSlotList *list, int slot, void *data, DBusFreeFunction free_data_func, DBusFreeFunction *old_free_func, void **old_data)" -->
<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__DBusDataSlot.html#gad2952f9f686d96e7114fc49ab7452e1a">_dbus_data_slot_list_set</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structDBusDataSlotAllocator.html">DBusDataSlotAllocator</a> * </td>
<td class="paramname"><em>allocator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structDBusDataSlotList.html">DBusDataSlotList</a> * </td>
<td class="paramname"><em>list</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>slot</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_func</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>old_free_func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void ** </td>
<td class="paramname"><em>old_data</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Stores a pointer in the data slot list, along with an optional function to be used for freeing the data when the data is set again, or when the slot list is finalized. </p>
<p>The slot number must have been allocated with <a class="el" href="group__DBusDataSlot.html#gaf61f2bd0148bace4f67a2d6d97b26ea9" title="Allocates an integer ID to be used for storing data in a DBusDataSlotList.">_dbus_data_slot_allocator_alloc()</a> for the same allocator passed in here. The same allocator has to be used with the slot list every time.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">allocator</td><td>the allocator to use </td></tr>
<tr><td class="paramname">list</td><td>the data slot list </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>
<tr><td class="paramname">old_free_func</td><td>free function for any previously-existing data </td></tr>
<tr><td class="paramname">old_data</td><td>previously-existing data, should be freed with old_free_func </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 there was enough memory to store the data </dd></dl>
<p>Definition at line <a class="el" href="dbus-dataslot_8c_source.html#l00221">221</a> of file <a class="el" href="dbus-dataslot_8c_source.html">dbus-dataslot.c</a>.</p>
<p>References <a class="el" href="dbus-dataslot_8h_source.html#l00057">DBusDataSlotAllocator::allocated_slots</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00038">data</a>, <a class="el" href="dbus-memory_8c_source.html#l00601">dbus_realloc()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00039">free_data_func</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00060">DBusDataSlotAllocator::lock</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00072">DBusDataSlotList::n_slots</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00048">DBusAllocatedSlot::slot_id</a>, <a class="el" href="dbus-dataslot_8h_source.html#l00071">DBusDataSlotList::slots</a>, and <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.</p>
<p>Referenced by <a class="el" href="dbus-pending-call_8c_source.html#l00502">_dbus_pending_call_set_data_unlocked()</a>, <a class="el" href="dbus-connection_8c_source.html#l05968">dbus_connection_set_data()</a>, <a class="el" href="dbus-message_8c_source.html#l04599">dbus_message_set_data()</a>, and <a class="el" href="dbus-server_8c_source.html#l01119">dbus_server_set_data()</a>.</p>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:32 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>