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

\textcolor{preprocessor}{#include <stdio.h>}

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

\textcolor{keyword}{static} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}
print\_one(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *container EINA\_UNUSED, \textcolor{keywordtype}{void} *data, \textcolor{keywordtype}{void} *fdata EINA\_UNUSED)
\{
   printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, (\textcolor{keywordtype}{char}*)data);
   \textcolor{keywordflow}{return} \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE};
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
print\_eina\_container(\hyperlink{struct__Eina__Iterator}{Eina\_Iterator} *it)
\{
   \hyperlink{group__Eina__Iterator__Group_gad9b7adc8db40a640d03e9bc4a5d52370}{eina\_iterator\_foreach}(it, print\_one, NULL);
   printf(\textcolor{stringliteral}{"\(\backslash\)n"});
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc EINA\_UNUSED, \textcolor{keywordtype}{char} **argv EINA\_UNUSED)
\{
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *strings[] = \{
      \textcolor{stringliteral}{"unintersting string"}, \textcolor{stringliteral}{"husker"}, \textcolor{stringliteral}{"starbuck"}, \textcolor{stringliteral}{"husker"}
   \};
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *more\_strings[] = \{
      \textcolor{stringliteral}{"very unintersting string"},
      \textcolor{stringliteral}{"what do your hear?"},
      \textcolor{stringliteral}{"nothing but the rain"},
      \textcolor{stringliteral}{"then grab your gun and bring the cat in"}
   \};
   \hyperlink{struct__Eina__Array}{Eina\_Array} *array;
   \hyperlink{struct__Eina__List}{Eina\_List} *list = NULL;
   \hyperlink{struct__Eina__Iterator}{Eina\_Iterator} *it;
   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \textcolor{keywordtype}{int} i;
   \textcolor{keywordtype}{char} *uninteresting;

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

   array = \hyperlink{group__Eina__Array__Group_ga4a389204db37b44b31d29f581258ac7d}{eina\_array\_new}(4);

   \textcolor{keywordflow}{for} (i = 0; i < 4; i++)
      \{
        \hyperlink{group__Eina__Array__Group_gaf2f4a5907f1826354977adbd63e3379a}{eina\_array\_push}(array, strings[i]);
        list = \hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}(list, more\_strings[i]);
      \}

   it = \hyperlink{group__Eina__Array__Group_ga3cc5cffcf52a2e8c60a651f8df66fbdf}{eina\_array\_iterator\_new}(array);
   \textcolor{keywordflow}{if} (!\hyperlink{group__Eina__Iterator__Group_ga83346e93c32dbebc8fd66e4f278140c5}{eina\_iterator\_next}(it, (\textcolor{keywordtype}{void} **)&uninteresting))
     \textcolor{keywordflow}{return} -1;
   print\_eina\_container(it);
   \hyperlink{group__Eina__Array__Group_ga97995d81ca401d71a2913a52f8b40c41}{eina\_array\_free}(\hyperlink{group__Eina__Iterator__Group_ga5583ab703b156f74f0c2a74875c95cc2}{eina\_iterator\_container\_get}(it));
   \hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}(it);

   it = \hyperlink{group__Eina__List__Group_gabcfb6a861aa7c0db0ee36252ac2a254d}{eina\_list\_iterator\_new}(list);
   \textcolor{keywordflow}{if} (!\hyperlink{group__Eina__Iterator__Group_ga83346e93c32dbebc8fd66e4f278140c5}{eina\_iterator\_next}(it, (\textcolor{keywordtype}{void} **)&uninteresting))
     \textcolor{keywordflow}{return} -1;
   print\_eina\_container(it);
   \hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}(it);

   \hyperlink{group__Eina__List__Group_ga608bd2fbf06293a1b794648990703ab4}{eina\_list\_free}(list);

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

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