1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GMimeParser</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GMime 2.6 Reference Manual">
8 <link rel="up" href="Parsers.html" title="Parsing Messages and MIME Parts">
9 <link rel="prev" href="Parsers.html" title="Parsing Messages and MIME Parts">
10 <link rel="next" href="CryptoContexts.html" title="Cryptography Contexts">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="Parsers.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="Parsers.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GMime 2.6 Reference Manual</th>
21 <td><a accesskey="n" href="CryptoContexts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GMimeParser.synopsis" class="shortcut">Top</a>
26 <a href="#GMimeParser.description" class="shortcut">Description</a>
28 <a href="#GMimeParser.object-hierarchy" class="shortcut">Object Hierarchy</a>
31 <div class="refentry">
32 <a name="GMimeParser"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
35 <h2><span class="refentrytitle"><a name="GMimeParser.top_of_page"></a>GMimeParser</span></h2>
36 <p>GMimeParser — Message and MIME part parser</p>
38 <td valign="top" align="right"></td>
40 <div class="refsynopsisdiv">
41 <a name="GMimeParser.synopsis"></a><h2>Synopsis</h2>
42 <pre class="synopsis">struct <a class="link" href="GMimeParser.html#GMimeParser-struct" title="struct GMimeParser">GMimeParser</a>;
43 <span class="returnvalue">void</span> (<a class="link" href="GMimeParser.html#GMimeParserHeaderRegexFunc" title="GMimeParserHeaderRegexFunc ()">*GMimeParserHeaderRegexFunc</a>) (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
44 <em class="parameter"><code>const <span class="type">char</span> *header</code></em>,
45 <em class="parameter"><code>const <span class="type">char</span> *value</code></em>,
46 <em class="parameter"><code><span class="type">gint64</span> offset</code></em>,
47 <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
48 <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="returnvalue">GMimeParser</span></a> * <a class="link" href="GMimeParser.html#g-mime-parser-new" title="g_mime_parser_new ()">g_mime_parser_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
49 <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="returnvalue">GMimeParser</span></a> * <a class="link" href="GMimeParser.html#g-mime-parser-new-with-stream" title="g_mime_parser_new_with_stream ()">g_mime_parser_new_with_stream</a> (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);
50 <span class="returnvalue">void</span> <a class="link" href="GMimeParser.html#g-mime-parser-init-with-stream" title="g_mime_parser_init_with_stream ()">g_mime_parser_init_with_stream</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
51 <em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);
52 <span class="returnvalue">gboolean</span> <a class="link" href="GMimeParser.html#g-mime-parser-get-persist-stream" title="g_mime_parser_get_persist_stream ()">g_mime_parser_get_persist_stream</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
53 <span class="returnvalue">void</span> <a class="link" href="GMimeParser.html#g-mime-parser-set-persist-stream" title="g_mime_parser_set_persist_stream ()">g_mime_parser_set_persist_stream</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
54 <em class="parameter"><code><span class="type">gboolean</span> persist</code></em>);
55 <span class="returnvalue">gboolean</span> <a class="link" href="GMimeParser.html#g-mime-parser-get-scan-from" title="g_mime_parser_get_scan_from ()">g_mime_parser_get_scan_from</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
56 <span class="returnvalue">void</span> <a class="link" href="GMimeParser.html#g-mime-parser-set-scan-from" title="g_mime_parser_set_scan_from ()">g_mime_parser_set_scan_from</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
57 <em class="parameter"><code><span class="type">gboolean</span> scan_from</code></em>);
58 <span class="returnvalue">gboolean</span> <a class="link" href="GMimeParser.html#g-mime-parser-get-respect-content-length" title="g_mime_parser_get_respect_content_length ()">g_mime_parser_get_respect_content_length</a>
59 (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
60 <span class="returnvalue">void</span> <a class="link" href="GMimeParser.html#g-mime-parser-set-respect-content-length" title="g_mime_parser_set_respect_content_length ()">g_mime_parser_set_respect_content_length</a>
61 (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
62 <em class="parameter"><code><span class="type">gboolean</span> respect_content_length</code></em>);
63 <span class="returnvalue">void</span> <a class="link" href="GMimeParser.html#g-mime-parser-set-header-regex" title="g_mime_parser_set_header_regex ()">g_mime_parser_set_header_regex</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
64 <em class="parameter"><code>const <span class="type">char</span> *regex</code></em>,
65 <em class="parameter"><code><a class="link" href="GMimeParser.html#GMimeParserHeaderRegexFunc" title="GMimeParserHeaderRegexFunc ()"><span class="type">GMimeParserHeaderRegexFunc</span></a> header_cb</code></em>,
66 <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
67 <span class="returnvalue">gint64</span> <a class="link" href="GMimeParser.html#g-mime-parser-tell" title="g_mime_parser_tell ()">g_mime_parser_tell</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
68 <span class="returnvalue">gboolean</span> <a class="link" href="GMimeParser.html#g-mime-parser-eos" title="g_mime_parser_eos ()">g_mime_parser_eos</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
69 <a class="link" href="GMimeObject.html" title="GMimeObject"><span class="returnvalue">GMimeObject</span></a> * <a class="link" href="GMimeParser.html#g-mime-parser-construct-part" title="g_mime_parser_construct_part ()">g_mime_parser_construct_part</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
70 <a class="link" href="GMimeMessage.html" title="GMimeMessage"><span class="returnvalue">GMimeMessage</span></a> * <a class="link" href="GMimeParser.html#g-mime-parser-construct-message" title="g_mime_parser_construct_message ()">g_mime_parser_construct_message</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
71 <span class="returnvalue">char</span> * <a class="link" href="GMimeParser.html#g-mime-parser-get-from" title="g_mime_parser_get_from ()">g_mime_parser_get_from</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
72 <span class="returnvalue">gint64</span> <a class="link" href="GMimeParser.html#g-mime-parser-get-from-offset" title="g_mime_parser_get_from_offset ()">g_mime_parser_get_from_offset</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
73 <span class="returnvalue">gint64</span> <a class="link" href="GMimeParser.html#g-mime-parser-get-headers-begin" title="g_mime_parser_get_headers_begin ()">g_mime_parser_get_headers_begin</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
74 <span class="returnvalue">gint64</span> <a class="link" href="GMimeParser.html#g-mime-parser-get-headers-end" title="g_mime_parser_get_headers_end ()">g_mime_parser_get_headers_end</a> (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);
77 <div class="refsect1">
78 <a name="GMimeParser.object-hierarchy"></a><h2>Object Hierarchy</h2>
79 <pre class="synopsis">
84 <div class="refsect1">
85 <a name="GMimeParser.description"></a><h2>Description</h2>
87 A <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> parses a stream into a <a class="link" href="GMimeMessage.html" title="GMimeMessage"><span class="type">GMimeMessage</span></a> or other
88 <a class="link" href="GMimeObject.html" title="GMimeObject"><span class="type">GMimeObject</span></a> and can also handle parsing MBox formatted streams
89 into multiple <a class="link" href="GMimeMessage.html" title="GMimeMessage"><span class="type">GMimeMessage</span></a> objects.
92 <div class="refsect1">
93 <a name="GMimeParser.details"></a><h2>Details</h2>
94 <div class="refsect2">
95 <a name="GMimeParser-struct"></a><h3>struct GMimeParser</h3>
96 <pre class="programlisting">struct GMimeParser;</pre>
98 A MIME parser context.
100 <div class="variablelist"><table border="0">
101 <col align="left" valign="top">
106 <div class="refsect2">
107 <a name="GMimeParserHeaderRegexFunc"></a><h3>GMimeParserHeaderRegexFunc ()</h3>
108 <pre class="programlisting"><span class="returnvalue">void</span> (*GMimeParserHeaderRegexFunc) (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
109 <em class="parameter"><code>const <span class="type">char</span> *header</code></em>,
110 <em class="parameter"><code>const <span class="type">char</span> *value</code></em>,
111 <em class="parameter"><code><span class="type">gint64</span> offset</code></em>,
112 <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
114 Function signature for the callback to
115 <a class="link" href="GMimeParser.html#g-mime-parser-set-header-regex" title="g_mime_parser_set_header_regex ()"><code class="function">g_mime_parser_set_header_regex()</code></a>.
117 <div class="variablelist"><table border="0">
118 <col align="left" valign="top">
121 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
122 <td>The <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> object.</td>
125 <td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
126 <td>The header field matched.</td>
129 <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
130 <td>The header field value.</td>
133 <td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
134 <td>The header field offset.</td>
137 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
138 <td>The user-supplied callback data.</td>
144 <div class="refsect2">
145 <a name="g-mime-parser-new"></a><h3>g_mime_parser_new ()</h3>
146 <pre class="programlisting"><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="returnvalue">GMimeParser</span></a> * g_mime_parser_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
148 Creates a new parser object.
150 <div class="variablelist"><table border="0">
151 <col align="left" valign="top">
153 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
154 <td>a new parser object.</td>
159 <div class="refsect2">
160 <a name="g-mime-parser-new-with-stream"></a><h3>g_mime_parser_new_with_stream ()</h3>
161 <pre class="programlisting"><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="returnvalue">GMimeParser</span></a> * g_mime_parser_new_with_stream (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
163 Creates a new parser object preset to parse <em class="parameter"><code>stream</code></em>.
165 <div class="variablelist"><table border="0">
166 <col align="left" valign="top">
169 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
170 <td>raw message or part stream</td>
173 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
174 <td>a new parser object.</td>
180 <div class="refsect2">
181 <a name="g-mime-parser-init-with-stream"></a><h3>g_mime_parser_init_with_stream ()</h3>
182 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_parser_init_with_stream (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
183 <em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
185 Initializes <em class="parameter"><code>parser</code></em> to use <em class="parameter"><code>stream</code></em>.
188 WARNING: Initializing a parser with a stream is comparable to
189 selling your soul (<em class="parameter"><code>stream</code></em>) to the devil (<em class="parameter"><code>parser</code></em>). You are
190 basically giving the parser complete control of the stream, this
191 means that you had better not touch the stream so long as the
192 parser is still using it. This means no reading, writing, seeking,
193 or resetting of the stream. Anything that will/could change the
194 current stream's offset is PROHIBITED.
197 It is also recommended that you not use <a class="link" href="GMimeStream.html#g-mime-stream-tell" title="g_mime_stream_tell ()"><code class="function">g_mime_stream_tell()</code></a>
198 because it will not necessarily give you the current <em class="parameter"><code>parser</code></em> offset
199 since <em class="parameter"><code>parser</code></em> handles its own internal read-ahead buffer. Instead,
200 it is recommended that you use <a class="link" href="GMimeParser.html#g-mime-parser-tell" title="g_mime_parser_tell ()"><code class="function">g_mime_parser_tell()</code></a> if you have a
201 reason to need the current offset of the <em class="parameter"><code>parser</code></em>.
203 <div class="variablelist"><table border="0">
204 <col align="left" valign="top">
207 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
208 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
211 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
212 <td>raw message or part stream</td>
218 <div class="refsect2">
219 <a name="g-mime-parser-get-persist-stream"></a><h3>g_mime_parser_get_persist_stream ()</h3>
220 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_mime_parser_get_persist_stream (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
222 Gets whether or not the underlying stream is persistent.
224 <div class="variablelist"><table border="0">
225 <col align="left" valign="top">
228 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
229 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
232 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
234 <code class="literal">TRUE</code> if the <em class="parameter"><code>parser</code></em> will leave the content on disk or
235 <code class="literal">FALSE</code> if it will load the content into memory.</td>
241 <div class="refsect2">
242 <a name="g-mime-parser-set-persist-stream"></a><h3>g_mime_parser_set_persist_stream ()</h3>
243 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_parser_set_persist_stream (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
244 <em class="parameter"><code><span class="type">gboolean</span> persist</code></em>);</pre>
246 Sets whether or not the <em class="parameter"><code>parser</code></em>'s underlying stream is persistent.
249 If <em class="parameter"><code>persist</code></em> is <code class="literal">TRUE</code>, the <em class="parameter"><code>parser</code></em> will attempt to construct
250 messages/parts whose content will remain on disk rather than being
251 loaded into memory so as to reduce memory usage. This is the default.
254 If <em class="parameter"><code>persist</code></em> is <code class="literal">FALSE</code>, the <em class="parameter"><code>parser</code></em> will always load message content
258 Note: This attribute only serves as a hint to the <em class="parameter"><code>parser</code></em>. If the
259 underlying stream does not support seeking, then this attribute
262 <div class="variablelist"><table border="0">
263 <col align="left" valign="top">
266 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
267 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
270 <td><p><span class="term"><em class="parameter"><code>persist</code></em> :</span></p></td>
271 <td>persist attribute</td>
277 <div class="refsect2">
278 <a name="g-mime-parser-get-scan-from"></a><h3>g_mime_parser_get_scan_from ()</h3>
279 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_mime_parser_get_scan_from (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
281 Gets whether or not <em class="parameter"><code>parser</code></em> is set to scan mbox-style From-lines.
283 <div class="variablelist"><table border="0">
284 <col align="left" valign="top">
287 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
288 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
291 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
292 <td>whether or not <em class="parameter"><code>parser</code></em> is set to scan mbox-style
299 <div class="refsect2">
300 <a name="g-mime-parser-set-scan-from"></a><h3>g_mime_parser_set_scan_from ()</h3>
301 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_parser_set_scan_from (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
302 <em class="parameter"><code><span class="type">gboolean</span> scan_from</code></em>);</pre>
304 Sets whether or not <em class="parameter"><code>parser</code></em> should scan mbox-style From-lines.
306 <div class="variablelist"><table border="0">
307 <col align="left" valign="top">
310 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
311 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
314 <td><p><span class="term"><em class="parameter"><code>scan_from</code></em> :</span></p></td>
316 <code class="literal">TRUE</code> to scan From-lines or <code class="literal">FALSE</code> otherwise</td>
322 <div class="refsect2">
323 <a name="g-mime-parser-get-respect-content-length"></a><h3>g_mime_parser_get_respect_content_length ()</h3>
324 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_mime_parser_get_respect_content_length
325 (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
327 Gets whether or not <em class="parameter"><code>parser</code></em> is set to use Content-Length for
328 determining the offset of the end of the message.
330 <div class="variablelist"><table border="0">
331 <col align="left" valign="top">
334 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
335 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
338 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
339 <td>whether or not <em class="parameter"><code>parser</code></em> is set to use Content-Length for
340 determining the offset of the end of the message.</td>
346 <div class="refsect2">
347 <a name="g-mime-parser-set-respect-content-length"></a><h3>g_mime_parser_set_respect_content_length ()</h3>
348 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_parser_set_respect_content_length
349 (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
350 <em class="parameter"><code><span class="type">gboolean</span> respect_content_length</code></em>);</pre>
352 Sets whether or not <em class="parameter"><code>parser</code></em> should respect Content-Length headers
353 when deciding where to look for the start of the next message. Only
354 used when the parser is also set to scan for From-lines.
357 Most notably useful when parsing broken Solaris mbox files (See
358 http://www.jwz.org/doc/content-length.html for details).
360 <div class="variablelist"><table border="0">
361 <col align="left" valign="top">
364 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
365 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
368 <td><p><span class="term"><em class="parameter"><code>respect_content_length</code></em> :</span></p></td>
370 <code class="literal">TRUE</code> if the parser should use Content-Length headers or <code class="literal">FALSE</code> otherwise.</td>
376 <div class="refsect2">
377 <a name="g-mime-parser-set-header-regex"></a><h3>g_mime_parser_set_header_regex ()</h3>
378 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_parser_set_header_regex (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>,
379 <em class="parameter"><code>const <span class="type">char</span> *regex</code></em>,
380 <em class="parameter"><code><a class="link" href="GMimeParser.html#GMimeParserHeaderRegexFunc" title="GMimeParserHeaderRegexFunc ()"><span class="type">GMimeParserHeaderRegexFunc</span></a> header_cb</code></em>,
381 <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
383 Sets the regular expression pattern <em class="parameter"><code>regex</code></em> on <em class="parameter"><code>parser</code></em>. Whenever a
384 header matching the pattern <em class="parameter"><code>regex</code></em> is parsed, <em class="parameter"><code>header_cb</code></em> is called
385 with <em class="parameter"><code>user_data</code></em> as the user_data argument.
388 If <em class="parameter"><code>regex</code></em> is <code class="literal">NULL</code>, then the previously registered regex callback
389 is unregistered and no new callback is set.
391 <div class="variablelist"><table border="0">
392 <col align="left" valign="top">
395 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
396 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
399 <td><p><span class="term"><em class="parameter"><code>regex</code></em> :</span></p></td>
400 <td>regular expression</td>
403 <td><p><span class="term"><em class="parameter"><code>header_cb</code></em> :</span></p></td>
404 <td>callback function</td>
407 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
414 <div class="refsect2">
415 <a name="g-mime-parser-tell"></a><h3>g_mime_parser_tell ()</h3>
416 <pre class="programlisting"><span class="returnvalue">gint64</span> g_mime_parser_tell (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
418 Gets the current stream offset from the parser's internal stream.
420 <div class="variablelist"><table border="0">
421 <col align="left" valign="top">
424 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
425 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
428 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
429 <td>the current stream offset from the parser's internal stream
430 or <code class="literal">-1</code> on error.</td>
436 <div class="refsect2">
437 <a name="g-mime-parser-eos"></a><h3>g_mime_parser_eos ()</h3>
438 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_mime_parser_eos (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
440 Tests the end-of-stream indicator for <em class="parameter"><code>parser</code></em>'s internal stream.
442 <div class="variablelist"><table border="0">
443 <col align="left" valign="top">
446 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
447 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
450 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
452 <code class="literal">TRUE</code> on EOS or <code class="literal">FALSE</code> otherwise.</td>
458 <div class="refsect2">
459 <a name="g-mime-parser-construct-part"></a><h3>g_mime_parser_construct_part ()</h3>
460 <pre class="programlisting"><a class="link" href="GMimeObject.html" title="GMimeObject"><span class="returnvalue">GMimeObject</span></a> * g_mime_parser_construct_part (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
462 Constructs a MIME part from <em class="parameter"><code>parser</code></em>.
464 <div class="variablelist"><table border="0">
465 <col align="left" valign="top">
468 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
469 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
472 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
473 <td>a MIME part based on <em class="parameter"><code>parser</code></em> or <code class="literal">NULL</code> on fail.</td>
479 <div class="refsect2">
480 <a name="g-mime-parser-construct-message"></a><h3>g_mime_parser_construct_message ()</h3>
481 <pre class="programlisting"><a class="link" href="GMimeMessage.html" title="GMimeMessage"><span class="returnvalue">GMimeMessage</span></a> * g_mime_parser_construct_message (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
483 Constructs a MIME message from <em class="parameter"><code>parser</code></em>.
485 <div class="variablelist"><table border="0">
486 <col align="left" valign="top">
489 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
490 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
493 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
494 <td>a MIME message or <code class="literal">NULL</code> on fail.</td>
500 <div class="refsect2">
501 <a name="g-mime-parser-get-from"></a><h3>g_mime_parser_get_from ()</h3>
502 <pre class="programlisting"><span class="returnvalue">char</span> * g_mime_parser_get_from (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
504 Gets the mbox-style From-line of the most recently parsed message
505 (gotten from <a class="link" href="GMimeParser.html#g-mime-parser-construct-message" title="g_mime_parser_construct_message ()"><code class="function">g_mime_parser_construct_message()</code></a>).
507 <div class="variablelist"><table border="0">
508 <col align="left" valign="top">
511 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
512 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
515 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
516 <td>the mbox-style From-line of the most recently parsed
517 message or <code class="literal">NULL</code> on error.</td>
523 <div class="refsect2">
524 <a name="g-mime-parser-get-from-offset"></a><h3>g_mime_parser_get_from_offset ()</h3>
525 <pre class="programlisting"><span class="returnvalue">gint64</span> g_mime_parser_get_from_offset (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
527 Gets the offset of the most recently parsed mbox-style From-line
528 (gotten from <a class="link" href="GMimeParser.html#g-mime-parser-construct-message" title="g_mime_parser_construct_message ()"><code class="function">g_mime_parser_construct_message()</code></a>).
530 <div class="variablelist"><table border="0">
531 <col align="left" valign="top">
534 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
535 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
538 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
539 <td>the offset of the most recently parsed mbox-style From-line
540 or <code class="literal">-1</code> on error.</td>
546 <div class="refsect2">
547 <a name="g-mime-parser-get-headers-begin"></a><h3>g_mime_parser_get_headers_begin ()</h3>
548 <pre class="programlisting"><span class="returnvalue">gint64</span> g_mime_parser_get_headers_begin (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
550 Gets the stream offset of the beginning of the headers of the most
551 recently parsed message.
553 <div class="variablelist"><table border="0">
554 <col align="left" valign="top">
557 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
558 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
561 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
562 <td>the offset of the beginning of the headers of the most
563 recently parsed message or <code class="literal">-1</code> on error.</td>
569 <div class="refsect2">
570 <a name="g-mime-parser-get-headers-end"></a><h3>g_mime_parser_get_headers_end ()</h3>
571 <pre class="programlisting"><span class="returnvalue">gint64</span> g_mime_parser_get_headers_end (<em class="parameter"><code><a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> *parser</code></em>);</pre>
573 Gets the stream offset of the end of the headers of the most
574 recently parsed message.
576 <div class="variablelist"><table border="0">
577 <col align="left" valign="top">
580 <td><p><span class="term"><em class="parameter"><code>parser</code></em> :</span></p></td>
581 <td>a <a class="link" href="GMimeParser.html" title="GMimeParser"><span class="type">GMimeParser</span></a> context</td>
584 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
585 <td>the offset of the end of the headers of the most recently
586 parsed message or <code class="literal">-1</code> on error.</td>
595 Generated by GTK-Doc V1.18</div>