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

📄 glib-caches.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3366525"></a><h3><a name="g-cache-remove"></a>g_cache_remove ()</h3><a class="indexterm" name="id3366538"></a><pre class="programlisting">void                g_cache_remove                      (<a class="link" href="glib-Caches.html#GCache">GCache</a> *cache,                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> value);</pre><p>Decreases the reference count of the given value.If it drops to 0 then the value and its corresponding key are destroyed,using the <em class="parameter"><code>value_destroy_func</code></em> and <em class="parameter"><code>key_destroy_func</code></em> passed to <a class="link" href="glib-Caches.html#g-cache-new"><code class="function">g_cache_new()</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>cache</code></em>&#160;:</span></p></td><td>a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td><td>the value to remove.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3366639"></a><h3><a name="g-cache-destroy"></a>g_cache_destroy ()</h3><a class="indexterm" name="id3366652"></a><pre class="programlisting">void                g_cache_destroy                     (<a class="link" href="glib-Caches.html#GCache">GCache</a> *cache);</pre><p>Frees the memory allocated for the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</p><p>Note that it does not destroy the keys and values which were contained in the<a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cache</code></em>&#160;:</span></p></td><td>a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3366727"></a><h3><a name="g-cache-key-foreach"></a>g_cache_key_foreach ()</h3><a class="indexterm" name="id3366741"></a><pre class="programlisting">void                g_cache_key_foreach                 (<a class="link" href="glib-Caches.html#GCache">GCache</a> *cache,                                                         <a class="link" href="glib-Hash-Tables.html#GHFunc">GHFunc</a> func,                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Calls the given function for each of the keys in the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p><em class="parameter"><code>func</code></em> is passed three parameters, the value and key of acache entry and the <em class="parameter"><code>user_data</code></em>. The order of value and key is differentfrom the order in which <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach"><code class="function">g_hash_table_foreach()</code></a> passes key-value pairsto its callback function !</p></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cache</code></em>&#160;:</span></p></td><td>a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td>the function to call with each <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> key.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</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="id3366884"></a><h3><a name="g-cache-value-foreach"></a>g_cache_value_foreach ()</h3><a class="indexterm" name="id3366899"></a><pre class="programlisting">void                g_cache_value_foreach               (<a class="link" href="glib-Caches.html#GCache">GCache</a> *cache,                                                         <a class="link" href="glib-Hash-Tables.html#GHFunc">GHFunc</a> func,                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_cache_value_foreach</code> has been deprecated since version 2.10 and should not be used in newly-written code. The reason is that it passes pointers to internal data structures to <em class="parameter"><code>func</code></em>; use <a class="link" href="glib-Caches.html#g-cache-key-foreach"><code class="function">g_cache_key_foreach()</code></a> instead</p></div><p>Calls the given function for each of the values in the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cache</code></em>&#160;:</span></p></td><td>a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td>the function to call with each <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> value.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</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="id3367045"></a><h3><a name="GCacheDestroyFunc"></a>GCacheDestroyFunc ()</h3><a class="indexterm" name="id3367058"></a><pre class="programlisting">void                (*GCacheDestroyFunc)                (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value);</pre><p>Specifies the type of the <em class="parameter"><code>value_destroy_func</code></em> and <em class="parameter"><code>key_destroy_func</code></em> functionspassed to <a class="link" href="glib-Caches.html#g-cache-new"><code class="function">g_cache_new()</code></a>.The functions are passed a pointer to the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> key or <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> value andshould free any memory and other resources associated with it.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td><td>the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> value to destroy.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3367154"></a><h3><a name="GCacheDupFunc"></a>GCacheDupFunc ()</h3><a class="indexterm" name="id3367166"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            (*GCacheDupFunc)                    (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value);</pre><p>Specifies the type of the <em class="parameter"><code>key_dup_func</code></em> function passed to <a class="link" href="glib-Caches.html#g-cache-new"><code class="function">g_cache_new()</code></a>.The function is passed a key (<span class="emphasis"><em>not</em></span> a value as the prototype implies) andshould return a duplicate of the key.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td><td>the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> key to destroy (<span class="emphasis"><em>not</em></span> a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> value as it seems).</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>a copy of the <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> key.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3367273"></a><h3><a name="GCacheNewFunc"></a>GCacheNewFunc ()</h3><a class="indexterm" name="id3367285"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            (*GCacheNewFunc)                    (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key);</pre><p>Specifies the type of the <em class="parameter"><code>value_new_func</code></em> function passed to <a class="link" href="glib-Caches.html#g-cache-new"><code class="function">g_cache_new()</code></a>.It is passed a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> key and should create the value corresponding to thekey.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>key</code></em>&#160;:</span></p></td><td>a <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> key.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>a new <a class="link" href="glib-Caches.html#GCache"><span class="type">GCache</span></a> value corresponding to the key.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3367385"></a><div class="refsect2" lang="en"><a name="id3367386"></a></div><hr><div class="refsect2" lang="en"><a name="id3367387"></a></div></div></div></body></html>

⌨️ 快捷键说明

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