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

<refnamediv>
<refname>CamelMimeFilter</refname>
<refpurpose></refpurpose>
</refnamediv>

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

<synopsis>
struct              <link linkend="CamelMimeFilter">CamelMimeFilter</link>;
<link linkend="CamelMimeFilter">CamelMimeFilter</link> *   <link linkend="camel-mime-filter-new">camel_mime_filter_new</link>               (void);
<link linkend="void">void</link>                <link linkend="camel-mime-filter-filter">camel_mime_filter_filter</link>            (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         <link linkend="char">char</link> *in,
                                                         <link linkend="size-t">size_t</link> len,
                                                         <link linkend="size-t">size_t</link> prespace,
                                                         <link linkend="char">char</link> **out,
                                                         <link linkend="size-t">size_t</link> *outlen,
                                                         <link linkend="size-t">size_t</link> *outprespace);
<link linkend="void">void</link>                <link linkend="camel-mime-filter-complete">camel_mime_filter_complete</link>          (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         <link linkend="char">char</link> *in,
                                                         <link linkend="size-t">size_t</link> len,
                                                         <link linkend="size-t">size_t</link> prespace,
                                                         <link linkend="char">char</link> **out,
                                                         <link linkend="size-t">size_t</link> *outlen,
                                                         <link linkend="size-t">size_t</link> *outprespace);
<link linkend="void">void</link>                <link linkend="camel-mime-filter-reset">camel_mime_filter_reset</link>             (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter);
<link linkend="void">void</link>                <link linkend="camel-mime-filter-backup">camel_mime_filter_backup</link>            (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         const <link linkend="char">char</link> *data,
                                                         <link linkend="size-t">size_t</link> length);
<link linkend="void">void</link>                <link linkend="camel-mime-filter-set-size">camel_mime_filter_set_size</link>          (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         <link linkend="size-t">size_t</link> size,
                                                         <link linkend="int">int</link> keep);
</synopsis>
</refsynopsisdiv>









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

<refsect1 id="camel-CamelMimeFilter.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelMimeFilter" role="struct">
<title>struct CamelMimeFilter</title>
<indexterm zone="CamelMimeFilter"><primary sortas="CamelMimeFilter">CamelMimeFilter</primary></indexterm><programlisting>struct CamelMimeFilter {
	CamelObject parent;

	struct _CamelMimeFilterPrivate *priv;

	char *outreal;		/* real malloc'd buffer */
	char *outbuf;		/* first 'writable' position allowed (outreal + outpre) */
	char *outptr;
	size_t outsize;
	size_t outpre;		/* prespace of this buffer */

	char *backbuf;
	size_t backsize;
	size_t backlen;		/* significant data there */
};
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-mime-filter-new" role="function">
<title>camel_mime_filter_new ()</title>
<indexterm zone="camel-mime-filter-new"><primary sortas="camel_mime_filter_new">camel_mime_filter_new</primary></indexterm><programlisting><link linkend="CamelMimeFilter">CamelMimeFilter</link> *   camel_mime_filter_new               (void);</programlisting>
<para>
Create a new <link linkend="CamelMimeFilter"><type>CamelMimeFilter</type></link> object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="CamelMimeFilter"><type>CamelMimeFilter</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-mime-filter-filter" role="function">
<title>camel_mime_filter_filter ()</title>
<indexterm zone="camel-mime-filter-filter"><primary sortas="camel_mime_filter_filter">camel_mime_filter_filter</primary></indexterm><programlisting><link linkend="void">void</link>                camel_mime_filter_filter            (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         <link linkend="char">char</link> *in,
                                                         <link linkend="size-t">size_t</link> len,
                                                         <link linkend="size-t">size_t</link> prespace,
                                                         <link linkend="char">char</link> **out,
                                                         <link linkend="size-t">size_t</link> *outlen,
                                                         <link linkend="size-t">size_t</link> *outprespace);</programlisting>
