\section{aversive\_\-10-03-12/modules/ihm/menu/menu.c File Reference}
\label{menu_8c}\index{aversive\_\-10-03-12/modules/ihm/menu/menu.c@{aversive\_\-10-03-12/modules/ihm/menu/menu.c}}
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$aversive.h$>$}\par
{\tt \#include \char`\"{}menu.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
char $\ast$ {\bf menu\_\-get\_\-name} (struct {\bf menu} $\ast$m)
\item 
uint8\_\-t {\bf menu\_\-get\_\-type} (struct {\bf menu} $\ast$m)
\item 
uint8\_\-t {\bf menu\_\-call\_\-fct} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-previous} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-next} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-parent} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-first\_\-son} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-sub} (struct {\bf menu} $\ast$m, uint8\_\-t num)
\item 
uint8\_\-t {\bf menu\_\-get\_\-sub\_\-howmany} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-left} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-right} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-up} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-down} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-default\_\-update} (struct {\bf menu} $\ast$m, char c)
\item 
void {\bf menu\_\-default\_\-display} (struct {\bf menu} $\ast$m)
\end{CompactItemize}


\subsection{Function Documentation}
\index{menu.c@{menu.c}!menu\_\-call\_\-fct@{menu\_\-call\_\-fct}}
\index{menu\_\-call\_\-fct@{menu\_\-call\_\-fct}!menu.c@{menu.c}}
\subsubsection[menu\_\-call\_\-fct]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t menu\_\-call\_\-fct (struct {\bf menu} $\ast$ {\em m})}\label{menu_8c_b5127423f815bab6488e95db6244ce42}


call the function described by the \doxyref{menu}{p.}{structmenu}, and return 0 on success 

Definition at line 64 of file menu.c.

References parse\_\-symbols::f, MENU\_\-TYPE\_\-FCT\_\-DATA, MENU\_\-TYPE\_\-FCT\_\-HDR, MENU\_\-TYPE\_\-FCT\_\-PTR, and menu::type.

Referenced by menu\_\-right().\index{menu.c@{menu.c}!menu\_\-default\_\-display@{menu\_\-default\_\-display}}
\index{menu\_\-default\_\-display@{menu\_\-default\_\-display}!menu.c@{menu.c}}
\subsubsection[menu\_\-default\_\-display]{\setlength{\rightskip}{0pt plus 5cm}void menu\_\-default\_\-display (struct {\bf menu} $\ast$ {\em m})}\label{menu_8c_ad0d7840c7c16a4c087829fe21e12b31}


default function to display a \doxyref{menu}{p.}{structmenu}, you can reimplement it 

Definition at line 328 of file menu.c.

References i, menu\_\-get\_\-name(), menu\_\-get\_\-parent(), menu\_\-get\_\-sub(), and menu\_\-get\_\-sub\_\-howmany().\index{menu.c@{menu.c}!menu\_\-default\_\-update@{menu\_\-default\_\-update}}
\index{menu\_\-default\_\-update@{menu\_\-default\_\-update}!menu.c@{menu.c}}
\subsubsection[menu\_\-default\_\-update]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-default\_\-update (struct {\bf menu} $\ast$ {\em m}, \/  char {\em c})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_75c6f3b5a07b6c48bf275535878f2757}


move in the \doxyref{menu}{p.}{structmenu}, depending on the action 

Definition at line 299 of file menu.c.

References menu\_\-down(), menu\_\-get\_\-parent(), menu\_\-get\_\-sub(), menu\_\-left(), menu\_\-right(), MENU\_\-TYPE\_\-ROOT, menu\_\-up(), and menu::type.\index{menu.c@{menu.c}!menu\_\-down@{menu\_\-down}}
\index{menu\_\-down@{menu\_\-down}!menu.c@{menu.c}}
\subsubsection[menu\_\-down]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-down (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_0da12eec795a34a3313415d4803cc67c}


return the next \doxyref{menu}{p.}{structmenu} on same level (if it is the first, go back to the end 

Definition at line 274 of file menu.c.

References menu\_\-get\_\-next(), and menu\_\-get\_\-previous().

Referenced by menu\_\-default\_\-update().\index{menu.c@{menu.c}!menu\_\-get\_\-first\_\-son@{menu\_\-get\_\-first\_\-son}}
\index{menu\_\-get\_\-first\_\-son@{menu\_\-get\_\-first\_\-son}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-first\_\-son]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-first\_\-son (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_9b90889004ace877dd4797d6c32347ff}


return first son or NULL if there is no son 

Definition at line 178 of file menu.c.

Referenced by menu\_\-get\_\-sub(), menu\_\-get\_\-sub\_\-howmany(), and menu\_\-right().\index{menu.c@{menu.c}!menu\_\-get\_\-name@{menu\_\-get\_\-name}}
\index{menu\_\-get\_\-name@{menu\_\-get\_\-name}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-name]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ menu\_\-get\_\-name (struct {\bf menu} $\ast$ {\em m})}\label{menu_8c_2123b2017c94bdc32a8d83c752ae7ad8}


return name of a \doxyref{menu}{p.}{structmenu}, if the type is correct 

Definition at line 34 of file menu.c.

References menu::data, MENU\_\-TYPE\_\-FCT\_\-HDR, MENU\_\-TYPE\_\-MENU, MENU\_\-TYPE\_\-ROOT, and menu::type.

Referenced by menu\_\-default\_\-display().\index{menu.c@{menu.c}!menu\_\-get\_\-next@{menu\_\-get\_\-next}}
\index{menu\_\-get\_\-next@{menu\_\-get\_\-next}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-next]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-next (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_49376d656f65aa69f945a3337a6a0762}


