\hypertarget{eina_list_04_8c-example}{}\section{eina\+\_\+list\+\_\+04.\+c}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -g eina\_list\_04.c -o eina\_list\_04 `pkg-config --cflags --libs eina`}

\textcolor{preprocessor}{#include <stdio.h>}
\textcolor{preprocessor}{#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   (void)argc;
   (void)argv;
   \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *list = NULL;
   \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *l;
   \textcolor{keywordtype}{void} *list\_data;

   \mbox{\hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\_init}}();

   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"calvin"}));
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"Leoben"}));
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"D'Anna"}));
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"Simon"}));
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"Doral"}));
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"Six"}));
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"Sharon"}));

   \textcolor{keywordflow}{for}(l = list; l; l = \mbox{\hyperlink{group__Eina__List__Group_gac264188a790dda0761d587578605bfd1}{eina\_list\_next}}(l))
     printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, (\textcolor{keywordtype}{char}*)l->\mbox{\hyperlink{struct__Eina__List_a043e22d601d3a0504f30255a43a25e7a}{data}});

   \textcolor{keywordflow}{for}(l = \mbox{\hyperlink{group__Eina__List__Group_ga4c3a9eb5062f3b44c5dcef845cc7a72a}{eina\_list\_last}}(list); l; l = \mbox{\hyperlink{group__Eina__List__Group_gacd8294cbab7b4e053bcf754a92dd68e3}{eina\_list\_prev}}(l))
      printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, (\textcolor{keywordtype}{char}*)\mbox{\hyperlink{group__Eina__List__Group_gaec845f0bfb16a14e8d7f0cd508ca7e9c}{eina\_list\_data\_get}}(l));

   \mbox{\hyperlink{group__Eina__List__Group_gae27a2c686a0a11693f9b06957c9bba83}{EINA\_LIST\_FREE}}(list, list\_data)
     \mbox{\hyperlink{group__Eina__Stringshare__Group_ga495411b0bc85b9c0d59ec7255a025260}{eina\_stringshare\_del}}(list\_data);

   \mbox{\hyperlink{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{eina\_shutdown}}();

   \textcolor{keywordflow}{return} 0;
\}
\end{DoxyCodeInclude}
 