<para>
Passes the input buffer, <parameter>in</parameter>, through <parameter>filter</parameter> and generates an
output buffer, <parameter>out</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimeFilter"><type>CamelMimeFilter</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>in</parameter>&#160;:</term>
<listitem><simpara> input buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>in</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prespace</parameter>&#160;:</term>
<listitem><simpara> amount of prespace
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>out</parameter>&#160;:</term>
<listitem><simpara> pointer to the output buffer (to be set)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outlen</parameter>&#160;:</term>
<listitem><simpara> pointer to the length of the output buffer (to be set)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outprespace</parameter>&#160;:</term>
<listitem><simpara> pointer to the output prespace length (to be set)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-mime-filter-complete" role="function">
<title>camel_mime_filter_complete ()</title>
<indexterm zone="camel-mime-filter-complete"><primary sortas="camel_mime_filter_complete">camel_mime_filter_complete</primary></indexterm><programlisting><link linkend="void">void</link>                camel_mime_filter_complete          (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         <link linkend="char">char</link> *in,
                                                         <link linkend="size-t">size_t</link> len,
                                                         <link linkend="size-t">size_t</link> prespace,
                                                         <link linkend="char">char</link> **out,
                                                         <link linkend="size-t">size_t</link> *outlen,
                                                         <link linkend="size-t">size_t</link> *outprespace);</programlisting>
<para>
Passes the input buffer, <parameter>in</parameter>, through <parameter>filter</parameter> and generates an
output buffer, <parameter>out</parameter> and makes sure that all data is flushed to the
output buffer. This must be the last filtering call made, no
further calls to <link linkend="camel-mime-filter-filter"><type>camel_mime_filter_filter</type></link> may be called on <parameter>filter</parameter>
until <parameter>filter</parameter> has been reset using <link linkend="camel-mime-filter-reset"><type>camel_mime_filter_reset</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimeFilter"><type>CamelMimeFilter</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>in</parameter>&#160;:</term>
<listitem><simpara> input buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>in</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prespace</parameter>&#160;:</term>
<listitem><simpara> amount of prespace
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>out</parameter>&#160;:</term>
<listitem><simpara> pointer to the output buffer (to be set)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outlen</parameter>&#160;:</term>
<listitem><simpara> pointer to the length of the output buffer (to be set)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>outprespace</parameter>&#160;:</term>
<listitem><simpara> pointer to the output prespace length (to be set)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-mime-filter-reset" role="function">
<title>camel_mime_filter_reset ()</title>
<indexterm zone="camel-mime-filter-reset"><primary sortas="camel_mime_filter_reset">camel_mime_filter_reset</primary></indexterm><programlisting><link linkend="void">void</link>                camel_mime_filter_reset             (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter);</programlisting>
<para>
Resets the state on <parameter>filter</parameter> so that it may be used again.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMimeFilter"><type>CamelMimeFilter</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-mime-filter-backup" role="function">
<title>camel_mime_filter_backup ()</title>
<indexterm zone="camel-mime-filter-backup"><primary sortas="camel_mime_filter_backup">camel_mime_filter_backup</primary></indexterm><programlisting><link linkend="void">void</link>                camel_mime_filter_backup            (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         const <link linkend="char">char</link> *data,
                                                         <link linkend="size-t">size_t</link> length);</programlisting>
<para>
Saves <parameter>data</parameter> to be used as prespace input data to the next call to
<link linkend="camel-mime-filter-filter"><type>camel_mime_filter_filter</type></link> or <link linkend="camel-mime-filter-complete"><type>camel_mime_filter_complete</type></link>.
</para>
<para>
Note: New calls replace old data.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="camelMimeFilter"><type>camelMimeFilter</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data buffer 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="camel-mime-filter-set-size" role="function">
<title>camel_mime_filter_set_size ()</title>
<indexterm zone="camel-mime-filter-set-size"><primary sortas="camel_mime_filter_set_size">camel_mime_filter_set_size</primary></indexterm><programlisting><link linkend="void">void</link>                camel_mime_filter_set_size          (<link linkend="CamelMimeFilter">CamelMimeFilter</link> *filter,
                                                         <link linkend="size-t">size_t</link> size,
                                                         <link linkend="int">int</link> keep);</programlisting>
<para>
Ensure that <parameter>filter</parameter> has enough storage space to store <parameter>size</parameter> bytes
for filter output.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="camelMimeFilter"><type>camelMimeFilter</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara> requested amount of storage space
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keep</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to keep existing buffered data or <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
