📄 glib-datasets.html
字号:
<div class="refsect2" lang="en"><a name="id3358834"></a><h3><a name="g-dataset-id-remove-no-notify"></a>g_dataset_id_remove_no_notify ()</h3><a class="indexterm" name="id3358847"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> g_dataset_id_remove_no_notify (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location, <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);</pre><p>Removes an element, without calling its destroy notification function.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>dataset_location</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>key_id</code></em> :</span></p></td><td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> ID identifying the data element.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the data previously stored at <em class="parameter"><code>key_id</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3358954"></a><h3><a name="g-dataset-set-data"></a>g_dataset_set_data()</h3><a class="indexterm" name="id3358967"></a><pre class="programlisting">#define g_dataset_set_data(l, k, d)</pre><p>Sets the data corresponding to the given string identifier.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td><td>the string to identify the data element.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td><td>the data element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359029"></a><h3><a name="g-dataset-set-data-full"></a>g_dataset_set_data_full()</h3><a class="indexterm" name="id3359042"></a><pre class="programlisting">#define g_dataset_set_data_full(l, k, d, f)</pre><p>Sets the data corresponding to the given string identifier, and the functionto call when the data element is destroyed.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td><td>the string to identify the data element.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td><td>the data element.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td><td>the function to call when the data element is removed. Thisfunction will be called with the data element and can be used to free anymemory allocated for it.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359122"></a><h3><a name="g-dataset-get-data"></a>g_dataset_get_data()</h3><a class="indexterm" name="id3359136"></a><pre class="programlisting">#define g_dataset_get_data(l, k)</pre><p>Gets the data element corresponding to a string.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td><td>the string identifying the data element.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the data element corresponding to the string, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is notfound.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359206"></a><h3><a name="g-dataset-remove-data"></a>g_dataset_remove_data()</h3><a class="indexterm" name="id3359219"></a><pre class="programlisting">#define g_dataset_remove_data(l, k)</pre><p>Removes a data element corresponding to a string.Its destroy function is called if it has been set.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td><td>the string identifying the data element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359269"></a><h3><a name="g-dataset-remove-no-notify"></a>g_dataset_remove_no_notify()</h3><a class="indexterm" name="id3359283"></a><pre class="programlisting">#define g_dataset_remove_no_notify(l, k)</pre><p>Removes an element, without calling its destroy notifier.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td><td>the string identifying the data element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359332"></a><h3><a name="g-dataset-foreach"></a>g_dataset_foreach ()</h3><a class="indexterm" name="id3359345"></a><pre class="programlisting">void g_dataset_foreach (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location, <a class="link" href="glib-Datasets.html#GDataForeachFunc">GDataForeachFunc</a> func, <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Calls the given function for each data element which is associated with thegiven location.Note that this function is NOT thread-safe. So unless <em class="parameter"><code>datalist</code></em>can be protected from any modifications during invocation of thisfunction, it should not be called.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>dataset_location</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td><td>the function to call for each data element.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td><td>user data to pass to the function.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359448"></a><h3><a name="GDataForeachFunc"></a>GDataForeachFunc ()</h3><a class="indexterm" name="id3359461"></a><pre class="programlisting">void (*GDataForeachFunc) (<a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id, <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data, <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Specifies the type of function passed to <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.It is called with each <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id and associated data element,together with the <em class="parameter"><code>user_data</code></em> parameter supplied to <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>key_id</code></em> :</span></p></td><td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identifying the data element.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td>the data element.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td><td>user data passed to <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3359607"></a><h3><a name="g-dataset-destroy"></a>g_dataset_destroy ()</h3><a class="indexterm" name="id3359620"></a><pre class="programlisting">void g_dataset_destroy (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location);</pre><p>Destroys the dataset, freeing all memory allocated, and calling anydestroy functions set for data elements.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>dataset_location</code></em> :</span></p></td><td>the location identifying the dataset.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3359671"></a><div class="refsect2" lang="en"><a name="id3359672"></a></div><hr><div class="refsect2" lang="en"><a name="id3359673"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -