403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/gtk-doc/html/glib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/gtk-doc/html/glib/glib-Caches.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Caches</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-Relations-and-Tuples.html" title="Relations and Tuples">
<link rel="next" href="glib-Memory-Allocators.html" title="Memory Allocators">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
<link rel="index" href="ix12.html" title="Index of new symbols in 2.20">
<link rel="index" href="ix13.html" title="Index of new symbols in 2.22">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Relations-and-Tuples.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Memory-Allocators.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-Caches.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#glib-Caches.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Caches">
<a name="glib-Caches"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-Caches.top_of_page"></a>Caches</span></h2>
<p>Caches — caches allow sharing of complex data structures to save resources</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="glib-Caches.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;

                    <a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a>;
<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a>*             <a class="link" href="glib-Caches.html#g-cache-new" title="g_cache_new ()">g_cache_new</a>                         (<a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()">GCacheNewFunc</a> value_new_func,
                                                         <a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()">GCacheDestroyFunc</a> value_destroy_func,
                                                         <a class="link" href="glib-Caches.html#GCacheDupFunc" title="GCacheDupFunc ()">GCacheDupFunc</a> key_dup_func,
                                                         <a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()">GCacheDestroyFunc</a> key_destroy_func,
                                                         <a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">GHashFunc</a> hash_key_func,
                                                         <a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">GHashFunc</a> hash_value_func,
                                                         <a class="link" href="glib-Hash-Tables.html#GEqualFunc" title="GEqualFunc ()">GEqualFunc</a> key_equal_func);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Caches.html#g-cache-insert" title="g_cache_insert ()">g_cache_insert</a>                      (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key);
void                <a class="link" href="glib-Caches.html#g-cache-remove" title="g_cache_remove ()">g_cache_remove</a>                      (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> value);
void                <a class="link" href="glib-Caches.html#g-cache-destroy" title="g_cache_destroy ()">g_cache_destroy</a>                     (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache);

