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


These functions provide general initialization and shut down functions.  


\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct__Eina__Version}{\+\_\+\+Eina\+\_\+\+Version}}
\begin{DoxyCompactList}\small\item\em The version of Eina. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eina__Main__Group_gaec297cd01c3347fef43f823a64e6a50b}\label{group__Eina__Main__Group_gaec297cd01c3347fef43f823a64e6a50b}} 
\#define \mbox{\hyperlink{group__Eina__Main__Group_gaec297cd01c3347fef43f823a64e6a50b}{EINA\+\_\+\+VERSION\+\_\+\+MAJOR}}~EFL\+\_\+\+VERSION\+\_\+\+MAJOR
\begin{DoxyCompactList}\small\item\em Definition for the major version of Eina. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Main__Group_ga53cc988032e4f0422ea6c6f779a6708a}\label{group__Eina__Main__Group_ga53cc988032e4f0422ea6c6f779a6708a}} 
\#define \mbox{\hyperlink{group__Eina__Main__Group_ga53cc988032e4f0422ea6c6f779a6708a}{EINA\+\_\+\+VERSION\+\_\+\+MINOR}}~EFL\+\_\+\+VERSION\+\_\+\+MINOR
\begin{DoxyCompactList}\small\item\em Definition for the minor version of Eina. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}\label{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}} 
typedef struct \mbox{\hyperlink{struct__Eina__Version}{\+\_\+\+Eina\+\_\+\+Version}} \mbox{\hyperlink{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}{Eina\+\_\+\+Version}}
\begin{DoxyCompactList}\small\item\em The version of Eina. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\+\_\+init}} (void)
\begin{DoxyCompactList}\small\item\em Initializes the Eina library. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\+\_\+shutdown}} (void)
\begin{DoxyCompactList}\small\item\em Shuts down the Eina library. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Eina__Main__Group_ga0a3c3c05d0af48b97abc6bb9b0ef21fc}{eina\+\_\+threads\+\_\+init}} (void)
\begin{DoxyCompactList}\small\item\em Initializes the mutexes of the Eina library. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Eina__Main__Group_gad9568a340ec8d847fa715908ad7c8e71}{eina\+\_\+threads\+\_\+shutdown}} (void)
\begin{DoxyCompactList}\small\item\em Shuts down mutexes in the Eina library. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eina__Main__Group_gac0bb65af20820b4c4bfbc0c055af8175}{eina\+\_\+main\+\_\+loop\+\_\+is}} (void)
\begin{DoxyCompactList}\small\item\em Checks if you are calling this function from the same thread Eina was initialized or not. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Main__Group_gaa6f2074741fdf2873f5465c2cf4deb38}{eina\+\_\+main\+\_\+loop\+\_\+define}} (void)
\begin{DoxyCompactList}\small\item\em You should never use this function except if you really really know what your are doing. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eina__Main__Group_ga264218d30b20ed41349782fa603892b1}\label{group__Eina__Main__Group_ga264218d30b20ed41349782fa603892b1}} 
\mbox{\hyperlink{group__Eina__Main__Group_ga78a3169043077944751062be463cc212}{Eina\+\_\+\+Version}} $\ast$ \mbox{\hyperlink{group__Eina__Main__Group_ga264218d30b20ed41349782fa603892b1}{eina\+\_\+version}}
\begin{DoxyCompactList}\small\item\em Eina version (defined at configuration time) \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Main__Group_ga5e34bbb463538af064c17967ff6aadd9}\label{group__Eina__Main__Group_ga5e34bbb463538af064c17967ff6aadd9}} 
\mbox{\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error}} {\bfseries EINA\+\_\+\+ERROR\+\_\+\+NOT\+\_\+\+IMPLEMENTED}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
These functions provide general initialization and shut down functions. 



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}\label{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}} 
\index{Main@{Main}!eina\_init@{eina\_init}}
\index{eina\_init@{eina\_init}!Main@{Main}}
\doxysubsubsection{\texorpdfstring{eina\_init()}{eina\_init()}}
{\footnotesize\ttfamily int eina\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Initializes the Eina library. 

\begin{DoxyReturn}{Returns}
{\ttfamily 1} or greater on success, {\ttfamily 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 \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\+\_\+shutdown()}} to shut down the Eina library.

This function is affected by the following environment variables.

