\chapter{Evas\textquotesingle{} init/shutdown routines example}
\hypertarget{Example_Evas_Init_Shutdown}{}\label{Example_Evas_Init_Shutdown}\index{Evas\textquotesingle{} init/shutdown routines example@{Evas\textquotesingle{} init/shutdown routines example}}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Evas.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <errno.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__List}{Eina\_List}}\ *engine\_list,\ *l;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{char}\ *engine\_name;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ Initialize\ Evas.\ \ This\ will\ startup\ other\ dependencies\ such\ as}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ eina,\ eet,\ ecore,\ etc.\ and\ initializes\ various\ internal\ things}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ (threads,\ filters,\ etc.)\ */}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Main__Group_gaa617071d85a52779e950e5b1d8c354e3}{evas\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ When\ building\ Evas\ you\ can\ configure\ a\ variety\ of\ engines\ to\ be}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ built\ with\ it.\ \ Get\ a\ list\ of\ what\ engines\ are\ available\ using\ the}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ evas\_render\_method\_list\ routine.}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ */}}
\DoxyCodeLine{\ \ \ engine\_list\ =\ \mbox{\hyperlink{group__Evas__Output__Method_ga7ebf8cc71a88db5a7dc9acbbc671d459}{evas\_render\_method\_list}}();}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!engine\_list)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}ERROR:\ Evas\ supports\ no\ engines!\ Exit.\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ exit(-\/1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ 'engine\_list'\ is\ a\ linked\ list\ (@see\ Eina\_List.)\ \ The}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ EINA\_LIST\_FOREACH\ macro\ permits\ navigating\ through\ the\ items\ using}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ the\ iterator\ 'l',\ making\ the\ node\ data\ available\ as\ 'engine\_name'.}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ */}}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}Available\ Evas\ Engines:\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__List__Group_gac6efafc19f526d916cdb9757240a8773}{EINA\_LIST\_FOREACH}}(engine\_list,\ l,\ engine\_name)}
\DoxyCodeLine{\ \ \ \ \ printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}},\ engine\_name);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ To\ free\ the\ list,\ we\ use\ evas\_render\_method\_list's\ corresponding}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ destructor\ routine.}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ */}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Output__Method_ga3968edd54d2ddcd97bf5ff8e93f3aeda}{evas\_render\_method\_list\_free}}(engine\_list);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ Shuts\ down\ all\ dependencies\ if\ nothing\ else\ is\ using\ them,\ and}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ clears\ allocated\ data\ held\ internally.}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ */}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Main__Group_gadb9d1c9f3fcff94cea89e12942c40919}{evas\_shutdown}}();}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 