\section{Accessing and manipulating MIME parameters}
\label{group__param}\index{Accessing and manipulating MIME parameters@{Accessing and manipulating MIME parameters}}
\subsection*{Functions for manipulating MIME parameters}
MIME parameters are properties attached to certain MIME headers, such as Content-Type and Content-Disposition. MIME parameters have a textual representations as in {\em name=value\/}. They contain important information about the MIME structure of a message, such as the boundary string used, which charset was used to encode the message and so on. This module provides simple to use functions to query or set MIME parameters.

Each MIME header may hold an arbitrary amount of such parameters, which are delimeted by each other with a semicolon. \begin{CompactItemize}
\item 
mm\_\-param $\ast$ {\bf mm\_\-param\_\-new} (void)
\item 
void {\bf mm\_\-param\_\-free} (struct mm\_\-param $\ast$param)
\item 
mm\_\-param $\ast$ {\bf mm\_\-param\_\-generate} (const char $\ast$name, const char $\ast$value)
\item 
char $\ast$ {\bf mm\_\-param\_\-setname} (struct mm\_\-param $\ast$param, const char $\ast$name, int copy)
\item 
char $\ast$ {\bf mm\_\-param\_\-setvalue} (struct mm\_\-param $\ast$param, const char $\ast$value, int copy)
\item 
const char $\ast$ {\bf mm\_\-param\_\-getname} (struct mm\_\-param $\ast$param)
\item 
const char $\ast$ {\bf mm\_\-param\_\-getvalue} (struct mm\_\-param $\ast$param)
\end{CompactItemize}


\subsection{Function Documentation}
\index{param@{param}!mm_param_free@{mm\_\-param\_\-free}}
\index{mm_param_free@{mm\_\-param\_\-free}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void mm\_\-param\_\-free (struct mm\_\-param $\ast$ {\em param})}\label{group__param_g46339038e995799e6a3e37512f442fc9}


Releases all memory associated with a MIME parameter object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]A valid MIME parameter object to be freed \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Nothing \end{Desc}
\begin{Desc}
\item[See also:]\doxyref{mm\_\-param\_\-new}{p.}{group__param_gd3ac756551bf5a29a07d5992bfdbde09} \end{Desc}
\index{param@{param}!mm_param_generate@{mm\_\-param\_\-generate}}
\index{mm_param_generate@{mm\_\-param\_\-generate}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}struct mm\_\-param$\ast$ mm\_\-param\_\-generate (const char $\ast$ {\em name}, const char $\ast$ {\em value})}\label{group__param_gd3970def45b8bede334f4b89a41dec15}


Generates a new Content-Type parameter with the given name and value

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the MIME parameter \item[{\em value}]The value of the MIME parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A new MIME parameter object \end{Desc}
\begin{Desc}
\item[See also:]\doxyref{mm\_\-param\_\-free}{p.}{group__param_g46339038e995799e6a3e37512f442fc9} 

\doxyref{mm\_\-param\_\-new}{p.}{group__param_gd3ac756551bf5a29a07d5992bfdbde09}\end{Desc}
This function generates a new MIME parameter, with the name and value given as the arguments. The needed memory for the operation is allocated dynamically. It stores a copy of name and value in the actual object, so the memory holding the arguments can safely be freed after successfull return of this function. \index{param@{param}!mm_param_getname@{mm\_\-param\_\-getname}}
\index{mm_param_getname@{mm\_\-param\_\-getname}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ mm\_\-param\_\-getname (struct mm\_\-param $\ast$ {\em param})}\label{group__param_g0e0ddccf47a2b1e0ad5bcc52c7b39753}


Gets the name of a MIME parameter object

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]A valid MIME parameter object \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The name of the MIME parameter \end{Desc}
\index{param@{param}!mm_param_getvalue@{mm\_\-param\_\-getvalue}}
\index{mm_param_getvalue@{mm\_\-param\_\-getvalue}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ mm\_\-param\_\-getvalue (struct mm\_\-param $\ast$ {\em param})}\label{group__param_g3c6f8cddd409de3000c31584e140561e}


Gets the value of a MIME parameter object

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]A valid MIME parameter object \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The value of the MIME parameter \end{Desc}
\index{param@{param}!mm_param_new@{mm\_\-param\_\-new}}
\index{mm_param_new@{mm\_\-param\_\-new}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}struct mm\_\-param$\ast$ mm\_\-param\_\-new (void)}\label{group__param_gd3ac756551bf5a29a07d5992bfdbde09}


Creates a new object to hold a MIME parameter.

\begin{Desc}
\item[Returns:]An object representing a MIME parameter \end{Desc}
\begin{Desc}
\item[See also:]\doxyref{mm\_\-param\_\-free}{p.}{group__param_g46339038e995799e6a3e37512f442fc9} \end{Desc}
\begin{Desc}
\item[Note:]The allocated memory must later be freed using \doxyref{mm\_\-param\_\-free()}{p.}{group__param_g46339038e995799e6a3e37512f442fc9} \end{Desc}
\index{param@{param}!mm_param_setname@{mm\_\-param\_\-setname}}
\index{mm_param_setname@{mm\_\-param\_\-setname}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mm\_\-param\_\-setname (struct mm\_\-param $\ast$ {\em param}, const char $\ast$ {\em name}, int {\em copy})}\label{group__param_g2a266c63c7e89cf829b2af8e995e55e8}


Sets the name of the given MIME parameter

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]A valid MIME parameter object \item[{\em name}]The new name of the parameter \item[{\em copy}]If set to $>$ 0, copy the value stored in name \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The address of the previous name for passing to free() \end{Desc}
\index{param@{param}!mm_param_setvalue@{mm\_\-param\_\-setvalue}}
\index{mm_param_setvalue@{mm\_\-param\_\-setvalue}!param@{param}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mm\_\-param\_\-setvalue (struct mm\_\-param $\ast$ {\em param}, const char $\ast$ {\em value}, int {\em copy})}\label{group__param_gca3e636ab5700462eb32ca5bc19e4cc6}


Sets the value of the given MIME parameter

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]A valid MIME parameter object \item[{\em name}]The new value for the parameter \item[{\em copy}]If set to $>$ 0, copy the value stored in value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The address of the previous value for passing to free() \end{Desc}