get next \doxyref{menu}{p.}{structmenu} on same level, return NULL if no one 

Definition at line 120 of file menu.c.

References MENU\_\-TYPE\_\-END, MENU\_\-TYPE\_\-FCT\_\-HDR, MENU\_\-TYPE\_\-MENU, MENU\_\-TYPE\_\-ROOT, and menu::type.

Referenced by menu\_\-down(), menu\_\-get\_\-sub(), menu\_\-get\_\-sub\_\-howmany(), and menu\_\-up().\index{menu.c@{menu.c}!menu\_\-get\_\-parent@{menu\_\-get\_\-parent}}
\index{menu\_\-get\_\-parent@{menu\_\-get\_\-parent}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-parent]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-parent (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_2113bfefb0ce9cc773fe06d16001db25}


get the parent of the \doxyref{menu}{p.}{structmenu} - return NULL if no parent 

Definition at line 154 of file menu.c.

References menu\_\-get\_\-previous(), MENU\_\-TYPE\_\-ROOT, and menu::type.

Referenced by menu\_\-default\_\-display(), menu\_\-default\_\-update(), and menu\_\-left().\index{menu.c@{menu.c}!menu\_\-get\_\-previous@{menu\_\-get\_\-previous}}
\index{menu\_\-get\_\-previous@{menu\_\-get\_\-previous}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-previous]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-previous (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_c8bf20f304fa210b6d97e575b23d0781}


get previous \doxyref{menu}{p.}{structmenu} on same level, return NULL if no one 

Definition at line 87 of file menu.c.

References MENU\_\-TYPE\_\-END, MENU\_\-TYPE\_\-FCT\_\-HDR, MENU\_\-TYPE\_\-MENU, MENU\_\-TYPE\_\-ROOT, and menu::type.

Referenced by menu\_\-down(), menu\_\-get\_\-parent(), and menu\_\-up().\index{menu.c@{menu.c}!menu\_\-get\_\-sub@{menu\_\-get\_\-sub}}
\index{menu\_\-get\_\-sub@{menu\_\-get\_\-sub}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-sub]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-sub (struct {\bf menu} $\ast$ {\em m}, \/  uint8\_\-t {\em num})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_f75106c92662aa4087311f0778a32df2}


get the submenu 'num' -$>$ can return NULL if does not exist 

Definition at line 190 of file menu.c.

References menu\_\-get\_\-first\_\-son(), and menu\_\-get\_\-next().

Referenced by menu\_\-default\_\-display(), and menu\_\-default\_\-update().\index{menu.c@{menu.c}!menu\_\-get\_\-sub\_\-howmany@{menu\_\-get\_\-sub\_\-howmany}}
\index{menu\_\-get\_\-sub\_\-howmany@{menu\_\-get\_\-sub\_\-howmany}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-sub\_\-howmany]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t menu\_\-get\_\-sub\_\-howmany (struct {\bf menu} $\ast$ {\em m})}\label{menu_8c_767ed854209b296382c34ea4f3a40546}


return number of submenus in a \doxyref{menu}{p.}{structmenu} 

Definition at line 203 of file menu.c.

References menu\_\-get\_\-first\_\-son(), and menu\_\-get\_\-next().

Referenced by menu\_\-default\_\-display().\index{menu.c@{menu.c}!menu\_\-get\_\-type@{menu\_\-get\_\-type}}
\index{menu\_\-get\_\-type@{menu\_\-get\_\-type}!menu.c@{menu.c}}
\subsubsection[menu\_\-get\_\-type]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t menu\_\-get\_\-type (struct {\bf menu} $\ast$ {\em m})}\label{menu_8c_11a396cd006d454bb584feab7f3259b9}


return type of a \doxyref{menu}{p.}{structmenu} 

Definition at line 47 of file menu.c.

References MENU\_\-TYPE\_\-UNKNOWN, and menu::type.\index{menu.c@{menu.c}!menu\_\-left@{menu\_\-left}}
\index{menu\_\-left@{menu\_\-left}!menu.c@{menu.c}}
\subsubsection[menu\_\-left]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-left (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_181625db1ec09e267a4756644ae538dd}


get the parent of the \doxyref{menu}{p.}{structmenu} - never return NULL except if m is null 

Definition at line 219 of file menu.c.

References menu\_\-get\_\-parent().

Referenced by menu\_\-default\_\-update().\index{menu.c@{menu.c}!menu\_\-right@{menu\_\-right}}
\index{menu\_\-right@{menu\_\-right}!menu.c@{menu.c}}
\subsubsection[menu\_\-right]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-right (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_33fb8db3ebecfbab3900a5e0d39fccf8}


get the son number 'num' or self if it does not exist, try to call the function if it exists, does not return null except if m is null 

Definition at line 235 of file menu.c.

References menu\_\-call\_\-fct(), and menu\_\-get\_\-first\_\-son().

Referenced by menu\_\-default\_\-update().\index{menu.c@{menu.c}!menu\_\-up@{menu\_\-up}}
\index{menu\_\-up@{menu\_\-up}!menu.c@{menu.c}}
\subsubsection[menu\_\-up]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-up (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8c_cb3303048b2d6514e77a3f4fd05c1c98}


return the next \doxyref{menu}{p.}{structmenu} on same level (if it is the last, go back to beginning 

Definition at line 250 of file menu.c.

References menu\_\-get\_\-next(), and menu\_\-get\_\-previous().

Referenced by menu\_\-default\_\-update().