\hypertarget{group__Eina__Main__Group}{\section{Main}
\label{group__Eina__Main__Group}\index{Main@{Main}}
}


These functions provide general initialisation and shut down functions.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{struct__Eina__Version}{\+\_\+\+Eina\+\_\+\+Version}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eina__Main__Group_gaec297cd01c3347fef43f823a64e6a50b}{\#define \hyperlink{group__Eina__Main__Group_gaec297cd01c3347fef43f823a64e6a50b}{E\+I\+N\+A\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+A\+J\+O\+R}~E\+F\+L\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+A\+J\+O\+R}\label{group__Eina__Main__Group_gaec297cd01c3347fef43f823a64e6a50b}

\begin{DoxyCompactList}\small\item\em Major version of Eina. \end{DoxyCompactList}\item 
\hypertarget{group__Eina__Main__Group_ga53cc988032e4f0422ea6c6f779a6708a}{\#define \hyperlink{group__Eina__Main__Group_ga53cc988032e4f0422ea6c6f779a6708a}{E\+I\+N\+A\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+I\+N\+O\+R}~E\+F\+L\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+I\+N\+O\+R}\label{group__Eina__Main__Group_ga53cc988032e4f0422ea6c6f779a6708a}

\begin{DoxyCompactList}\small\item\em Minor version of Eina. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}{typedef struct \hyperlink{struct__Eina__Version}{\+\_\+\+Eina\+\_\+\+Version} \hyperlink{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}{Eina\+\_\+\+Version}}\label{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}

\begin{DoxyCompactList}\small\item\em The version of Eina. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\+\_\+init} (void)
\begin{DoxyCompactList}\small\item\em Initialize the Eina library. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{eina\+\_\+shutdown} (void)
\begin{DoxyCompactList}\small\item\em Shut down the Eina library. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eina__Main__Group_ga2ea878740d91610bb8a2e37d6669d2fe}{eina\+\_\+threads\+\_\+init} (void)
\begin{DoxyCompactList}\small\item\em Initialize the mutexes of the Eina library. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eina__Main__Group_gad833c403983ce5bf868ffa319f84520b}{eina\+\_\+threads\+\_\+shutdown} (void)
\begin{DoxyCompactList}\small\item\em Shut down mutexes in the Eina library. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eina__Main__Group_ga48b0529d6caabd9592d36ffa883f2299}{eina\+\_\+main\+\_\+loop\+\_\+is} (void)
\begin{DoxyCompactList}\small\item\em Check if you are calling this function from the same thread Eina was initialized or not. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Eina__Main__Group_gaabee95c9cb6e59232a1eacb68a5c22c2}{eina\+\_\+main\+\_\+loop\+\_\+define} (void)
\begin{DoxyCompactList}\small\item\em You should never use that function excpet if you really really know what your are doing. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eina__Main__Group_ga877c3818368b8b8de82cd6956c3872a5}{\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}{Eina\+\_\+\+Version} $\ast$ \hyperlink{group__Eina__Main__Group_ga877c3818368b8b8de82cd6956c3872a5}{eina\+\_\+version}}\label{group__Eina__Main__Group_ga877c3818368b8b8de82cd6956c3872a5}

\begin{DoxyCompactList}\small\item\em Eina version (defined at configuration time) \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
These functions provide general initialisation and shut down functions. 



