\hypertarget{_raspi_c_l_i_8c}{}\section{/\+Volumes/\+W\+O\+R\+K\+\_\+\+I\+N\+\_\+\+P\+R\+O\+G\+R\+E\+S\+S/\+R\+A\+S\+P\+B\+E\+R\+R\+Y\+\_\+\+P\+I/github/userland/host\+\_\+applications/linux/apps/raspicam/\+Raspi\+C\+L\+I.c File Reference}
\label{_raspi_c_l_i_8c}\index{/\+Volumes/\+W\+O\+R\+K\+\_\+\+I\+N\+\_\+\+P\+R\+O\+G\+R\+E\+S\+S/\+R\+A\+S\+P\+B\+E\+R\+R\+Y\+\_\+\+P\+I/github/userland/host\+\_\+applications/linux/apps/raspicam/\+Raspi\+C\+L\+I.\+c@{/\+Volumes/\+W\+O\+R\+K\+\_\+\+I\+N\+\_\+\+P\+R\+O\+G\+R\+E\+S\+S/\+R\+A\+S\+P\+B\+E\+R\+R\+Y\+\_\+\+P\+I/github/userland/host\+\_\+applications/linux/apps/raspicam/\+Raspi\+C\+L\+I.\+c}}
{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$stdlib.\+h$>$}\\*
{\ttfamily \#include $<$string.\+h$>$}\\*
{\ttfamily \#include $<$memory.\+h$>$}\\*
{\ttfamily \#include \char`\"{}interface/vcos/vcos.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}Raspi\+C\+L\+I.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{_raspi_c_l_i_8c_a06c0dc687ddb9a0549e7ccdfe9d08a52}{raspicli\+\_\+get\+\_\+command\+\_\+id} (const \hyperlink{struct_c_o_m_m_a_n_d___l_i_s_t}{C\+O\+M\+M\+A\+N\+D\+\_\+\+L\+I\+S\+T} $\ast$commands, const int num\+\_\+commands, const char $\ast$arg, int $\ast$num\+\_\+parameters)
\item 
void \hyperlink{_raspi_c_l_i_8c_a31311751947144c959ed352431f574ea}{raspicli\+\_\+display\+\_\+help} (const \hyperlink{struct_c_o_m_m_a_n_d___l_i_s_t}{C\+O\+M\+M\+A\+N\+D\+\_\+\+L\+I\+S\+T} $\ast$commands, const int num\+\_\+commands)
\item 
int \hyperlink{_raspi_c_l_i_8c_a1d6c985c5efe4037911aab68b8fcb811}{raspicli\+\_\+map\+\_\+xref} (const char $\ast$str, const \hyperlink{structxref__t}{X\+R\+E\+F\+\_\+\+T} $\ast$map, int num\+\_\+refs)
\item 
const char $\ast$ \hyperlink{_raspi_c_l_i_8c_a0ad59097e6499a2085bbcf842e9047b9}{raspicli\+\_\+unmap\+\_\+xref} (const int en, \hyperlink{structxref__t}{X\+R\+E\+F\+\_\+\+T} $\ast$map, int num\+\_\+refs)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Code for handling command line parameters

\begin{DoxyDate}{Date}
4th March 2013 \+: James Hughes
\end{DoxyDate}
Description

Some functions/structures for command line parameter parsing 

\subsection{Function Documentation}
\hypertarget{_raspi_c_l_i_8c_a31311751947144c959ed352431f574ea}{}\index{Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}!raspicli\+\_\+display\+\_\+help@{raspicli\+\_\+display\+\_\+help}}
\index{raspicli\+\_\+display\+\_\+help@{raspicli\+\_\+display\+\_\+help}!Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}}
\subsubsection[{raspicli\+\_\+display\+\_\+help}]{\setlength{\rightskip}{0pt plus 5cm}void raspicli\+\_\+display\+\_\+help (
\begin{DoxyParamCaption}
\item[{const {\bf C\+O\+M\+M\+A\+N\+D\+\_\+\+L\+I\+S\+T} $\ast$}]{commands, }
\item[{const int}]{num\+\_\+commands}
\end{DoxyParamCaption}
)}\label{_raspi_c_l_i_8c_a31311751947144c959ed352431f574ea}
Display the list of commands in help format


\begin{DoxyParams}{Parameters}
{\em commands} & Array of command to check \\
\hline
{\em num\+\_\+command} & Number of commands in the arry \\
\hline
\end{DoxyParams}
\hypertarget{_raspi_c_l_i_8c_a06c0dc687ddb9a0549e7ccdfe9d08a52}{}\index{Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}!raspicli\+\_\+get\+\_\+command\+\_\+id@{raspicli\+\_\+get\+\_\+command\+\_\+id}}
\index{raspicli\+\_\+get\+\_\+command\+\_\+id@{raspicli\+\_\+get\+\_\+command\+\_\+id}!Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}}
\subsubsection[{raspicli\+\_\+get\+\_\+command\+\_\+id}]{\setlength{\rightskip}{0pt plus 5cm}int raspicli\+\_\+get\+\_\+command\+\_\+id (
\begin{DoxyParamCaption}
\item[{const {\bf C\+O\+M\+M\+A\+N\+D\+\_\+\+L\+I\+S\+T} $\ast$}]{commands, }
\item[{const int}]{num\+\_\+commands, }
\item[{const char $\ast$}]{arg, }
\item[{int $\ast$}]{num\+\_\+parameters}
\end{DoxyParamCaption}
)}\label{_raspi_c_l_i_8c_a06c0dc687ddb9a0549e7ccdfe9d08a52}
Convert a string from command line to a comand\+\_\+id from the list