Logging environment variables\+:

\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+ABORT=1} will cause abort(3) if {\ttfamily EINA\+\_\+\+LOG\+\_\+\+ABORT\+\_\+\+LEVEL}, which defaults to 0 (critical), is reached.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+ABORT\+\_\+\+LEVEL=LEVEL}, where level is an integer such as 0 (critical) to 4 (debug). This will cause any messages at that level or lower (i.\+e.\+: if 4, then messages at level 0 also apply) to abort(3) the application if {\ttfamily EINA\+\_\+\+LOG\+\_\+\+ABORT=1} was defined.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+BACKTRACE=LEVEL}, where level is an integer such as 0 (critical) to 4 (debug). This will cause any messages at that level or lower (i.\+e.\+: if 4, then messages at level 0 also apply) to dump a backtrace. Note that if systemd-\/journal is used, it\textquotesingle{}s going to the journal as well.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+COLOR\+\_\+\+DISABLE=}\mbox{[}0$\vert$1\mbox{]} if {\ttfamily 1} it will disable color in log output. If it\textquotesingle{}s {\ttfamily 0}, it will keep colors. By default it will use colors if it\textquotesingle{}s a TTY, disabling colors if it\textquotesingle{}s printing to a file.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+FILE\+\_\+\+DISABLE=}\mbox{[}0$\vert$1\mbox{]} if {\ttfamily 1} it will disable showing the source file name and line that generated the message. If {\ttfamily 0}, the default, it will show the source file and line.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+FUNCTION\+\_\+\+DISABLE=}\mbox{[}0$\vert$1\mbox{]} if {\ttfamily 1} it will disable showing the source function name that generated the message. If {\ttfamily 0}, the default, it will show the function name.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+LEVEL=LEVEL}, where level is an integer such as 0 (critical) to 4 (debug), where the number is the the highest level to print, that is, using level=4 will lead to messages of level 1, 2 and 3 to be displayed as well, but not level
\begin{DoxyEnumerate}
\item This will control all log domains at once and has lower priority than {\ttfamily EINA\+\_\+\+LOG\+\_\+\+LEVELS}, that defines per-\/domain.
\end{DoxyEnumerate}\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+LEVELS=DOMAIN1\+:LEVEL1},DOMAIN2\+:LEVEL2 is a comma separated list of tuples of DOMAIN and LEVEL values separated by a colon. Level is an integer such as 0 (critical) to 4 (debug), where the number is the the highest level to print, that is, using level=4 will lead to messages of level 1, 2 and 3 to be displayed as well, but not level 5. This offers fine grained control, allowing a single domain to be printed at debug (4) while keeping others at error (1) only. For instance {\ttfamily EINA\+\_\+\+LOG\+\_\+\+LEVELS=eina\+:2},eina\+\_\+binshare\+:4 will change eina\textquotesingle{}s general purpose logging domain to warning (2) while will make the specific eina\+\_\+binshare debug (4).\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+LOG\+\_\+\+LEVELS\+\_\+\+GLOB=PATTERN1\+:LEVEL1},PATTERN2\+:LEVEL2 is a comma separated list of tuples of domain PATTERN and LEVEL values separated by a colon. PATTERN is a fnmatch(3) pattern that will try to match the domain name. Level is an integer such as 0 (critical) to 4 (debug), where the number is the the highest level to print, that is, using level=4 will lead to messages of level 1, 2 and 3 to be displayed as well, but not level 5. This offers fine grained control, allowing a single domain to be printed at debug (4) while keeping others at error (1) only. For instance {\ttfamily EINA\+\_\+\+LOG\+\_\+\+LEVELS\+\_\+\+GLOB=eina$\ast$}\+:4 will change all domain names starting with \char`\"{}eina\char`\"{}, such as \char`\"{}eina\char`\"{} (general purpose log domain) and \char`\"{}eina\+\_\+binshare\char`\"{}.\end{DoxyItemize}
Memory allocator environment variables\+:

