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

<refnamediv>
<refname>CamelMedium</refname>
<refpurpose></refpurpose>
</refnamediv>

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

<synopsis>
struct              <link linkend="CamelMedium">CamelMedium</link>;
                    <link linkend="CamelMediumHeader">CamelMediumHeader</link>;
<link linkend="void">void</link>                <link linkend="camel-medium-add-header">camel_medium_add_header</link>             (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="void">void</link> *value);
<link linkend="void">void</link>                <link linkend="camel-medium-set-header">camel_medium_set_header</link>             (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="void">void</link> *value);
<link linkend="void">void</link>                <link linkend="camel-medium-remove-header">camel_medium_remove_header</link>          (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name);
const <link linkend="void">void</link> *        <link linkend="camel-medium-get-header">camel_medium_get_header</link>             (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name);
<link linkend="GArray">GArray</link> *            <link linkend="camel-medium-get-headers">camel_medium_get_headers</link>            (<link linkend="CamelMedium">CamelMedium</link> *medium);
<link linkend="void">void</link>                <link linkend="camel-medium-free-headers">camel_medium_free_headers</link>           (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         <link linkend="GArray">GArray</link> *headers);
<link linkend="CamelDataWrapper">CamelDataWrapper</link> *  <link linkend="camel-medium-get-content-object">camel_medium_get_content_object</link>     (<link linkend="CamelMedium">CamelMedium</link> *medium);
<link linkend="void">void</link>                <link linkend="camel-medium-set-content-object">camel_medium_set_content_object</link>     (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         <link linkend="CamelDataWrapper">CamelDataWrapper</link> *content);
</synopsis>
</refsynopsisdiv>









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

<refsect1 id="camel-CamelMedium.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelMedium" role="struct">
<title>struct CamelMedium</title>
<indexterm zone="CamelMedium"><primary sortas="CamelMedium">CamelMedium</primary></indexterm><programlisting>struct CamelMedium {
	CamelDataWrapper parent_object;

	/* The content of the medium, as opposed to our parent
	 * CamelDataWrapper, which wraps both the headers and the
	 * content.
	 */
	CamelDataWrapper *content;
};
</programlisting>
<para>
</para></refsect2>
<refsect2 id="CamelMediumHeader" role="struct">
<title>CamelMediumHeader</title>
<indexterm zone="CamelMediumHeader"><primary sortas="CamelMediumHeader">CamelMediumHeader</primary></indexterm><programlisting>typedef struct {
	const char *name;
	const char *value;
} CamelMediumHeader;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-medium-add-header" role="function">
<title>camel_medium_add_header ()</title>
<indexterm zone="camel-medium-add-header"><primary sortas="camel_medium_add_header">camel_medium_add_header</primary></indexterm><programlisting><link linkend="void">void</link>                camel_medium_add_header             (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="void">void</link> *value);</programlisting>
<para>
Adds a header to a <link linkend="CamelMedium"><type>CamelMedium</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> name of the header
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> value of the header
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-set-header" role="function">
<title>camel_medium_set_header ()</title>
<indexterm zone="camel-medium-set-header"><primary sortas="camel_medium_set_header">camel_medium_set_header</primary></indexterm><programlisting><link linkend="void">void</link>                camel_medium_set_header             (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name,
                                                         const <link linkend="void">void</link> *value);</programlisting>
<para>
Sets the value of a header.  Any other occurances of the header
will be removed.  Setting a <link linkend="NULL--CAPS"><literal>NULL</literal></link> header can be used to remove
the header also.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> name of the header
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> value of the header
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-remove-header" role="function">
<title>camel_medium_remove_header ()</title>
<indexterm zone="camel-medium-remove-header"><primary sortas="camel_medium_remove_header">camel_medium_remove_header</primary></indexterm><programlisting><link linkend="void">void</link>                camel_medium_remove_header          (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name);</programlisting>
<para>
Removes the named header from the medium.  All occurances of the
header are removed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the name of the header
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-get-header" role="function">
<title>camel_medium_get_header ()</title>
<indexterm zone="camel-medium-get-header"><primary sortas="camel_medium_get_header">camel_medium_get_header</primary></indexterm><programlisting>const <link linkend="void">void</link> *        camel_medium_get_header             (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         const <link linkend="char">char</link> *name);</programlisting>
<para>
Gets the value of the named header in the medium, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if
it is unset. The caller should not modify or free the data.
</para>
<para>
If the header occurs more than once, only retrieve the first
instance of the header.  For multi-occuring headers, use
:<link linkend="get-headers"><function>get_headers()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the name of the header
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the value of the named header, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-get-headers" role="function">
<title>camel_medium_get_headers ()</title>
<indexterm zone="camel-medium-get-headers"><primary sortas="camel_medium_get_headers">camel_medium_get_headers</primary></indexterm><programlisting><link linkend="GArray">GArray</link> *            camel_medium_get_headers            (<link linkend="CamelMedium">CamelMedium</link> *medium);</programlisting>
<para>
Gets an array of all header name/value pairs (as
CamelMediumHeader structures). The values will be decoded
to UTF-8 for any headers that are recognized by Camel. The
caller should not modify the returned data.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the array of headers, which must be freed with
<link linkend="camel-medium-free-headers"><type>camel_medium_free_headers</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-free-headers" role="function">
<title>camel_medium_free_headers ()</title>
<indexterm zone="camel-medium-free-headers"><primary sortas="camel_medium_free_headers">camel_medium_free_headers</primary></indexterm><programlisting><link linkend="void">void</link>                camel_medium_free_headers           (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         <link linkend="GArray">GArray</link> *headers);</programlisting>
<para>
Frees <parameter>headers</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>headers</parameter>&#160;:</term>
<listitem><simpara> an array of headers returned from <link linkend="camel-medium-get-headers"><type>camel_medium_get_headers</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-get-content-object" role="function">
<title>camel_medium_get_content_object ()</title>
<indexterm zone="camel-medium-get-content-object"><primary sortas="camel_medium_get_content_object">camel_medium_get_content_object</primary></indexterm><programlisting><link linkend="CamelDataWrapper">CamelDataWrapper</link> *  camel_medium_get_content_object     (<link linkend="CamelMedium">CamelMedium</link> *medium);</programlisting>
<para>
Getss a data wrapper that represents the content of the medium,
without its headers.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="CamelDataWrapper"><type>CamelDataWrapper</type></link> containing <parameter>medium</parameter>'s content
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-medium-set-content-object" role="function">
<title>camel_medium_set_content_object ()</title>
<indexterm zone="camel-medium-set-content-object"><primary sortas="camel_medium_set_content_object">camel_medium_set_content_object</primary></indexterm><programlisting><link linkend="void">void</link>                camel_medium_set_content_object     (<link linkend="CamelMedium">CamelMedium</link> *medium,
                                                         <link linkend="CamelDataWrapper">CamelDataWrapper</link> *content);</programlisting>
<para>
Sets the content of <parameter>medium</parameter> to be <parameter>content</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>medium</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelMedium"><type>CamelMedium</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelDataWrapper"><type>CamelDataWrapper</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
