<refentry id="GMimeParser">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeParser.top_of_page">GMimeParser</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeParser</refname>
<refpurpose>Message and MIME part parser</refpurpose>
</refnamediv>

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

<synopsis>                    <link linkend="GMimeParser-struct">GMimeParser</link>;
<link linkend="void"><returnvalue>void</returnvalue></link>                (<link linkend="GMimeParserHeaderRegexFunc">*GMimeParserHeaderRegexFunc</link>)       (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> offset</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);
<link linkend="GMimeParser"><returnvalue>GMimeParser</returnvalue></link> *       <link linkend="g-mime-parser-new">g_mime_parser_new</link>                   (<parameter><type>void</type></parameter>);
<link linkend="GMimeParser"><returnvalue>GMimeParser</returnvalue></link> *       <link linkend="g-mime-parser-new-with-stream">g_mime_parser_new_with_stream</link>       (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-parser-init-with-stream">g_mime_parser_init_with_stream</link>      (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-parser-get-persist-stream">g_mime_parser_get_persist_stream</link>    (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-parser-set-persist-stream">g_mime_parser_set_persist_stream</link>    (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> persist</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-parser-get-scan-from">g_mime_parser_get_scan_from</link>         (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-parser-set-scan-from">g_mime_parser_set_scan_from</link>         (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> scan_from</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-parser-get-respect-content-length">g_mime_parser_get_respect_content_length</link>
                                                        (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-parser-set-respect-content-length">g_mime_parser_set_respect_content_length</link>
                                                        (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> respect_content_length</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-parser-set-header-regex">g_mime_parser_set_header_regex</link>      (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *regex</parameter>,
                                                         <parameter><link linkend="GMimeParserHeaderRegexFunc"><type>GMimeParserHeaderRegexFunc</type></link> header_cb</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-parser-tell">g_mime_parser_tell</link>                  (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-parser-eos">g_mime_parser_eos</link>                   (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       <link linkend="g-mime-parser-construct-part">g_mime_parser_construct_part</link>        (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="GMimeMessage"><returnvalue>GMimeMessage</returnvalue></link> *      <link linkend="g-mime-parser-construct-message">g_mime_parser_construct_message</link>     (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-parser-get-from">g_mime_parser_get_from</link>              (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-parser-get-from-offset">g_mime_parser_get_from_offset</link>       (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-parser-get-headers-begin">g_mime_parser_get_headers_begin</link>     (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-parser-get-headers-end">g_mime_parser_get_headers_end</link>       (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeParser.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GMimeParser
</synopsis>
</refsect1>

<refsect1 id="GMimeParser.description" role="desc">
<title role="desc.title">Description</title>
<para>
A <link linkend="GMimeParser"><type>GMimeParser</type></link> parses a stream into a <link linkend="GMimeMessage"><type>GMimeMessage</type></link> or other
<link linkend="GMimeObject"><type>GMimeObject</type></link> and can also handle parsing MBox formatted streams
into multiple <link linkend="GMimeMessage"><type>GMimeMessage</type></link> objects.
</para>
</refsect1>
<refsect1 id="GMimeParser.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeParser-struct" role="struct">
<title>GMimeParser</title>
<indexterm zone="GMimeParser-struct"><primary>GMimeParser</primary></indexterm>
<programlisting>typedef struct _GMimeParser GMimeParser;</programlisting>
<para>
A MIME parser context.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="GMimeParserHeaderRegexFunc" role="function">
<title>GMimeParserHeaderRegexFunc ()</title>
<indexterm zone="GMimeParserHeaderRegexFunc"><primary>GMimeParserHeaderRegexFunc</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                (*GMimeParserHeaderRegexFunc)       (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *header</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> offset</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>
Function signature for the callback to
<link linkend="g-mime-parser-set-header-regex"><function>g_mime_parser_set_header_regex()</function></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GMimeParser"><type>GMimeParser</type></link> object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header</parameter>&#160;:</term>
<listitem><simpara>The header field matched.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>The header field value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>offset</parameter>&#160;:</term>
<listitem><simpara>The header field offset.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>The user-supplied callback data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-new" role="function">
<title>g_mime_parser_new ()</title>
<indexterm zone="g-mime-parser-new"><primary>g_mime_parser_new</primary></indexterm>
<programlisting><link linkend="GMimeParser"><returnvalue>GMimeParser</returnvalue></link> *       g_mime_parser_new                   (<parameter><type>void</type></parameter>);</programlisting>
<para>
Creates a new parser object.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new parser object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-new-with-stream" role="function">
<title>g_mime_parser_new_with_stream ()</title>
<indexterm zone="g-mime-parser-new-with-stream"><primary>g_mime_parser_new_with_stream</primary></indexterm>
<programlisting><link linkend="GMimeParser"><returnvalue>GMimeParser</returnvalue></link> *       g_mime_parser_new_with_stream       (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Creates a new parser object preset to parse <parameter>stream</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>raw message or part stream
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new parser object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-init-with-stream" role="function">
<title>g_mime_parser_init_with_stream ()</title>
<indexterm zone="g-mime-parser-init-with-stream"><primary>g_mime_parser_init_with_stream</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_parser_init_with_stream      (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Initializes <parameter>parser</parameter> to use <parameter>stream</parameter>.
</para>
<para>
WARNING: Initializing a parser with a stream is comparable to
selling your soul (<parameter>stream</parameter>) to the devil (<parameter>parser</parameter>). You are
basically giving the parser complete control of the stream, this
means that you had better not touch the stream so long as the
parser is still using it. This means no reading, writing, seeking,
or resetting of the stream. Anything that will/could change the
current stream's offset is PROHIBITED.
</para>
<para>
It is also recommended that you not use <link linkend="g-mime-stream-tell"><function>g_mime_stream_tell()</function></link>
because it will not necessarily give you the current <parameter>parser</parameter> offset
since <parameter>parser</parameter> handles its own internal read-ahead buffer. Instead,
it is recommended that you use <link linkend="g-mime-parser-tell"><function>g_mime_parser_tell()</function></link> if you have a
reason to need the current offset of the <parameter>parser</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>raw message or part stream
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-persist-stream" role="function">
<title>g_mime_parser_get_persist_stream ()</title>
<indexterm zone="g-mime-parser-get-persist-stream"><primary>g_mime_parser_get_persist_stream</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_parser_get_persist_stream    (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets whether or not the underlying stream is persistent.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the <parameter>parser</parameter> will leave the content on disk or
<link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if it will load the content into memory.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-set-persist-stream" role="function">
<title>g_mime_parser_set_persist_stream ()</title>
<indexterm zone="g-mime-parser-set-persist-stream"><primary>g_mime_parser_set_persist_stream</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_parser_set_persist_stream    (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> persist</parameter>);</programlisting>
<para>
Sets whether or not the <parameter>parser</parameter>'s underlying stream is persistent.
</para>
<para>
If <parameter>persist</parameter> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the <parameter>parser</parameter> will attempt to construct
messages/parts whose content will remain on disk rather than being
loaded into memory so as to reduce memory usage. This is the default.
</para>
<para>
If <parameter>persist</parameter> is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, the <parameter>parser</parameter> will always load message content
into memory.
</para>
<para>
Note: This attribute only serves as a hint to the <parameter>parser</parameter>. If the
underlying stream does not support seeking, then this attribute
will be ignored.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>persist</parameter>&#160;:</term>
<listitem><simpara>persist attribute
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-scan-from" role="function">
<title>g_mime_parser_get_scan_from ()</title>
<indexterm zone="g-mime-parser-get-scan-from"><primary>g_mime_parser_get_scan_from</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_parser_get_scan_from         (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets whether or not <parameter>parser</parameter> is set to scan mbox-style From-lines.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether or not <parameter>parser</parameter> is set to scan mbox-style
From-lines.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-set-scan-from" role="function">
<title>g_mime_parser_set_scan_from ()</title>
<indexterm zone="g-mime-parser-set-scan-from"><primary>g_mime_parser_set_scan_from</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_parser_set_scan_from         (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> scan_from</parameter>);</programlisting>
<para>
Sets whether or not <parameter>parser</parameter> should scan mbox-style From-lines.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>scan_from</parameter>&#160;:</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> to scan From-lines or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-respect-content-length" role="function">
<title>g_mime_parser_get_respect_content_length ()</title>
<indexterm zone="g-mime-parser-get-respect-content-length"><primary>g_mime_parser_get_respect_content_length</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_parser_get_respect_content_length
                                                        (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets whether or not <parameter>parser</parameter> is set to use Content-Length for
determining the offset of the end of the message.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether or not <parameter>parser</parameter> is set to use Content-Length for
determining the offset of the end of the message.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-set-respect-content-length" role="function">
<title>g_mime_parser_set_respect_content_length ()</title>
<indexterm zone="g-mime-parser-set-respect-content-length"><primary>g_mime_parser_set_respect_content_length</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_parser_set_respect_content_length
                                                        (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> respect_content_length</parameter>);</programlisting>
<para>
Sets whether or not <parameter>parser</parameter> should respect Content-Length headers
when deciding where to look for the start of the next message. Only
used when the parser is also set to scan for From-lines.
</para>
<para>
Most notably useful when parsing broken Solaris mbox files (See
http://www.jwz.org/doc/content-length.html for details).
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>respect_content_length</parameter>&#160;:</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the parser should use Content-Length headers or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-set-header-regex" role="function">
<title>g_mime_parser_set_header_regex ()</title>
<indexterm zone="g-mime-parser-set-header-regex"><primary>g_mime_parser_set_header_regex</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_parser_set_header_regex      (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *regex</parameter>,
                                                         <parameter><link linkend="GMimeParserHeaderRegexFunc"><type>GMimeParserHeaderRegexFunc</type></link> header_cb</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>
Sets the regular expression pattern <parameter>regex</parameter> on <parameter>parser</parameter>. Whenever a
header matching the pattern <parameter>regex</parameter> is parsed, <parameter>header_cb</parameter> is called
with <parameter>user_data</parameter> as the user_data argument.
</para>
<para>
If <parameter>regex</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then the previously registered regex callback
is unregistered and no new callback is set.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>regex</parameter>&#160;:</term>
<listitem><simpara>regular expression
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>header_cb</parameter>&#160;:</term>
<listitem><simpara>callback function
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-tell" role="function">
<title>g_mime_parser_tell ()</title>
<indexterm zone="g-mime-parser-tell"><primary>g_mime_parser_tell</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_parser_tell                  (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets the current stream offset from the parser's internal stream.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current stream offset from the parser's internal stream
or <link linkend="1:CAPS"><literal>-1</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-eos" role="function">
<title>g_mime_parser_eos ()</title>
<indexterm zone="g-mime-parser-eos"><primary>g_mime_parser_eos</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_parser_eos                   (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Tests the end-of-stream indicator for <parameter>parser</parameter>'s internal stream.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> on EOS or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-construct-part" role="function">
<title>g_mime_parser_construct_part ()</title>
<indexterm zone="g-mime-parser-construct-part"><primary>g_mime_parser_construct_part</primary></indexterm>
<programlisting><link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       g_mime_parser_construct_part        (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Constructs a MIME part from <parameter>parser</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a MIME part based on <parameter>parser</parameter> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-construct-message" role="function">
<title>g_mime_parser_construct_message ()</title>
<indexterm zone="g-mime-parser-construct-message"><primary>g_mime_parser_construct_message</primary></indexterm>
<programlisting><link linkend="GMimeMessage"><returnvalue>GMimeMessage</returnvalue></link> *      g_mime_parser_construct_message     (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Constructs a MIME message from <parameter>parser</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a MIME message or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-from" role="function">
<title>g_mime_parser_get_from ()</title>
<indexterm zone="g-mime-parser-get-from"><primary>g_mime_parser_get_from</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_parser_get_from              (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets the mbox-style From-line of the most recently parsed message
(gotten from <link linkend="g-mime-parser-construct-message"><function>g_mime_parser_construct_message()</function></link>).
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the mbox-style From-line of the most recently parsed
message or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-from-offset" role="function">
<title>g_mime_parser_get_from_offset ()</title>
<indexterm zone="g-mime-parser-get-from-offset"><primary>g_mime_parser_get_from_offset</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_parser_get_from_offset       (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets the offset of the most recently parsed mbox-style From-line
(gotten from <link linkend="g-mime-parser-construct-message"><function>g_mime_parser_construct_message()</function></link>).
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the offset of the most recently parsed mbox-style From-line
or <link linkend="1:CAPS"><literal>-1</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-headers-begin" role="function">
<title>g_mime_parser_get_headers_begin ()</title>
<indexterm zone="g-mime-parser-get-headers-begin"><primary>g_mime_parser_get_headers_begin</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_parser_get_headers_begin     (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets the stream offset of the beginning of the headers of the most
recently parsed message.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the offset of the beginning of the headers of the most
recently parsed message or <link linkend="1:CAPS"><literal>-1</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-parser-get-headers-end" role="function">
<title>g_mime_parser_get_headers_end ()</title>
<indexterm zone="g-mime-parser-get-headers-end"><primary>g_mime_parser_get_headers_end</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_parser_get_headers_end       (<parameter><link linkend="GMimeParser"><type>GMimeParser</type></link> *parser</parameter>);</programlisting>
<para>
Gets the stream offset of the end of the headers of the most
recently parsed message.
</para><variablelist role="params">
<varlistentry><term><parameter>parser</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeParser"><type>GMimeParser</type></link> context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the offset of the end of the headers of the most recently
parsed message or <link linkend="1:CAPS"><literal>-1</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
