<refentry id="camel-camel-uid-cache">
<refmeta>
<refentrytitle role="top_of_page" id="camel-camel-uid-cache.top_of_page">camel-uid-cache</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAMEL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>camel-uid-cache</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="camel-camel-uid-cache.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
                    <link linkend="CamelUIDCache">CamelUIDCache</link>;
<link linkend="CamelUIDCache">CamelUIDCache</link> *     <link linkend="camel-uid-cache-new">camel_uid_cache_new</link>                 (const <link linkend="char">char</link> *filename);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-uid-cache-save">camel_uid_cache_save</link>                (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache);
<link linkend="void">void</link>                <link linkend="camel-uid-cache-destroy">camel_uid_cache_destroy</link>             (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache);
<link linkend="GPtrArray">GPtrArray</link> *         <link linkend="camel-uid-cache-get-new-uids">camel_uid_cache_get_new_uids</link>        (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache,
                                                         <link linkend="GPtrArray">GPtrArray</link> *uids);
<link linkend="void">void</link>                <link linkend="camel-uid-cache-save-uid">camel_uid_cache_save_uid</link>            (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);
<link linkend="void">void</link>                <link linkend="camel-uid-cache-free-uids">camel_uid_cache_free_uids</link>           (<link linkend="GPtrArray">GPtrArray</link> *uids);
</synopsis>
</refsynopsisdiv>









<refsect1 id="camel-camel-uid-cache.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="camel-camel-uid-cache.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelUIDCache" role="struct">
<title>CamelUIDCache</title>
<indexterm zone="CamelUIDCache"><primary sortas="CamelUIDCache">CamelUIDCache</primary></indexterm><programlisting>typedef struct {
	char *filename;
	GHashTable *uids;
	unsigned int level;
	size_t expired;
	size_t size;
	int fd;
} CamelUIDCache;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-uid-cache-new" role="function">
<title>camel_uid_cache_new ()</title>
<indexterm zone="camel-uid-cache-new"><primary sortas="camel_uid_cache_new">camel_uid_cache_new</primary></indexterm><programlisting><link linkend="CamelUIDCache">CamelUIDCache</link> *     camel_uid_cache_new                 (const <link linkend="char">char</link> *filename);</programlisting>
<para>
Creates a new UID cache, initialized from <parameter>filename</parameter>. If <parameter>filename</parameter>
doesn't already exist, the UID cache will be empty. Otherwise, if
it does exist but can't be read, the function will return <link linkend="NULL--CAPS"><literal>NULL</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> path to load the cache from
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new UID cache, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-uid-cache-save" role="function">
<title>camel_uid_cache_save ()</title>
<indexterm zone="camel-uid-cache-save"><primary sortas="camel_uid_cache_save">camel_uid_cache_save</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_uid_cache_save                (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache);</programlisting>
<para>
Attempts to save <parameter>cache</parameter> back to disk.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> a CamelUIDCache
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> success or failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-uid-cache-destroy" role="function">
<title>camel_uid_cache_destroy ()</title>
<indexterm zone="camel-uid-cache-destroy"><primary sortas="camel_uid_cache_destroy">camel_uid_cache_destroy</primary></indexterm><programlisting><link linkend="void">void</link>                camel_uid_cache_destroy             (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache);</programlisting>
<para>
Destroys <parameter>cache</parameter> and frees its data.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> a CamelUIDCache
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-uid-cache-get-new-uids" role="function">
<title>camel_uid_cache_get_new_uids ()</title>
<indexterm zone="camel-uid-cache-get-new-uids"><primary sortas="camel_uid_cache_get_new_uids">camel_uid_cache_get_new_uids</primary></indexterm><programlisting><link linkend="GPtrArray">GPtrArray</link> *         camel_uid_cache_get_new_uids        (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache,
                                                         <link linkend="GPtrArray">GPtrArray</link> *uids);</programlisting>
<para>
Returns an array of UIDs from <parameter>uids</parameter> that are not in <parameter>cache</parameter>, and
removes UIDs from <parameter>cache</parameter> that aren't in <parameter>uids</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> a CamelUIDCache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uids</parameter>&#160;:</term>
<listitem><simpara> an array of UIDs
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an array of new UIDs, which must be freed with
<link linkend="camel-uid-cache-free-uids"><function>camel_uid_cache_free_uids()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-uid-cache-save-uid" role="function">
<title>camel_uid_cache_save_uid ()</title>
<indexterm zone="camel-uid-cache-save-uid"><primary sortas="camel_uid_cache_save_uid">camel_uid_cache_save_uid</primary></indexterm><programlisting><link linkend="void">void</link>                camel_uid_cache_save_uid            (<link linkend="CamelUIDCache">CamelUIDCache</link> *cache,
                                                         const <link linkend="char">char</link> *uid);</programlisting>
<para>
Marks a uid for saving.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cache</parameter>&#160;:</term>
<listitem><simpara> a CamelUIDCache
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uid</parameter>&#160;:</term>
<listitem><simpara> a uid to save
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-uid-cache-free-uids" role="function">
<title>camel_uid_cache_free_uids ()</title>
<indexterm zone="camel-uid-cache-free-uids"><primary sortas="camel_uid_cache_free_uids">camel_uid_cache_free_uids</primary></indexterm><programlisting><link linkend="void">void</link>                camel_uid_cache_free_uids           (<link linkend="GPtrArray">GPtrArray</link> *uids);</programlisting>
<para>
Frees the array of UIDs.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>uids</parameter>&#160;:</term>
<listitem><simpara> an array returned from <link linkend="camel-uid-cache-get-new-uids"><function>camel_uid_cache_get_new_uids()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
