\doxysection{eina\+\_\+inlist\+\_\+01.\+c}
\hypertarget{eina_inlist_01_8c-example}{}\label{eina_inlist_01_8c-example}
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//\ Compile\ with:}}
\DoxyCodeLine{\textcolor{comment}{//\ gcc\ -\/g\ eina\_inlist\_01.c\ -\/o\ eina\_inlist\_01\ \`{}pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ eina`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{struct\ }my\_struct\ \{}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__Eina__Inline__List__Group_gab30a76fcfa50307c797491705d60136a}{EINA\_INLIST}};}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordtype}{int}\ a,\ b;}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{sort\_cb(\textcolor{keyword}{const}\ \textcolor{keywordtype}{void}\ *d1,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}\ *d2)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{struct__Eina__Inlist}{Eina\_Inlist}}\ *l1,\ *l2;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{struct\ }my\_struct\ *x1,\ *x2;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ l1\ =\ d1;}
\DoxyCodeLine{\ \ \ l2\ =\ d2;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ x1\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga8c4e6011e7caa9ec5c22b003c4950338}{EINA\_INLIST\_CONTAINER\_GET}}(l1,\ \textcolor{keyword}{struct}\ my\_struct);}
\DoxyCodeLine{\ \ \ x2\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga8c4e6011e7caa9ec5c22b003c4950338}{EINA\_INLIST\_CONTAINER\_GET}}(l2,\ \textcolor{keyword}{struct}\ my\_struct);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ x1-\/>a\ -\/\ x2-\/>a;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }my\_struct\ *d,\ *cur;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Inlist}{Eina\_Inlist}}\ *list,\ *itr,\ *tmp;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Main__Group_ga81b8137665b8a4d2cb38ca50017d4c74}{eina\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ d\ =\ malloc(\textcolor{keyword}{sizeof}(*d));}
\DoxyCodeLine{\ \ \ d-\/>a\ =\ 1;}
\DoxyCodeLine{\ \ \ d-\/>b\ =\ 10;}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_gaef650e653f43178ecfee2c661bea7a85}{eina\_inlist\_append}}(NULL,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ d\ =\ malloc(\textcolor{keyword}{sizeof}(*d));}
\DoxyCodeLine{\ \ \ d-\/>a\ =\ 2;}
\DoxyCodeLine{\ \ \ d-\/>b\ =\ 20;}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_gaef650e653f43178ecfee2c661bea7a85}{eina\_inlist\_append}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ d\ =\ malloc(\textcolor{keyword}{sizeof}(*d));}
\DoxyCodeLine{\ \ \ d-\/>a\ =\ 3;}
\DoxyCodeLine{\ \ \ d-\/>b\ =\ 30;}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga2cbaa546cd6224dde756d43a603ef463}{eina\_inlist\_prepend}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}list=\%p\(\backslash\)n"{}},\ list);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga65e496b9b16d527d23c1d735652b4e62}{EINA\_INLIST\_FOREACH}}(list,\ cur)}
\DoxyCodeLine{\ \ \ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)ta=\%d,\ b=\%d\(\backslash\)n"{}},\ cur-\/>a,\ cur-\/>b);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_gaeb798d318196989b95cc1a7801c2f364}{eina\_inlist\_promote}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ d\ =\ malloc(\textcolor{keyword}{sizeof}(*d));}
\DoxyCodeLine{\ \ \ d-\/>a\ =\ 4;}
\DoxyCodeLine{\ \ \ d-\/>b\ =\ 40;}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga8bb0dbd2cd2ce2a39453d645239f9270}{eina\_inlist\_append\_relative}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d),\ list);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_gaf2aee0bfc3a6f3a6cd4da210908ab86f}{eina\_inlist\_demote}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga33c8505a9217369cb0b4fdc7118776a9}{eina\_inlist\_sort}}(list,\ sort\_cb);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}list\ after\ sort=\%p\(\backslash\)n"{}},\ list);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga65e496b9b16d527d23c1d735652b4e62}{EINA\_INLIST\_FOREACH}}(list,\ cur)}
\DoxyCodeLine{\ \ \ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)ta=\%d,\ b=\%d\(\backslash\)n"{}},\ cur-\/>a,\ cur-\/>b);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ tmp\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga22491df4219f390595c535463936510e}{eina\_inlist\_find}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (tmp)}
\DoxyCodeLine{\ \ \ \ \ cur\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga8c4e6011e7caa9ec5c22b003c4950338}{EINA\_INLIST\_CONTAINER\_GET}}(tmp,\ \textcolor{keyword}{struct}\ my\_struct);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\ \ \ \ \ cur\ =\ NULL;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (d\ !=\ cur)}
\DoxyCodeLine{\ \ \ \ \ printf(\textcolor{stringliteral}{"{}wrong\ node!\ cur=\%p\(\backslash\)n"{}},\ cur);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_gaf885b08d5b5a750a901f3780d3c65338}{eina\_inlist\_remove}}(list,\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\_INLIST\_GET}}(d));}
\DoxyCodeLine{\ \ \ free(d);}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}list=\%p\(\backslash\)n"{}},\ list);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{for}\ (itr\ =\ list;\ itr\ !=\ NULL;\ itr\ =\ itr-\/>\mbox{\hyperlink{struct__Eina__Inlist_ae95deba8e271f94f8ad8aecf7fdb5dde}{next}})}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ cur\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga8c4e6011e7caa9ec5c22b003c4950338}{EINA\_INLIST\_CONTAINER\_GET}}(itr,\ \textcolor{keyword}{struct}\ my\_struct);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)ta=\%d,\ b=\%d\(\backslash\)n"{}},\ cur-\/>a,\ cur-\/>b);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{while}\ (list)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }my\_struct\ *aux\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_ga8c4e6011e7caa9ec5c22b003c4950338}{EINA\_INLIST\_CONTAINER\_GET}}(list,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct}\ my\_struct);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ list\ =\ \mbox{\hyperlink{group__Eina__Inline__List__Group_gaf885b08d5b5a750a901f3780d3c65338}{eina\_inlist\_remove}}(list,\ list);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ free(aux);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Main__Group_ga5bf35513199d5220341437c05696285d}{eina\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 