\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+MEMPOOL=mempool\+\_\+allocator} will choose another memory allocator to use. Commonly this is given {\ttfamily pass\+\_\+through} as the {\ttfamily mempool\+\_\+allocator} to allow valgrind and other tools to debug it more easily.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+MEMPOOL\+\_\+\+PASS=1} has the almost the same effect of {\ttfamily EINA\+\_\+\+MEMPOOL=pass\+\_\+through}, but if pass\+\_\+through allocator wasn\textquotesingle{}t built, it will use the original allocator.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+MTRACE=1} and {\ttfamily MALLOC\+\_\+\+TRACE=PATH} will use mtrace(3) and store the memory allocation traces to given {\ttfamily PATH}.\end{DoxyItemize}
Module loading environment variables\+:

\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+MODULE\+\_\+\+LAZY\+\_\+\+LOAD=1} will dlopen(3) with RTLD\+\_\+\+LAZY, this results in faster startup since symbols will be resolved when needed, but may omit errors as they will be triggered later on.\end{DoxyItemize}
Threads environment variables\+:

\begin{DoxyItemize}
\item {\ttfamily EINA\+\_\+\+DEBUG\+\_\+\+THREADS=1} will print out debug information about threads, but requires Eina to be compiled with such feature. \end{DoxyItemize}


References eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register(), EINA\+\_\+\+ERROR\+\_\+\+NOT\+\_\+\+MAIN\+\_\+\+LOOP, EINA\+\_\+\+FREEQ\+\_\+\+DEFAULT, eina\+\_\+freeq\+\_\+new(), EINA\+\_\+\+LIKELY, EINA\+\_\+\+LOG\+\_\+\+COLOR\+\_\+\+DEFAULT, eina\+\_\+log\+\_\+domain\+\_\+register(), EINA\+\_\+\+LOG\+\_\+\+ERR, and ERR.



Referenced by ecore\+\_\+con\+\_\+init(), ecore\+\_\+drm2\+\_\+init(), ecore\+\_\+drm\+\_\+init(), ecore\+\_\+init(), ecore\+\_\+win32\+\_\+init(), ecore\+\_\+wl2\+\_\+init(), ecore\+\_\+wl\+\_\+init(), ector\+\_\+init(), edje\+\_\+init(), eet\+\_\+init(), eeze\+\_\+init(), efreet\+\_\+init(), eio\+\_\+init(), eldbus\+\_\+init(), elm\+\_\+quicklaunch\+\_\+init(), elput\+\_\+init(), elua\+\_\+init(), embryo\+\_\+init(), emile\+\_\+init(), ethumb\+\_\+client\+\_\+init(), and evas\+\_\+init().

