\hypertarget{group__Ecore__Init__Group}{}\section{Ecore initialization, shutdown functions and reset on fork.}
\label{group__Ecore__Init__Group}\index{Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\+\_\+init}} (void)
\begin{DoxyCompactList}\small\item\em Sets up connections, signal handlers, sockets etc. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\+\_\+shutdown}} (void)
\begin{DoxyCompactList}\small\item\em Shuts down connections, signal handlers sockets etc. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}{ecore\+\_\+init\+\_\+ex}} (int argc, char $\ast$$\ast$argv)
\begin{DoxyCompactList}\small\item\em This function will propagate the events on the main loop. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{group__Ecore__Init__Group_ga20249029330ed92dcd28161c27320508}{ecore\+\_\+shutdown\+\_\+ex}} (void)
\begin{DoxyCompactList}\small\item\em Shuts down connections, signal handlers sockets etc. \end{DoxyCompactList}\item 
E\+W\+A\+PI void \mbox{\hyperlink{group__Ecore__Init__Group_ga0447e4cf3419d48885e40080b266b374}{efl\+\_\+build\+\_\+version\+\_\+set}} (int vmaj, int vmin, int vmic, int revision, const char $\ast$flavor, const char $\ast$build\+\_\+id)
\begin{DoxyCompactList}\small\item\em Inform E\+FL of the version this application was built for. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Function Documentation}
\mbox{\Hypertarget{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}\label{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}} 
\index{Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}!ecore\+\_\+init@{ecore\+\_\+init}}
\index{ecore\+\_\+init@{ecore\+\_\+init}!Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}}
\subsubsection{\texorpdfstring{ecore\+\_\+init()}{ecore\_init()}}
{\footnotesize\ttfamily int ecore\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Sets up connections, signal handlers, sockets etc. 

\begin{DoxyReturn}{Returns}
{\ttfamily 1} or greater on success, {\ttfamily 0} otherwise.
\end{DoxyReturn}
This function sets up all singal handlers and the basic event loop. If it succeeds, {\ttfamily 1} will be returned, otherwise {\ttfamily 0} will be returned.


\begin{DoxyCode}
\textcolor{preprocessor}{#include <Ecore.h>}

\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
  \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}())
  \{
    printf(\textcolor{stringliteral}{"ERROR: Cannot init Ecore!\(\backslash\)n"});
    \textcolor{keywordflow}{return} -1;
  \}
  \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();
  \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();
\}
\end{DoxyCode}


This function is affected by some environment variables\+:

\begin{DoxyItemize}
\item {\ttfamily E\+C\+O\+R\+E\+\_\+\+N\+O\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+M\+O\+D\+U\+L\+ES=1} may be used to temporarily disable system modules, often useful for debug.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily E\+C\+O\+R\+E\+\_\+\+F\+P\+S\+\_\+\+D\+E\+B\+UG=1} prints frames per second, usefult to detect lags and blocking calls.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily E\+C\+O\+R\+E\+\_\+\+M\+E\+M\+\_\+\+S\+T\+AT=1} will generate {\ttfamily ecore\+\_\+mem\+\_\+stat}.\$\{P\+ID\} file with memory statistics.\end{DoxyItemize}
\begin{DoxyItemize}
\item {\ttfamily E\+C\+O\+R\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+A\+B\+O\+RT=1} will abort on errors.\end{DoxyItemize}
This function will call \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\+\_\+init()}}, so other environment variables may apply. 

References ecore\+\_\+init(), ecore\+\_\+main\+\_\+loop\+\_\+glib\+\_\+integrate(), ecore\+\_\+poller\+\_\+add(), E\+C\+O\+R\+E\+\_\+\+P\+O\+L\+L\+E\+R\+\_\+\+C\+O\+RE, efl\+\_\+add, efl\+\_\+object\+\_\+init(), eina\+\_\+condition\+\_\+new(), eina\+\_\+evlog(), eina\+\_\+init(), eina\+\_\+lock\+\_\+new(), eina\+\_\+log\+\_\+domain\+\_\+register(), E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+E\+RR, eina\+\_\+prefix\+\_\+new(), E\+RR, and evil\+\_\+init().



