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

<refnamediv>
<refname>CamelInternetAddress</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>
struct              <link linkend="CamelInternetAddress">CamelInternetAddress</link>;
<link linkend="CamelInternetAddress">CamelInternetAddress</link>* <link linkend="camel-internet-address-new">camel_internet_address_new</link>        (void);
<link linkend="int">int</link>                 <link linkend="camel-internet-address-add">camel_internet_address_add</link>          (<link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="char">char</link> *address);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-internet-address-get">camel_internet_address_get</link>          (const <link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         <link linkend="int">int</link> index,
                                                         const <link linkend="char">char</link> **namep,
                                                         const <link linkend="char">char</link> **addressp);
<link linkend="int">int</link>                 <link linkend="camel-internet-address-find-name">camel_internet_address_find_name</link>    (<link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="char">char</link> **addressp);
<link linkend="int">int</link>                 <link linkend="camel-internet-address-find-address">camel_internet_address_find_address</link> (<link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         const <link linkend="char">char</link> *address,
                                                         const <link linkend="char">char</link> **namep);
<link linkend="char">char</link>*               <link linkend="camel-internet-address-encode-address">camel_internet_address_encode_address</link>
                                                        (<link linkend="int">int</link> *len,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="char">char</link> *addr);
<link linkend="char">char</link>*               <link linkend="camel-internet-address-format-address">camel_internet_address_format_address</link>
                                                        (const <link linkend="char">char</link> *real,
                                                         const <link linkend="char">char</link> *addr);
</synopsis>
</refsynopsisdiv>









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

</para>
</refsect1>

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

	struct _CamelInternetAddressPrivate *priv;
};
</programlisting>
<para>

</para></refsect2>
<refsect2 id="camel-internet-address-new" role="function">
<title>camel_internet_address_new ()</title>
<indexterm zone="camel-internet-address-new"><primary>camel_internet_address_new</primary></indexterm><programlisting><link linkend="CamelInternetAddress">CamelInternetAddress</link>* camel_internet_address_new        (void);</programlisting>
<para>
Create a new <link linkend="CamelInternetAddress"><type>CamelInternetAddress</type></link> object.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a new <link linkend="CamelInternetAddress"><type>CamelInternetAddress</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-internet-address-add" role="function">
<title>camel_internet_address_add ()</title>
<indexterm zone="camel-internet-address-add"><primary>camel_internet_address_add</primary></indexterm><programlisting><link linkend="int">int</link>                 camel_internet_address_add          (<link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="char">char</link> *address);</programlisting>
<para>
Add a new internet address to <parameter>addr</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>addr</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelInternetAddress"><type>CamelInternetAddress</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
<listitem><simpara> name associated with the new address
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>address</parameter>&nbsp;:</term>
<listitem><simpara> routing address associated with the new address
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the index of added entry
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-internet-address-get" role="function">
<title>camel_internet_address_get ()</title>
<indexterm zone="camel-internet-address-get"><primary>camel_internet_address_get</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_internet_address_get          (const <link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         <link linkend="int">int</link> index,
                                                         const <link linkend="char">char</link> **namep,
                                                         const <link linkend="char">char</link> **addressp);</programlisting>
<para>
Get the address at <parameter>index</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>addr</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelInternetAddress"><type>CamelInternetAddress</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter>&nbsp;:</term>
<listitem><simpara> address's array index
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>namep</parameter>&nbsp;:</term>
<listitem><simpara> holder for the returned name, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>, if not required.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addressp</parameter>&nbsp;:</term>
<listitem><simpara> holder for the returned address, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>, if not required.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>%TRUE if such an address exists, or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-internet-address-find-name" role="function">
<title>camel_internet_address_find_name ()</title>
<indexterm zone="camel-internet-address-find-name"><primary>camel_internet_address_find_name</primary></indexterm><programlisting><link linkend="int">int</link>                 camel_internet_address_find_name    (<link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="char">char</link> **addressp);</programlisting>
<para>
Find address by real name.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>addr</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelInternetAddress"><type>CamelInternetAddress</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
<listitem><simpara> name to lookup
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addressp</parameter>&nbsp;:</term>
<listitem><simpara> holder for address part, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>, if not required.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the index of the address matching the name, or <link linkend="1:CAPS"><literal>-1</literal></link> if no
match was found
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-internet-address-find-address" role="function">
<title>camel_internet_address_find_address ()</title>
<indexterm zone="camel-internet-address-find-address"><primary>camel_internet_address_find_address</primary></indexterm><programlisting><link linkend="int">int</link>                 camel_internet_address_find_address (<link linkend="CamelInternetAddress">CamelInternetAddress</link> *addr,
                                                         const <link linkend="char">char</link> *address,
                                                         const <link linkend="char">char</link> **namep);</programlisting>
<para>
Find an address by address.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>addr</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelInternetAddress"><type>CamelInternetAddress</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>address</parameter>&nbsp;:</term>
<listitem><simpara> address to lookup
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>namep</parameter>&nbsp;:</term>
<listitem><simpara> holder for the matching name, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>, if not required.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the index of the address, or <link linkend="1:CAPS"><literal>-1</literal></link> if not found
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-internet-address-encode-address" role="function">
<title>camel_internet_address_encode_address ()</title>
<indexterm zone="camel-internet-address-encode-address"><primary>camel_internet_address_encode_address</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_internet_address_encode_address
                                                        (<link linkend="int">int</link> *len,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="char">char</link> *addr);</programlisting>
<para>
Encode a single address ready for internet usage.  Header folding
as per rfc822 is also performed, based on the length *<parameter>len</parameter>.  If <parameter>len</parameter>
is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then no folding will occur.
</para>
<para>
Note: The value at *<parameter>in</parameter> will be updated based on any linewrapping done</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>len</parameter>&nbsp;:</term>
<listitem><simpara> the length of the line the address is being appended to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
<listitem><simpara> the unencoded real name associated with the address
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addr</parameter>&nbsp;:</term>
<listitem><simpara> the routing address
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the encoded address
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-internet-address-format-address" role="function">
<title>camel_internet_address_format_address ()</title>
<indexterm zone="camel-internet-address-format-address"><primary>camel_internet_address_format_address</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_internet_address_format_address
                                                        (const <link linkend="char">char</link> *real,
                                                         const <link linkend="char">char</link> *addr);</programlisting>
<para>
Function to format a single address, suitable for display.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>real</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addr</parameter>&nbsp;:</term>
<listitem><simpara> an rfc822 routing address
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a nicely formatted string containing the rfc822 address
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