\mbox{\Hypertarget{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}\label{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}} 
\index{Main@{Main}!eina\_shutdown@{eina\_shutdown}}
\index{eina\_shutdown@{eina\_shutdown}!Main@{Main}}
\doxysubsubsection{\texorpdfstring{eina\_shutdown()}{eina\_shutdown()}}
{\footnotesize\ttfamily int eina\+\_\+shutdown (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Shuts down the Eina library. 

\begin{DoxyReturn}{Returns}
{\ttfamily 0} when all the modules are completely shut down, {\ttfamily 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 \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\+\_\+init()}}. In that case it shuts down all the Eina modules.

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

References eina\+\_\+freeq\+\_\+free(), eina\+\_\+freeq\+\_\+main\+\_\+get(), EINA\+\_\+\+LOG\+\_\+\+STATE\+\_\+\+SHUTDOWN, EINA\+\_\+\+LOG\+\_\+\+STATE\+\_\+\+START, eina\+\_\+log\+\_\+timing(), EINA\+\_\+\+UNLIKELY, and ERR.



Referenced by ecore\+\_\+con\+\_\+init(), ecore\+\_\+con\+\_\+shutdown(), ecore\+\_\+drm\+\_\+init(), ecore\+\_\+win32\+\_\+init(), ecore\+\_\+win32\+\_\+shutdown(), ecore\+\_\+x\+\_\+init(), ecore\+\_\+x\+\_\+init\+\_\+from\+\_\+display(), ector\+\_\+init(), ector\+\_\+shutdown(), eet\+\_\+init(), eet\+\_\+shutdown(), eeze\+\_\+init(), eeze\+\_\+shutdown(), efreet\+\_\+init(), efreet\+\_\+shutdown(), eldbus\+\_\+init(), elua\+\_\+shutdown(), embryo\+\_\+init(), embryo\+\_\+shutdown(), emile\+\_\+init(), emile\+\_\+shutdown(), emotion\+\_\+shutdown(), evas\+\_\+init(), and evas\+\_\+shutdown().

\mbox{\Hypertarget{group__Eina__Main__Group_ga0a3c3c05d0af48b97abc6bb9b0ef21fc}\label{group__Eina__Main__Group_ga0a3c3c05d0af48b97abc6bb9b0ef21fc}} 
\index{Main@{Main}!eina\_threads\_init@{eina\_threads\_init}}
\index{eina\_threads\_init@{eina\_threads\_init}!Main@{Main}}
\doxysubsubsection{\texorpdfstring{eina\_threads\_init()}{eina\_threads\_init()}}
{\footnotesize\ttfamily int eina\+\_\+threads\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Initializes the mutexes of the Eina library. 

\begin{DoxyReturn}{Returns}
{\ttfamily 1} or greater on success, {\ttfamily 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 \mbox{\hyperlink{group__Eina__Main__Group_gad9568a340ec8d847fa715908ad7c8e71}{eina\+\_\+threads\+\_\+shutdown()}} to shut down the mutexes.

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

References EINA\+\_\+\+TRUE.



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

\mbox{\Hypertarget{group__Eina__Main__Group_gad9568a340ec8d847fa715908ad7c8e71}\label{group__Eina__Main__Group_gad9568a340ec8d847fa715908ad7c8e71}} 
\index{Main@{Main}!eina\_threads\_shutdown@{eina\_threads\_shutdown}}
\index{eina\_threads\_shutdown@{eina\_threads\_shutdown}!Main@{Main}}
\doxysubsubsection{\texorpdfstring{eina\_threads\_shutdown()}{eina\_threads\_shutdown()}}
{\footnotesize\ttfamily int eina\+\_\+threads\+\_\+shutdown (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Shuts down mutexes in the Eina library. 

\begin{DoxyReturn}{Returns}
{\ttfamily 0} when all mutexes are completely shut down, {\ttfamily 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 \mbox{\hyperlink{group__Eina__Main__Group_ga0a3c3c05d0af48b97abc6bb9b0ef21fc}{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 functions in a thread anymore. You must call \mbox{\hyperlink{group__Eina__Main__Group_ga0a3c3c05d0af48b97abc6bb9b0ef21fc}{eina\+\_\+threads\+\_\+init()}} again to use the Eina functions in a thread again.

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

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

\mbox{\Hypertarget{group__Eina__Main__Group_gac0bb65af20820b4c4bfbc0c055af8175}\label{group__Eina__Main__Group_gac0bb65af20820b4c4bfbc0c055af8175}} 
\index{Main@{Main}!eina\_main\_loop\_is@{eina\_main\_loop\_is}}
\index{eina\_main\_loop\_is@{eina\_main\_loop\_is}!Main@{Main}}
\doxysubsubsection{\texorpdfstring{eina\_main\_loop\_is()}{eina\_main\_loop\_is()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eina\+\_\+main\+\_\+loop\+\_\+is (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



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

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}} is the calling function is the same thread, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}} otherwise.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+1.\+0
\end{DoxySince}
Most EFL functions are not thread safe and all the calls need to happen in the main loop. With this call you could know if you can call an EFL function or not. 

References EINA\+\_\+\+FALSE, and EINA\+\_\+\+TRUE.



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().

\mbox{\Hypertarget{group__Eina__Main__Group_gaa6f2074741fdf2873f5465c2cf4deb38}\label{group__Eina__Main__Group_gaa6f2074741fdf2873f5465c2cf4deb38}} 
\index{Main@{Main}!eina\_main\_loop\_define@{eina\_main\_loop\_define}}
\index{eina\_main\_loop\_define@{eina\_main\_loop\_define}!Main@{Main}}
\doxysubsubsection{\texorpdfstring{eina\_main\_loop\_define()}{eina\_main\_loop\_define()}}
{\footnotesize\ttfamily void eina\+\_\+main\+\_\+loop\+\_\+define (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



You should never use this function except 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\textquotesingle{}t know what is the purpose of this call and you should just not use it.

You should never use this function except if you really really know what your are doing. 

Referenced by ecore\+\_\+fork\+\_\+reset(), ecore\+\_\+thread\+\_\+main\+\_\+loop\+\_\+begin(), and elm\+\_\+quicklaunch\+\_\+fork().

