<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<refentry id="AsCacheBuilder">
<refmeta>
<refentrytitle role="top_of_page" id="AsCacheBuilder.top_of_page">AsCacheBuilder</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>APPSTREAM Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>AsCacheBuilder</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsect1 id="AsCacheBuilder.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="AS-TYPE-CACHE-BUILDER:CAPS">AS_TYPE_CACHE_BUILDER</link></entry></row>
<row><entry role="function_type"><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-cache-builder-error-quark">as_cache_builder_error_quark</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="AsCacheBuilder"><returnvalue>AsCacheBuilder</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-cache-builder-new">as_cache_builder_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-cache-builder-setup">as_cache_builder_setup</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-cache-builder-refresh">as_cache_builder_refresh</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-cache-builder-set-data-source-directories">as_cache_builder_set_data_source_directories</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsCacheBuilder.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="AsCacheBuilderClass">AsCacheBuilderClass</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="AS-CACHE-BUILDER-ERROR:CAPS">AS_CACHE_BUILDER_ERROR</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="AsCacheBuilderError">AsCacheBuilderError</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="AsCacheBuilder-struct">AsCacheBuilder</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsCacheBuilder.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> AsCacheBuilder
</screen>
</refsect1>


<refsect1 id="AsCacheBuilder.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>

</refsect1>
<refsect1 id="AsCacheBuilder.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="AS-TYPE-CACHE-BUILDER:CAPS" role="macro">
<title>AS_TYPE_CACHE_BUILDER</title>
<indexterm zone="AS-TYPE-CACHE-BUILDER:CAPS"><primary>AS_TYPE_CACHE_BUILDER</primary></indexterm>
<programlisting language="C">#define AS_TYPE_CACHE_BUILDER (as_cache_builder_get_type ())
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="as-cache-builder-error-quark" role="function">
<title>as_cache_builder_error_quark&#160;()</title>
<indexterm zone="as-cache-builder-error-quark"><primary>as_cache_builder_error_quark</primary></indexterm>
<programlisting language="C"><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>
as_cache_builder_error_quark (<parameter><type>void</type></parameter>);</programlisting>
<refsect3 role="returns">
<title>Returns</title>
<para> An error quark.</para>
</refsect3></refsect2>
<refsect2 id="as-cache-builder-new" role="function">
<title>as_cache_builder_new&#160;()</title>
<indexterm zone="as-cache-builder-new"><primary>as_cache_builder_new</primary></indexterm>
<programlisting language="C"><link linkend="AsCacheBuilder"><returnvalue>AsCacheBuilder</returnvalue></link>&#160;*
as_cache_builder_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link>.</para>
<refsect3 role="returns">
<title>Returns</title>
<para> a new <link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-cache-builder-setup" role="function">
<title>as_cache_builder_setup&#160;()</title>
<indexterm zone="as-cache-builder-setup"><primary>as_cache_builder_setup</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_cache_builder_setup (<parameter><link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link> *builder</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *dbpath</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Initialize the cache builder.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dbpath</para></entry>
<entry role="parameter_description"><para> Path to the database directory, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to use default. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>default</acronym> NULL]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-cache-builder-refresh" role="function">
<title>as_cache_builder_refresh&#160;()</title>
<indexterm zone="as-cache-builder-refresh"><primary>as_cache_builder_refresh</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_cache_builder_refresh (<parameter><link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link> *builder</parameter>,
                          <parameter><link linkend="gboolean"><type>gboolean</type></link> force</parameter>,
                          <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Update the AppStream Xapian cache.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>force</para></entry>
<entry role="parameter_description"><para>Enforce refresh, even if source data has not changed.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the cache was updated, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on error or if the cache update was not necessary and has been skipped.</para>
</refsect3></refsect2>
<refsect2 id="as-cache-builder-set-data-source-directories" role="function">
<title>as_cache_builder_set_data_source_directories&#160;()</title>
<indexterm zone="as-cache-builder-set-data-source-directories"><primary>as_cache_builder_set_data_source_directories</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_cache_builder_set_data_source_directories
                               (<parameter><link linkend="AsCacheBuilder"><type>AsCacheBuilder</type></link> *self</parameter>,
                                <parameter><link linkend="gchar"><type>gchar</type></link> **dirs</parameter>);</programlisting>
<para>Set locations for the database builder to pull it's data from.
This is mainly used for testing purposes. Each location should have an
"xmls" and/or "yaml" subdirectory with the actual data as (compressed)
AppStream XML or DEP-11 YAML in it.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>dirs</para></entry>
<entry role="parameter_description"><para> a zero-terminated array of data input directories. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="AsCacheBuilder.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="AsCacheBuilderClass" role="struct">
<title>struct AsCacheBuilderClass</title>
<indexterm zone="AsCacheBuilderClass"><primary>AsCacheBuilderClass</primary></indexterm>
<programlisting language="C">struct AsCacheBuilderClass {
	GObjectClass parent_class;
};
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="AS-CACHE-BUILDER-ERROR:CAPS" role="macro">
<title>AS_CACHE_BUILDER_ERROR</title>
<indexterm zone="AS-CACHE-BUILDER-ERROR:CAPS"><primary>AS_CACHE_BUILDER_ERROR</primary></indexterm>
<programlisting language="C">#define&#160;AS_CACHE_BUILDER_ERROR as_cache_builder_error_quark ()
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="AsCacheBuilderError" role="enum">
<title>enum AsCacheBuilderError</title>
<indexterm zone="AsCacheBuilderError"><primary>AsCacheBuilderError</primary></indexterm>
<para>The error type.</para>
<refsect3 role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="AS-CACHE-BUILDER-ERROR-FAILED:CAPS">AS_CACHE_BUILDER_ERROR_FAILED</para></entry>
<entry role="enum_member_description"><para>Generic failure</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="AS-CACHE-BUILDER-ERROR-CACHE-INCOMPLETE:CAPS">AS_CACHE_BUILDER_ERROR_CACHE_INCOMPLETE</para></entry>
<entry role="enum_member_description"><para>The cache was built, but we had to ignore some metadata.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="AS-CACHE-BUILDER-ERROR-TARGET-NOT-WRITABLE:CAPS">AS_CACHE_BUILDER_ERROR_TARGET_NOT_WRITABLE</para></entry>
<entry role="enum_member_description"><para>We do not have write-access to the cache target location.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="AsCacheBuilder-struct" role="struct">
<title>AsCacheBuilder</title>
<indexterm zone="AsCacheBuilder-struct"><primary>AsCacheBuilder</primary></indexterm>
<programlisting language="C">typedef struct _AsCacheBuilder AsCacheBuilder;</programlisting>
<para>
</para>
</refsect2>

</refsect1>

</refentry>