Referenced by ecore\+\_\+audio\+\_\+init(), ecore\+\_\+con\+\_\+init(), ecore\+\_\+con\+\_\+url\+\_\+init(), ecore\+\_\+drm2\+\_\+init(), ecore\+\_\+drm\+\_\+init(), ecore\+\_\+evas\+\_\+init(), ecore\+\_\+event\+\_\+init(), ecore\+\_\+file\+\_\+init(), ecore\+\_\+imf\+\_\+init(), ecore\+\_\+init(), ecore\+\_\+init\+\_\+ex(), ecore\+\_\+wl2\+\_\+init(), ecore\+\_\+wl\+\_\+init(), eeze\+\_\+init(), efreet\+\_\+init(), efreet\+\_\+mime\+\_\+init(), eio\+\_\+init(), eldbus\+\_\+init(), elocation\+\_\+init(), and elput\+\_\+init().

\mbox{\Hypertarget{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}\label{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}} 
\index{Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}!ecore\+\_\+shutdown@{ecore\+\_\+shutdown}}
\index{ecore\+\_\+shutdown@{ecore\+\_\+shutdown}!Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}}
\subsubsection{\texorpdfstring{ecore\+\_\+shutdown()}{ecore\_shutdown()}}
{\footnotesize\ttfamily int ecore\+\_\+shutdown (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Shuts down connections, signal handlers sockets etc. 

\begin{DoxyReturn}{Returns}
{\ttfamily 0} if ecore shuts down, greater than {\ttfamily 0} otherwise. This function shuts down all things set up in \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\+\_\+init()}} and cleans up all event queues, handlers, filters, timers, idlers, idle enterers/exiters etc. set up after \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\+\_\+init()}} was called.
\end{DoxyReturn}
Do not call this function from any callback that may be called from the main loop, as the main loop will then fall over and not function properly. 

References efl\+\_\+event\+\_\+callback\+\_\+call(), eina\+\_\+log\+\_\+timing(), and E\+RR.



Referenced by ecore\+\_\+audio\+\_\+init(), ecore\+\_\+con\+\_\+url\+\_\+init(), ecore\+\_\+con\+\_\+url\+\_\+shutdown(), ecore\+\_\+drm\+\_\+init(), ecore\+\_\+file\+\_\+shutdown(), ecore\+\_\+imf\+\_\+init(), ecore\+\_\+shutdown\+\_\+ex(), ecore\+\_\+x\+\_\+init(), eeze\+\_\+init(), eeze\+\_\+shutdown(), efreet\+\_\+init(), efreet\+\_\+mime\+\_\+init(), efreet\+\_\+mime\+\_\+shutdown(), efreet\+\_\+shutdown(), eldbus\+\_\+init(), elocation\+\_\+shutdown(), and emotion\+\_\+shutdown().

\mbox{\Hypertarget{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}\label{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}} 
\index{Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}!ecore\+\_\+init\+\_\+ex@{ecore\+\_\+init\+\_\+ex}}
\index{ecore\+\_\+init\+\_\+ex@{ecore\+\_\+init\+\_\+ex}!Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}}
\subsubsection{\texorpdfstring{ecore\+\_\+init\+\_\+ex()}{ecore\_init\_ex()}}
{\footnotesize\ttfamily unsigned int ecore\+\_\+init\+\_\+ex (\begin{DoxyParamCaption}\item[{int}]{argc,  }\item[{char $\ast$$\ast$}]{argv }\end{DoxyParamCaption})}



This function will propagate the events on the main loop. 