void                <a class="link" href="glib-Caches.html#g-cache-key-foreach" title="g_cache_key_foreach ()">g_cache_key_foreach</a>                 (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()">GHFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
void                <a class="link" href="glib-Caches.html#g-cache-value-foreach" title="g_cache_value_foreach ()">g_cache_value_foreach</a>               (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()">GHFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);

void                (<a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()">*GCacheDestroyFunc</a>)                (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            (<a class="link" href="glib-Caches.html#GCacheDupFunc" title="GCacheDupFunc ()">*GCacheDupFunc</a>)                    (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            (<a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()">*GCacheNewFunc</a>)                    (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="glib-Caches.description"></a><h2>Description</h2>
<p>
A <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> allows sharing of complex data structures, in order to save
system resources.
</p>
<p>
GTK+ uses caches for <span class="type">GtkStyles</span> and <span class="type">GdkGCs</span>. These consume a lot of
resources, so a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> is used to see if a <a
href="http://library.gnome.org/devel/gtk/unstable/GtkStyle.html"
><span class="type">GtkStyle</span></a> or <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Graphics-Contexts.html#GdkGC"
><span class="type">GdkGC</span></a> with the
required properties already exists. If it does, then the existing
object is used instead of creating a new one.
</p>
<p>
<a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> uses keys and values.
A <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> key describes the properties of a particular resource.
A <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value is the actual resource.
</p>
</div>
<div class="refsect1" title="Details">
<a name="glib-Caches.details"></a><h2>Details</h2>
<div class="refsect2" title="GCache">
<a name="GCache"></a><h3>GCache</h3>
<pre class="programlisting">typedef struct _GCache GCache;</pre>
<p>
The <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> struct is an opaque data structure containing information about
a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>. It should only be accessed via the following functions.
</p>
</div>
<hr>
<div class="refsect2" title="g_cache_new ()">
<a name="g-cache-new"></a><h3>g_cache_new ()</h3>
<pre class="programlisting"><a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a>*             g_cache_new                         (<a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()">GCacheNewFunc</a> value_new_func,
                                                         <a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()">GCacheDestroyFunc</a> value_destroy_func,
                                                         <a class="link" href="glib-Caches.html#GCacheDupFunc" title="GCacheDupFunc ()">GCacheDupFunc</a> key_dup_func,
                                                         <a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()">GCacheDestroyFunc</a> key_destroy_func,
                                                         <a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">GHashFunc</a> hash_key_func,
                                                         <a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">GHashFunc</a> hash_value_func,
                                                         <a class="link" href="glib-Hash-Tables.html#GEqualFunc" title="GEqualFunc ()">GEqualFunc</a> key_equal_func);</pre>
<p>
Creates a new <a class="link" href="glib-Caches.html#GCache" title="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>value_new_func</code></em> :</span></p></td>
<td>a function to create a new object given a key.
This is called by <a class="link" href="glib-Caches.html#g-cache-insert" title="g_cache_insert ()"><code class="function">g_cache_insert()</code></a> if an object with the given key
does not already exist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value_destroy_func</code></em> :</span></p></td>
<td>a function to destroy an object. It is
called by <a class="link" href="glib-Caches.html#g-cache-remove" title="g_cache_remove ()"><code class="function">g_cache_remove()</code></a> when the object is no longer needed (i.e. its
reference count drops to 0).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_dup_func</code></em> :</span></p></td>
<td>a function to copy a key. It is called by
<a class="link" href="glib-Caches.html#g-cache-insert" title="g_cache_insert ()"><code class="function">g_cache_insert()</code></a> if the key does not already exist in the <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_destroy_func</code></em> :</span></p></td>
<td>a function to destroy a key. It is
called by <a class="link" href="glib-Caches.html#g-cache-remove" title="g_cache_remove ()"><code class="function">g_cache_remove()</code></a> when the object is no longer needed (i.e. its
reference count drops to 0).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hash_key_func</code></em> :</span></p></td>
<td>a function to create a hash value from a key.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hash_value_func</code></em> :</span></p></td>
<td>a function to create a hash value from a value.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_equal_func</code></em> :</span></p></td>
<td>a function to compare two keys. It should return <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if
the two keys are equivalent.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_cache_insert ()">
<a name="g-cache-insert"></a><h3>g_cache_insert ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_cache_insert                      (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key);</pre>
<p>
Gets the value corresponding to the given key, creating it if necessary.
It first checks if the value already exists in the <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>, by using
the <em class="parameter"><code>key_equal_func</code></em> function passed to <a class="link" href="glib-Caches.html#g-cache-new" title="g_cache_new ()"><code class="function">g_cache_new()</code></a>.
If it does already exist it is returned, and its reference count is increased
by one.
If the value does not currently exist, if is created by calling the
<em class="parameter"><code>value_new_func</code></em>. The key is duplicated by calling
<em class="parameter"><code>key_dup_func</code></em> and the duplicated key and value are inserted
into the <a class="link" href="glib-Caches.html#GCache" title="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> :</span></p></td>
<td>a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
<td>a key describing a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer to a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_cache_remove ()">
<a name="g-cache-remove"></a><h3>g_cache_remove ()</h3>
<pre class="programlisting">void                g_cache_remove                      (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="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" title="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> :</span></p></td>
<td>a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>the value to remove.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_cache_destroy ()">
<a name="g-cache-destroy"></a><h3>g_cache_destroy ()</h3>
<pre class="programlisting">void                g_cache_destroy                     (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache);</pre>
<p>
Frees the memory allocated for the <a class="link" href="glib-Caches.html#GCache" title="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" title="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> :</span></p></td>
<td>a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_cache_key_foreach ()">
<a name="g-cache-key-foreach"></a><h3>g_cache_key_foreach ()</h3>
<pre class="programlisting">void                g_cache_key_foreach                 (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()">GHFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="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" title="GCache"><span class="type">GCache</span></a>.
</p>
<div class="note" title="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 a
cache entry and the <em class="parameter"><code>user_data</code></em>. The order of value and key is different
from the order in which <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()"><code class="function">g_hash_table_foreach()</code></a> passes key-value pairs
to 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> :</span></p></td>
<td>a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function to call with each <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> key.
</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" title="g_cache_value_foreach ()">
<a name="g-cache-value-foreach"></a><h3>g_cache_value_foreach ()</h3>
<pre class="programlisting">void                g_cache_value_foreach               (<a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a> *cache,
                                                         <a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()">GHFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
<div class="warning" title="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" title="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" title="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> :</span></p></td>
<td>a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function to call with each <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value.
</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" title="GCacheDestroyFunc ()">
<a name="GCacheDestroyFunc"></a><h3>GCacheDestroyFunc ()</h3>
<pre class="programlisting">void                (*GCacheDestroyFunc)                (<a class="link" href="glib-Basic-Types.html#gpointer" title="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> functions
passed to <a class="link" href="glib-Caches.html#g-cache-new" title="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" title="GCache"><span class="type">GCache</span></a> key or <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value and
should 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> :</span></p></td>
<td>the <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value to destroy.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GCacheDupFunc ()">
<a name="GCacheDupFunc"></a><h3>GCacheDupFunc ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            (*GCacheDupFunc)                    (<a class="link" href="glib-Basic-Types.html#gpointer" title="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" title="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) and
should 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> :</span></p></td>
<td>the <a class="link" href="glib-Caches.html#GCache" title="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" title="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> :</span></p></td>
<td>a copy of the <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> key.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GCacheNewFunc ()">
<a name="GCacheNewFunc"></a><h3>GCacheNewFunc ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            (*GCacheNewFunc)                    (<a class="link" href="glib-Basic-Types.html#gpointer" title="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" title="g_cache_new ()"><code class="function">g_cache_new()</code></a>.
It is passed a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> key and should create the value corresponding to 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>key</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> key.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value corresponding to the key.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit