<?xml version="1.0"?>
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>rfc822</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"/><link rel="start" href="#rfc822" title="rfc822"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>rfc822</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/><link rel="home" href="#idm247873168272" title="rfc822"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--
-Copyright 1998 - 2007 Double Precision, Inc. See COPYING for distribution
+Copyright 1998 - 2009 Double Precision, Inc. See COPYING for distribution
information.
---></head><body><div class="refentry" lang="en" xml:lang="en"><a id="rfc822" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>rfc822 — RFC 822 parsing library</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+--></head><body><div class="refentry"><a id="idm247873168272" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>rfc822 — RFC 822 parsing library</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="informalexample"><pre class="programlisting" xml:space="preserve">
#include <rfc822.h>
#include <rfc2047.h>
cc ... -lrfc822
-</pre></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id413017" shape="rect"> </a><h2>DESCRIPTION</h2><p>
+</pre></div></div><div class="refsect1"><a id="idm247873116928" shape="rect"> </a><h2>DESCRIPTION</h2><p>
The rfc822 library provides functions for parsing E-mail headers in the RFC
822 format. This library also includes some functions to help with encoding
and decoding 8-bit text, as defined by RFC 2047.</p><p>
its logical components: names and E-mail addresses.</p><p>
2) Access those individual components.</p><p>
3) Allow some limited modifications of the parsed structure, and then
-convert it back into a text string.</p><div class="refsect2" lang="en" xml:lang="en"><a id="id418693" shape="rect"> </a><h3>Tokenizing an E-mail header</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+convert it back into a text string.</p><div class="refsect2"><a id="idm247873111200" shape="rect"> </a><h3>Tokenizing an E-mail header</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
struct rfc822t *tokens=rfc822t_alloc_new(const char *header,
void (*err_func)(const char *, int, void *),
void *func_arg);
modified by <code class="function">rfc822t_alloc</code>(), however the
<span class="structname">rfc822t</span> structure contains
pointers to portions of the supplied <em class="parameter"><code>header</code></em>,
-and they must remain valid.</p></div></div><div class="refsect2" lang="en" xml:lang="en"><a id="id384057" shape="rect"> </a><h3>Extracting E-mail addresses</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+and they must remain valid.</p></div></div><div class="refsect2"><a id="idm247873153904" shape="rect"> </a><h3>Extracting E-mail addresses</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
struct rfc822a *addrs=rfc822a_alloc(struct rfc822t *tokens);
void rfc822a_free(addrs);
The <em class="structfield"><code>next</code></em> pointer builds a linked list of all
tokens in this name or
address. The possible values for the <em class="structfield"><code>token</code></em> field
-are:</p><div class="variablelist"><dl><dt><span class="term">0x00</span></dt><dd><p>
+are:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">0x00</span></dt><dd><p>
This is a simple atom - a sequence of non-special characters that
is delimited by whitespace or special characters (see below).</p></dd><dt><span class="term">0x22</span></dt><dd><p>
The value of the ascii quote - this is a quoted string.</p></dd><dt><span class="term">Open parenthesis: '('</span></dt><dd><p>
'<code class="literal">(</code>'.</p><p>
Note that it's possible that <em class="structfield"><code>len</code></em> might be zero.
This happens with null addresses used as return addresses for delivery status
-notifications.</p></div><div class="refsect2" lang="en" xml:lang="en"><a id="id428138" shape="rect"> </a><h3>Working with E-mail addresses</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+notifications.</p></div><div class="refsect2"><a id="idm247867853536" shape="rect"> </a><h3>Working with E-mail addresses</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
void rfc822_deladdr(struct rfc822a *addrs, int index);
void rfc822tok_print(const struct rfc822token *list,
The function <code class="function">rfc822_getaddrs_wrap</code>() is similar to
<code class="function">rfc822_getaddrs</code>(), except
that the generated text is wrapped on or about the 73rd column, using
-newline characters.</p></div><div class="refsect2" lang="en" xml:lang="en"><a id="id428445" shape="rect"> </a><h3>Working with dates</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+newline characters.</p></div><div class="refsect2"><a id="idm247867812992" shape="rect"> </a><h3>Working with dates</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
time_t timestamp=rfc822_parsedt(const char *datestr)
const char *datestr=rfc822_mkdate(time_t timestamp);
void rfc822_mkdate_buf(time_t timestamp, char *buffer);
the given timestamp.
<code class="function">rfc822_mkdate_buf</code>() writes the date string into the
given buffer instead,
-which must be big enough to accommodate it.</p></div><div class="refsect2" lang="en" xml:lang="en"><a id="id428494" shape="rect"> </a><h3>Working with 8-bit MIME-encoded headers</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+which must be big enough to accommodate it.</p></div><div class="refsect2"><a id="idm247867806656" shape="rect"> </a><h3>Working with 8-bit MIME-encoded headers</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
int error=rfc2047_decode(const char *text,
int (*callback_func)(const char *, int, const char *, void *),
void *callback_arg);
and <em class="parameter"><code>callback_arg</code></em>.</p><p>
The function <code class="function">rfc2047_encode_header</code>() is basically
equivalent to <code class="function">rfc822_getaddrs</code>(), followed by
-<code class="function">rfc2047_encode_str</code>();</p></div><div class="refsect2" lang="en" xml:lang="en"><a id="id428714" shape="rect"> </a><h3>Working with subjects</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
+<code class="function">rfc2047_encode_str</code>();</p></div><div class="refsect2"><a id="idm247867777760" shape="rect"> </a><h3>Working with subjects</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
char *basesubj=rfc822_coresubj(const char *subj);
char *basesubj=rfc822_coresubj_nouc(const char *subj);
"core" subject header that's used in the specification of the IMAP THREAD
function. This function is designed to strip all subject line artifacts that
might've been added in the process of forwarding or replying to a message.
-Currently, <code class="function">rfc822_coresubj</code>() performs the following transformations:</p><div class="variablelist"><dl><dt><span class="term">Whitespace</span></dt><dd><p>Leading and trailing whitespace is removed. Consecutive
+Currently, <code class="function">rfc822_coresubj</code>() performs the following transformations:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Whitespace</span></dt><dd><p>Leading and trailing whitespace is removed. Consecutive
whitespace characters are collapsed into a single whitespace character.
All whitespace characters are replaced by a space.</p></dd><dt><span class="term">Re:, (fwd) [foo]</span></dt><dd><p>
These artifacts (and several others) are removed from
must be <code class="function">free</code>(3)-ed after use.</p><p>
<code class="function">rfc822_coresubj_nouc</code>() is like
<code class="function">rfc822_coresubj</code>(), except that the subject
-is not converted to uppercase.</p></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id428812" shape="rect"> </a><h2>SEE ALSO</h2><p>
+is not converted to uppercase.</p></div></div><div class="refsect1"><a id="idm247867765456" shape="rect"> </a><h2>SEE ALSO</h2><p>
<a class="ulink" href="rfc2045.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">rfc2045</span>(3)</span></a>,
<a class="ulink" href="reformail.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">reformail</span>(1)</span></a>,
<a class="ulink" href="reformime.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">reformime</span>(1)</span></a>.</p></div></div></body></html>