<refentry id="GMimeFilter">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeFilter.top_of_page">GMimeFilter</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeFilter</refname>
<refpurpose>Abstract filter class</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMimeFilter.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>                    <link linkend="GMimeFilter-struct">GMimeFilter</link>;
<link linkend="GMimeFilter"><returnvalue>GMimeFilter</returnvalue></link> *       <link linkend="g-mime-filter-copy">g_mime_filter_copy</link>                  (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-filter-filter">g_mime_filter_filter</link>                (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> *inbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> inlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> prespace</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> **outbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outprespace</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-filter-complete">g_mime_filter_complete</link>              (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> *inbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> inlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> prespace</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> **outbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outprespace</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-filter-reset">g_mime_filter_reset</link>                 (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-filter-backup">g_mime_filter_backup</link>                (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *data</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> length</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-filter-set-size">g_mime_filter_set_size</link>              (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> size</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> keep</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeFilter.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GMimeFilter
         +----<link linkend="GMimeFilterBasic">GMimeFilterBasic</link>
         +----<link linkend="GMimeFilterBest">GMimeFilterBest</link>
         +----<link linkend="GMimeFilterCharset">GMimeFilterCharset</link>
         +----<link linkend="GMimeFilterCRLF">GMimeFilterCRLF</link>
         +----<link linkend="GMimeFilterEnriched">GMimeFilterEnriched</link>
         +----<link linkend="GMimeFilterFrom">GMimeFilterFrom</link>
         +----<link linkend="GMimeFilterGZip">GMimeFilterGZip</link>
         +----<link linkend="GMimeFilterHTML">GMimeFilterHTML</link>
         +----<link linkend="GMimeFilterMd5">GMimeFilterMd5</link>
         +----<link linkend="GMimeFilterStrip">GMimeFilterStrip</link>
         +----<link linkend="GMimeFilterWindows">GMimeFilterWindows</link>
         +----<link linkend="GMimeFilterYenc">GMimeFilterYenc</link>
</synopsis>
</refsect1>

<refsect1 id="GMimeFilter.description" role="desc">
<title role="desc.title">Description</title>
<para>
Stream filters are an efficient way of converting data from one
format to another.
</para>
</refsect1>
<refsect1 id="GMimeFilter.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeFilter-struct" role="struct">
<title>GMimeFilter</title>
<indexterm zone="GMimeFilter-struct"><primary>GMimeFilter</primary></indexterm>
<programlisting>typedef struct _GMimeFilter GMimeFilter;</programlisting>
<para>
Base class for filters used by <link linkend="GMimeStreamFilter"><type>GMimeStreamFilter</type></link>.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="g-mime-filter-copy" role="function">
<title>g_mime_filter_copy ()</title>
<indexterm zone="g-mime-filter-copy"><primary>g_mime_filter_copy</primary></indexterm>
<programlisting><link linkend="GMimeFilter"><returnvalue>GMimeFilter</returnvalue></link> *       g_mime_filter_copy                  (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>);</programlisting>
<para>
Copies <parameter>filter</parameter> into a new GMimeFilter object.
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara>filter
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a duplicate of <parameter>filter</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-filter-filter" role="function">
<title>g_mime_filter_filter ()</title>
<indexterm zone="g-mime-filter-filter"><primary>g_mime_filter_filter</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_filter_filter                (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> *inbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> inlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> prespace</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> **outbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outprespace</parameter>);</programlisting>
<para>
Filters the input data and writes it to <parameter>out</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara>filter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>inbuf</parameter>&#160;:</term>
<listitem><simpara>input buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>inlen</parameter>&#160;:</term>
<listitem><simpara>input buffer length
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prespace</parameter>&#160;:</term>
<listitem><simpara>prespace buffer length
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outbuf</parameter>&#160;:</term>
<listitem><simpara>pointer to output buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outlen</parameter>&#160;:</term>
<listitem><simpara>pointer to output length
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outprespace</parameter>&#160;:</term>
<listitem><simpara>pointer to output prespace buffer length
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-filter-complete" role="function">
<title>g_mime_filter_complete ()</title>
<indexterm zone="g-mime-filter-complete"><primary>g_mime_filter_complete</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_filter_complete              (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> *inbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> inlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> prespace</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> **outbuf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outlen</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> *outprespace</parameter>);</programlisting>
<para>
Completes the filtering.
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara>filter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>inbuf</parameter>&#160;:</term>
<listitem><simpara>input buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>inlen</parameter>&#160;:</term>
<listitem><simpara>input buffer length
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prespace</parameter>&#160;:</term>
<listitem><simpara>prespace buffer length
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outbuf</parameter>&#160;:</term>
<listitem><simpara>pointer to output buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outlen</parameter>&#160;:</term>
<listitem><simpara>pointer to output length
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outprespace</parameter>&#160;:</term>
<listitem><simpara>pointer to output prespace buffer length
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-filter-reset" role="function">
<title>g_mime_filter_reset ()</title>
<indexterm zone="g-mime-filter-reset"><primary>g_mime_filter_reset</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_filter_reset                 (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>);</programlisting>
<para>
Resets the filter.
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeFilter"><type>GMimeFilter</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-filter-backup" role="function">
<title>g_mime_filter_backup ()</title>
<indexterm zone="g-mime-filter-backup"><primary>g_mime_filter_backup</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_filter_backup                (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *data</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> length</parameter>);</programlisting>
<para>
Sets number of bytes backed up on the input, new calls replace
previous ones
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara>filter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to backup
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&#160;:</term>
<listitem><simpara>length of <parameter>data</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-filter-set-size" role="function">
<title>g_mime_filter_set_size ()</title>
<indexterm zone="g-mime-filter-set-size"><primary>g_mime_filter_set_size</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_filter_set_size              (<parameter><link linkend="GMimeFilter"><type>GMimeFilter</type></link> *filter</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> size</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> keep</parameter>);</programlisting>
<para>
Ensure this much size is available for filter output (if required)
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara>filter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>requested size for the output buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keep</parameter>&#160;:</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if existing data in the output buffer should be kept
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GMimeFilter.see-also">
<title>See Also</title>
<link linkend="GMimeStreamFilter"><type>GMimeStreamFilter</type></link>
</refsect1>

</refentry>