\subsection{Function Documentation}
\hypertarget{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{\index{Main@{Main}!eina\+\_\+init@{eina\+\_\+init}}
\index{eina\+\_\+init@{eina\+\_\+init}!Main@{Main}}
\subsubsection[{eina\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eina\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}


Initialize the Eina library. 

\begin{DoxyReturn}{Returns}
1 or greater on success, 0 on error.
\end{DoxyReturn}
This function sets up all the eina modules. It returns 0 on failure (that is, when one of the module fails to initialize), otherwise it returns the number of times it has already been called.

When Eina is not used anymore, call \hyperlink{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{eina\+\_\+shutdown()} to shut down the Eina library. 

References E\+I\+N\+A\+\_\+\+L\+I\+K\+E\+L\+Y, E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+C\+O\+L\+O\+R\+\_\+\+D\+E\+F\+A\+U\+L\+T, eina\+\_\+log\+\_\+domain\+\_\+register(), E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+E\+R\+R, E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+S\+T\+A\+T\+E\+\_\+\+I\+N\+I\+T, eina\+\_\+log\+\_\+timing(), and E\+R\+R.



Referenced by ecore\+\_\+drm\+\_\+init(), ecore\+\_\+init(), ecore\+\_\+win32\+\_\+init(), ecore\+\_\+wl\+\_\+init(), ecore\+\_\+x\+\_\+init(), edje\+\_\+init(), eet\+\_\+init(), eeze\+\_\+init(), efreet\+\_\+init(), efreet\+\_\+trash\+\_\+init(), eio\+\_\+init(), eldbus\+\_\+init(), emotion\+\_\+init(), ethumb\+\_\+client\+\_\+init(), ethumb\+\_\+init(), and evas\+\_\+init().

\hypertarget{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{\index{Main@{Main}!eina\+\_\+shutdown@{eina\+\_\+shutdown}}
\index{eina\+\_\+shutdown@{eina\+\_\+shutdown}!Main@{Main}}
\subsubsection[{eina\+\_\+shutdown}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eina\+\_\+shutdown (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}


Shut down the Eina library. 

\begin{DoxyReturn}{Returns}
0 when all the modules are completely shut down, 1 or greater otherwise.
\end{DoxyReturn}
This function shuts down the Eina library. It returns 0 when it has been called the same number of times than \hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\+\_\+init()}. In that case it shut down all the Eina modules.

Once this function succeeds (that is, {\ttfamily 0} is returned), you must not call any of the Eina function anymore. You must call \hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\+\_\+init()} again to use the Eina functions again. 

References E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+H\+U\+T\+D\+O\+W\+N, eina\+\_\+log\+\_\+timing(), E\+I\+N\+A\+\_\+\+U\+N\+L\+I\+K\+E\+L\+Y, and E\+R\+R.



Referenced by ecore\+\_\+drm\+\_\+init(), ecore\+\_\+drm\+\_\+shutdown(), ecore\+\_\+init(), ecore\+\_\+shutdown(), ecore\+\_\+win32\+\_\+init(), ecore\+\_\+win32\+\_\+shutdown(), ecore\+\_\+wl\+\_\+init(), ecore\+\_\+x\+\_\+init(), edje\+\_\+init(), eet\+\_\+init(), eet\+\_\+shutdown(), eeze\+\_\+init(), eeze\+\_\+shutdown(), efreet\+\_\+init(), efreet\+\_\+shutdown(), efreet\+\_\+trash\+\_\+init(), efreet\+\_\+trash\+\_\+shutdown(), eio\+\_\+init(), eio\+\_\+shutdown(), eldbus\+\_\+init(), eldbus\+\_\+shutdown(), emotion\+\_\+init(), emotion\+\_\+shutdown(), ethumb\+\_\+client\+\_\+init(), ethumb\+\_\+client\+\_\+shutdown(), ethumb\+\_\+init(), ethumb\+\_\+shutdown(), evas\+\_\+init(), and evas\+\_\+shutdown().

\hypertarget{group__Eina__Main__Group_ga2ea878740d91610bb8a2e37d6669d2fe}{\index{Main@{Main}!eina\+\_\+threads\+\_\+init@{eina\+\_\+threads\+\_\+init}}
\index{eina\+\_\+threads\+\_\+init@{eina\+\_\+threads\+\_\+init}!Main@{Main}}
\subsubsection[{eina\+\_\+threads\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eina\+\_\+threads\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Main__Group_ga2ea878740d91610bb8a2e37d6669d2fe}


Initialize the mutexes of the Eina library. 

\begin{DoxyReturn}{Returns}
1 or greater on success, 0 on error.
\end{DoxyReturn}
This function sets up all the mutexes in all eina modules. It returns 0 on failure (that is, when one of the module fails to initialize), otherwise it returns the number of times it has already been called.

When the mutexes are not used anymore, call \hyperlink{group__Eina__Main__Group_gad833c403983ce5bf868ffa319f84520b}{eina\+\_\+threads\+\_\+shutdown()} to shut down the mutexes.

This function should never be called outside of the main loop. 

References E\+I\+N\+A\+\_\+\+T\+R\+U\+E.



Referenced by ecore\+\_\+thread\+\_\+feedback\+\_\+run(), and ecore\+\_\+thread\+\_\+run().

\hypertarget{group__Eina__Main__Group_gad833c403983ce5bf868ffa319f84520b}{\index{Main@{Main}!eina\+\_\+threads\+\_\+shutdown@{eina\+\_\+threads\+\_\+shutdown}}
\index{eina\+\_\+threads\+\_\+shutdown@{eina\+\_\+threads\+\_\+shutdown}!Main@{Main}}
\subsubsection[{eina\+\_\+threads\+\_\+shutdown}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eina\+\_\+threads\+\_\+shutdown (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Main__Group_gad833c403983ce5bf868ffa319f84520b}


Shut down mutexes in the Eina library. 

\begin{DoxyReturn}{Returns}
0 when all mutexes are completely shut down, 1 or greater otherwise.
\end{DoxyReturn}
This function shuts down the mutexes in the Eina library. It returns 0 when it has been called the same number of times than \hyperlink{group__Eina__Main__Group_ga2ea878740d91610bb8a2e37d6669d2fe}{eina\+\_\+threads\+\_\+init()}. In that case it shut down all the mutexes.

Once this function succeeds (that is, {\ttfamily 0} is returned), you must not call any of the Eina function in a thread anymore. You must call \hyperlink{group__Eina__Main__Group_ga2ea878740d91610bb8a2e37d6669d2fe}{eina\+\_\+threads\+\_\+init()} again to use the Eina functions in a thread again.

This function should never be called outside of the main loop. 

References E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, E\+I\+N\+A\+\_\+\+I\+N\+L\+I\+S\+T\+\_\+\+F\+O\+R\+E\+A\+C\+H, and eina\+\_\+lock\+\_\+debug().



Referenced by ecore\+\_\+thread\+\_\+feedback\+\_\+run(), and ecore\+\_\+thread\+\_\+run().

\hypertarget{group__Eina__Main__Group_ga48b0529d6caabd9592d36ffa883f2299}{\index{Main@{Main}!eina\+\_\+main\+\_\+loop\+\_\+is@{eina\+\_\+main\+\_\+loop\+\_\+is}}
\index{eina\+\_\+main\+\_\+loop\+\_\+is@{eina\+\_\+main\+\_\+loop\+\_\+is}!Main@{Main}}
\subsubsection[{eina\+\_\+main\+\_\+loop\+\_\+is}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} eina\+\_\+main\+\_\+loop\+\_\+is (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Main__Group_ga48b0529d6caabd9592d36ffa883f2299}


Check if you are calling this function from the same thread Eina was initialized or not. 

\begin{DoxyReturn}{Returns}
\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} is the calling function is the same thread, \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} otherwise.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+1.\+0
\end{DoxySince}
Most E\+F\+L function are not thread safe and all the call need to happen in the main loop. With this call you could know if you can call an E\+F\+L function or not. 

References E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, and E\+I\+N\+A\+\_\+\+T\+R\+U\+E.



Referenced by ecore\+\_\+main\+\_\+loop\+\_\+thread\+\_\+safe\+\_\+call\+\_\+async(), ecore\+\_\+main\+\_\+loop\+\_\+thread\+\_\+safe\+\_\+call\+\_\+sync(), ecore\+\_\+thread\+\_\+main\+\_\+loop\+\_\+begin(), ecore\+\_\+thread\+\_\+main\+\_\+loop\+\_\+end(), eina\+\_\+error\+\_\+get(), and eina\+\_\+error\+\_\+set().

\hypertarget{group__Eina__Main__Group_gaabee95c9cb6e59232a1eacb68a5c22c2}{\index{Main@{Main}!eina\+\_\+main\+\_\+loop\+\_\+define@{eina\+\_\+main\+\_\+loop\+\_\+define}}
\index{eina\+\_\+main\+\_\+loop\+\_\+define@{eina\+\_\+main\+\_\+loop\+\_\+define}!Main@{Main}}
\subsubsection[{eina\+\_\+main\+\_\+loop\+\_\+define}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void eina\+\_\+main\+\_\+loop\+\_\+define (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Main__Group_gaabee95c9cb6e59232a1eacb68a5c22c2}


You should never use that function excpet if you really really know what your are doing. 

\begin{DoxySince}{Since}
1.\+1.\+0
\end{DoxySince}
If you are reading this documentation, that certainly means you don't know what is the purpose of this call and you should just not use it.

You should never use that function excpet if you really really know what your are doing. 

Referenced by ecore\+\_\+thread\+\_\+main\+\_\+loop\+\_\+begin().