So you should call \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\+\_\+init()}} first, then register your callback on {\ttfamily E\+F\+L\+\_\+\+L\+O\+O\+P\+\_\+\+E\+V\+E\+N\+T\+\_\+\+A\+R\+G\+U\+M\+E\+N\+TS} and finally call \mbox{\hyperlink{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}{ecore\+\_\+init\+\_\+ex()}}.

Once you are shuting down your program, you should symetrically call \mbox{\hyperlink{group__Ecore__Init__Group_ga20249029330ed92dcd28161c27320508}{ecore\+\_\+shutdown\+\_\+ex()}}. 

References ecore\+\_\+app\+\_\+args\+\_\+set(), and ecore\+\_\+init().



Referenced by elm\+\_\+quicklaunch\+\_\+fork().

\mbox{\Hypertarget{group__Ecore__Init__Group_ga20249029330ed92dcd28161c27320508}\label{group__Ecore__Init__Group_ga20249029330ed92dcd28161c27320508}} 
\index{Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}!ecore\+\_\+shutdown\+\_\+ex@{ecore\+\_\+shutdown\+\_\+ex}}
\index{ecore\+\_\+shutdown\+\_\+ex@{ecore\+\_\+shutdown\+\_\+ex}!Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}}
\subsubsection{\texorpdfstring{ecore\+\_\+shutdown\+\_\+ex()}{ecore\_shutdown\_ex()}}
{\footnotesize\ttfamily unsigned int ecore\+\_\+shutdown\+\_\+ex (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Shuts down connections, signal handlers sockets etc. 

\begin{DoxyReturn}{Returns}
{\ttfamily 0} if ecore shuts down, greater than {\ttfamily 0} otherwise. This function shuts down all things set up in \mbox{\hyperlink{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}{ecore\+\_\+init\+\_\+ex()}} and cleans up all event queues, handlers, filters, timers, idlers, idle enterers/exiters etc. set up after \mbox{\hyperlink{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}{ecore\+\_\+init\+\_\+ex()}} was called.
\end{DoxyReturn}
Do not call this function from any callback that may be called from the main loop, as the main loop will then fall over and not function properly.

Note\+: This function should be called in symetric to \mbox{\hyperlink{group__Ecore__Init__Group_gaa999d9816d58d5119c3390c49878e5d8}{ecore\+\_\+init\+\_\+ex()}} 

References ecore\+\_\+shutdown().



Referenced by elm\+\_\+quicklaunch\+\_\+fork(), and elm\+\_\+quicklaunch\+\_\+sub\+\_\+shutdown().

\mbox{\Hypertarget{group__Ecore__Init__Group_ga0447e4cf3419d48885e40080b266b374}\label{group__Ecore__Init__Group_ga0447e4cf3419d48885e40080b266b374}} 
\index{Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}!efl\+\_\+build\+\_\+version\+\_\+set@{efl\+\_\+build\+\_\+version\+\_\+set}}
\index{efl\+\_\+build\+\_\+version\+\_\+set@{efl\+\_\+build\+\_\+version\+\_\+set}!Ecore initialization, shutdown functions and reset on fork.@{Ecore initialization, shutdown functions and reset on fork.}}
\subsubsection{\texorpdfstring{efl\+\_\+build\+\_\+version\+\_\+set()}{efl\_build\_version\_set()}}
{\footnotesize\ttfamily E\+W\+A\+PI void efl\+\_\+build\+\_\+version\+\_\+set (\begin{DoxyParamCaption}\item[{int}]{vmaj,  }\item[{int}]{vmin,  }\item[{int}]{vmic,  }\item[{int}]{revision,  }\item[{const char $\ast$}]{flavor,  }\item[{const char $\ast$}]{build\+\_\+id }\end{DoxyParamCaption})}



Inform E\+FL of the version this application was built for. 

This is transparently called from \$\+E\+F\+L\+\_\+\+M\+A\+I\+N().

\begin{DoxySince}{Since}
1.\+18 (as beta) 
\end{DoxySince}
