\hypertarget{eina_accessor_01_8c-example}{}\doxysection{eina\+\_\+accessor\+\_\+01.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc -\/g eina\_accessor\_01.c -\/o eina\_accessor\_01 `pkg-\/config -\/-\/cflags -\/-\/libs eina`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{int} argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{char} **argv \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *strings[] = \{}
\DoxyCodeLine{      \textcolor{stringliteral}{"even"}, \textcolor{stringliteral}{"odd"}, \textcolor{stringliteral}{"even"}, \textcolor{stringliteral}{"odd"}, \textcolor{stringliteral}{"even"}, \textcolor{stringliteral}{"odd"}, \textcolor{stringliteral}{"even"}, \textcolor{stringliteral}{"odd"}, \textcolor{stringliteral}{"even"}, \textcolor{stringliteral}{"odd"}}
\DoxyCodeLine{   \};}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *more\_strings[] = \{}
\DoxyCodeLine{      \textcolor{stringliteral}{"0"}, \textcolor{stringliteral}{"1"}, \textcolor{stringliteral}{"2"}, \textcolor{stringliteral}{"3"}, \textcolor{stringliteral}{"4"}, \textcolor{stringliteral}{"5"}, \textcolor{stringliteral}{"6"}, \textcolor{stringliteral}{"7"}, \textcolor{stringliteral}{"8"}, \textcolor{stringliteral}{"9"}}
\DoxyCodeLine{   \};}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__Array}{Eina\_Array}} *array;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *list = NULL;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__Accessor}{Eina\_Accessor}} *acc;}
\DoxyCodeLine{   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{   \textcolor{keywordtype}{void} *data;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   array = \mbox{\hyperlink{group__Eina__Array__Group_ga4a389204db37b44b31d29f581258ac7d}{eina\_array\_new}}(10);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{for} (i = 0; i < 10; i++)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Array__Group_gaf2f4a5907f1826354977adbd63e3379a}{eina\_array\_push}}(array, strings[i]);}
\DoxyCodeLine{        list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, more\_strings[i]);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   acc = \mbox{\hyperlink{group__Eina__Array__Group_gab0886ce166e67d0e395e9e90b808d9b0}{eina\_array\_accessor\_new}}(array);}
\DoxyCodeLine{   \textcolor{keywordflow}{for}(i = 1; i < 10; i += 2)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Accessor__Group_ga08786da46a71eb2d1ad0ee07db8463cd}{eina\_accessor\_data\_get}}(acc, i, \&data);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"\%s\(\backslash\)n"}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)data);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Accessor__Group_ga5ae101883822c1f01688fcef3a6585b8}{eina\_accessor\_free}}(acc);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Array__Group_gacd0118606f9e5b42839b91ed0da8b168}{eina\_array\_free}}(array);}
\DoxyCodeLine{}
\DoxyCodeLine{   acc = \mbox{\hyperlink{group__Eina__List__Group_ga6901b2ea29c9bc34a486dae00d3cf608}{eina\_list\_accessor\_new}}(list);}
\DoxyCodeLine{   \textcolor{keywordflow}{for}(i = 1; i < 10; i += 2)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Accessor__Group_ga08786da46a71eb2d1ad0ee07db8463cd}{eina\_accessor\_data\_get}}(acc, i, \&data);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"\%s\(\backslash\)n"}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)data);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__List__Group_ga608bd2fbf06293a1b794648990703ab4}{eina\_list\_free}}(\mbox{\hyperlink{group__Eina__Accessor__Group_ga461c9ee7dec70fc5fa17acea0a59beb6}{eina\_accessor\_container\_get}}(acc));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Accessor__Group_ga5ae101883822c1f01688fcef3a6585b8}{eina\_accessor\_free}}(acc);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}
 