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

<refnamediv>
<refname>camel-trie</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>
                    <link linkend="CamelTrie">CamelTrie</link>;
<link linkend="CamelTrie">CamelTrie</link>*          <link linkend="camel-trie-new">camel_trie_new</link>                      (<link linkend="gboolean">gboolean</link> icase);
<link linkend="void">void</link>                <link linkend="camel-trie-free">camel_trie_free</link>                     (<link linkend="CamelTrie">CamelTrie</link> *trie);
<link linkend="void">void</link>                <link linkend="camel-trie-add">camel_trie_add</link>                      (<link linkend="CamelTrie">CamelTrie</link> *trie,
                                                         const <link linkend="gchar">gchar</link> *pattern,
                                                         <link linkend="gint">gint</link> pattern_id);
const <link linkend="gchar">gchar</link>*        <link linkend="camel-trie-search">camel_trie_search</link>                   (<link linkend="CamelTrie">CamelTrie</link> *trie,
                                                         const <link linkend="gchar">gchar</link> *buffer,
                                                         <link linkend="gsize">gsize</link> buflen,
                                                         <link linkend="gint">gint</link> *matched_id);
</synopsis>
</refsynopsisdiv>









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

</para>
</refsect1>

<refsect1 id="camel-camel-trie.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelTrie" role="struct">
<title>CamelTrie</title>
<indexterm zone="CamelTrie"><primary>CamelTrie</primary></indexterm><programlisting>typedef struct _CamelTrie CamelTrie;</programlisting>
<para>
A trie data structure.</para>
<para>

</para></refsect2>
<refsect2 id="camel-trie-new" role="function">
<title>camel_trie_new ()</title>
<indexterm zone="camel-trie-new"><primary>camel_trie_new</primary></indexterm><programlisting><link linkend="CamelTrie">CamelTrie</link>*          camel_trie_new                      (<link linkend="gboolean">gboolean</link> icase);</programlisting>
<para>
Creates a new <link linkend="CamelTrie"><type>CamelTrie</type></link>. If <parameter>icase</parameter> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, then pattern matching
done by the CamelTrie will be case insensitive.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>icase</parameter>&nbsp;:</term>
<listitem><simpara> Case sensitivity for the <link linkend="CamelTrie"><type>CamelTrie</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The newly-created <link linkend="CamelTrie"><type>CamelTrie</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-trie-free" role="function">
<title>camel_trie_free ()</title>
<indexterm zone="camel-trie-free"><primary>camel_trie_free</primary></indexterm><programlisting><link linkend="void">void</link>                camel_trie_free                     (<link linkend="CamelTrie">CamelTrie</link> *trie);</programlisting>
<para>
Frees the memory associated with the <link linkend="CamelTrie"><type>CamelTrie</type></link> <parameter>trie</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>trie</parameter>&nbsp;:</term>
<listitem><simpara> The <link linkend="CamelTrie"><type>CamelTrie</type></link> to free.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-trie-add" role="function">
<title>camel_trie_add ()</title>
<indexterm zone="camel-trie-add"><primary>camel_trie_add</primary></indexterm><programlisting><link linkend="void">void</link>                camel_trie_add                      (<link linkend="CamelTrie">CamelTrie</link> *trie,
                                                         const <link linkend="gchar">gchar</link> *pattern,
                                                         <link linkend="gint">gint</link> pattern_id);</programlisting>
<para>
Add a new pattern to the <link linkend="CamelTrie"><type>CamelTrie</type></link> <parameter>trie</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>trie</parameter>&nbsp;:</term>
<listitem><simpara> The <link linkend="CamelTrie"><type>CamelTrie</type></link> to add a pattern to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pattern</parameter>&nbsp;:</term>
<listitem><simpara> The pattern to add.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pattern_id</parameter>&nbsp;:</term>
<listitem><simpara> The id to use for the pattern.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-trie-search" role="function">
<title>camel_trie_search ()</title>
<indexterm zone="camel-trie-search"><primary>camel_trie_search</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>*        camel_trie_search                   (<link linkend="CamelTrie">CamelTrie</link> *trie,
                                                         const <link linkend="gchar">gchar</link> *buffer,
                                                         <link linkend="gsize">gsize</link> buflen,
                                                         <link linkend="gint">gint</link> *matched_id);</programlisting>
<para>
Try to match the string <parameter>buffer</parameter> with a pattern in <parameter>trie</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>trie</parameter>&nbsp;:</term>
<listitem><simpara> The <link linkend="CamelTrie"><type>CamelTrie</type></link> to search in.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&nbsp;:</term>
<listitem><simpara> The string to match against a pattern in <parameter>trie</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buflen</parameter>&nbsp;:</term>
<listitem><simpara> The length of <parameter>buffer</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>matched_id</parameter>&nbsp;:</term>
<listitem><simpara> An integer address to store the matched pattern id in.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The matched pattern, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no pattern is matched.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