\begin{DoxyParams}{Parameters}
{\em commands} & Array of command to check \\
\hline
{\em num\+\_\+command} & Number of commands in the array \\
\hline
{\em arg} & String to search for in the list \\
\hline
{\em num\+\_\+parameters} & Returns the number of parameters used by the command\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
command I\+D if found, -\/1 if not found 
\end{DoxyReturn}
\hypertarget{_raspi_c_l_i_8c_a1d6c985c5efe4037911aab68b8fcb811}{}\index{Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}!raspicli\+\_\+map\+\_\+xref@{raspicli\+\_\+map\+\_\+xref}}
\index{raspicli\+\_\+map\+\_\+xref@{raspicli\+\_\+map\+\_\+xref}!Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}}
\subsubsection[{raspicli\+\_\+map\+\_\+xref}]{\setlength{\rightskip}{0pt plus 5cm}int raspicli\+\_\+map\+\_\+xref (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{str, }
\item[{const {\bf X\+R\+E\+F\+\_\+\+T} $\ast$}]{map, }
\item[{int}]{num\+\_\+refs}
\end{DoxyParamCaption}
)}\label{_raspi_c_l_i_8c_a1d6c985c5efe4037911aab68b8fcb811}
Function to take a string, a mapping, and return the int equivalent 
\begin{DoxyParams}{Parameters}
{\em str} & Incoming string to match \\
\hline
{\em map} & Mapping data \\
\hline
{\em num\+\_\+refs} & The number of items in the mapping data \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The integer match for the string, or -\/1 if no match 
\end{DoxyReturn}
\hypertarget{_raspi_c_l_i_8c_a0ad59097e6499a2085bbcf842e9047b9}{}\index{Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}!raspicli\+\_\+unmap\+\_\+xref@{raspicli\+\_\+unmap\+\_\+xref}}
\index{raspicli\+\_\+unmap\+\_\+xref@{raspicli\+\_\+unmap\+\_\+xref}!Raspi\+C\+L\+I.\+c@{Raspi\+C\+L\+I.\+c}}
\subsubsection[{raspicli\+\_\+unmap\+\_\+xref}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ raspicli\+\_\+unmap\+\_\+xref (
\begin{DoxyParamCaption}
\item[{const int}]{en, }
\item[{{\bf X\+R\+E\+F\+\_\+\+T} $\ast$}]{map, }
\item[{int}]{num\+\_\+refs}
\end{DoxyParamCaption}
)}\label{_raspi_c_l_i_8c_a0ad59097e6499a2085bbcf842e9047b9}
Function to take a mmal enum (as int) and return the string equivalent 
\begin{DoxyParams}{Parameters}
{\em en} & Incoming int to match \\
\hline
{\em map} & Mapping data \\
\hline
{\em num\+\_\+refs} & The number of items in the mapping data \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
const pointer to string, or N\+U\+L\+L if no match 
\end{DoxyReturn}
