\hypertarget{extra_8c}{
\section{extra.c File Reference}
\label{extra_8c}\index{extra.c@{extra.c}}
}
File that contains functions common to other files.  


{\tt \#include \char`\"{}h1.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{extra_8c_028ba4d4813359e47c925aec2e9d6fd3}{GetSharedMem} (char $\ast$token)
\begin{CompactList}\small\item\em Gets a shared memory and connects to it. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
File that contains functions common to other files. 

\begin{Desc}
\item[Author:]Bruno Andrade nº35606 \end{Desc}


Definition in file \hyperlink{extra_8c-source}{extra.c}.

\subsection{Function Documentation}
\hypertarget{extra_8c_028ba4d4813359e47c925aec2e9d6fd3}{
\index{extra.c@{extra.c}!GetSharedMem@{GetSharedMem}}
\index{GetSharedMem@{GetSharedMem}!extra.c@{extra.c}}
\subsubsection[{GetSharedMem}]{\setlength{\rightskip}{0pt plus 5cm}int GetSharedMem (char $\ast$ {\em token})}}
\label{extra_8c_028ba4d4813359e47c925aec2e9d6fd3}


Gets a shared memory and connects to it. 

The function first creates a random key to identify the memory and then connects to it with some specific permissions. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em token}]\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]int. The Shared memory ID. Returns -1 in case of failure. \end{Desc}


Definition at line 15 of file extra.c.