⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glib-datasets.html

📁 glid编写实例
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<tbody><tr><td><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></td><td>the <a href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> ID identifying the data element.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td>the data previously stored at <em class="parameter"><code>key_id</code></em>, or <code class="literal">NULL</code> if none.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3196365"></a><h3><a name="g-dataset-set-data"></a>g_dataset_set_data()</h3><a class="indexterm" name="id3196376"></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><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></td><td>the string to identify the data element.</td></tr><tr><td><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></td><td>the data element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3196438"></a><h3><a name="g-dataset-set-data-full"></a>g_dataset_set_data_full()</h3><a class="indexterm" name="id3196449"></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><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></td><td>the string to identify the data element.</td></tr><tr><td><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></td><td>the data element.</td></tr><tr><td><span class="term"><em class="parameter"><code>f</code></em>&#160;:</span></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="id3196529"></a><h3><a name="g-dataset-get-data"></a>g_dataset_get_data()</h3><a class="indexterm" name="id3196540"></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><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></td><td>the string identifying the data element.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td>the data element corresponding to the string, or <code class="literal">NULL</code> if it is notfound.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3196605"></a><h3><a name="g-dataset-remove-data"></a>g_dataset_remove_data()</h3><a class="indexterm" name="id3196616"></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><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></td><td>the string identifying the data element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3196666"></a><h3><a name="g-dataset-remove-no-notify"></a>g_dataset_remove_no_notify()</h3><a class="indexterm" name="id3196678"></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><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></td><td>the string identifying the data element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3196727"></a><h3><a name="g-dataset-foreach"></a>g_dataset_foreach ()</h3><a class="indexterm" name="id3196738"></a><pre class="programlisting">void        g_dataset_foreach               (<a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,                                             <a href="glib-Datasets.html#GDataForeachFunc">GDataForeachFunc</a> func,                                             <a 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.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr><tr><td><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></td><td>the function to call for each data element.</td></tr><tr><td><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td><td>user data to pass to the function.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3196831"></a><h3><a name="GDataForeachFunc"></a>GDataForeachFunc ()</h3><a class="indexterm" name="id3196841"></a><pre class="programlisting">void        (*GDataForeachFunc)             (<a href="glib-Quarks.html#GQuark">GQuark</a> key_id,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> data,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Specifies the type of function passed to <a href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.It is called with each <a 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 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><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></td><td>the <a href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identifying the data element.</td></tr><tr><td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td><td>the data element.</td></tr><tr><td><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td><td>user data passed to <a 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="id3196987"></a><h3><a name="g-dataset-destroy"></a>g_dataset_destroy ()</h3><a class="indexterm" name="id3196998"></a><pre class="programlisting">void        g_dataset_destroy               (<a 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><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></td><td>the location identifying the dataset.</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="glib-Keyed-Data-Lists.html"><b>&lt;&lt;&#160;Keyed Data Lists</b></a></td><td align="right"><a accesskey="n" href="glib-Relations-and-Tuples.html"><b>Relations and Tuples&#160;&gt;&gt;</b></a></td></tr></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -