\begin{DoxyItemize}
\item The filter callback, which allow or not a file to be seen by the main loop handler. This callback run in a separated thread. It also take care of getting a stat buffer needed by the main callback to display the file size. \item The main callback, which receive in the main loop all the file that are allowed by the filter. If you are updating a user interface it make sense to delay the insertion a little, so you get a chance to update the canvas for a bunch of file instead of one by one. \item The end callback, which is called in the main loop when the content of the directory has been correctly scanned and all the file notified to the main loop. \item The error callback, which is called if an error occurred or if the listing was cancelled during it\textquotesingle{}s run. You can then retrieve the error type as an errno error.\end{DoxyItemize}
Here is a simple example that implement a stupidly simple recursive ls that display file size\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Eio.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_test\_filter\_cb(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\_File}}\ *handler,\ \mbox{\hyperlink{struct__Eina__File__Direct__Info}{Eina\_File\_Direct\_Info}}\ *info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Stat}{Eina\_Stat}}\ *buffer;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}\ isdir;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ isdir\ =\ info-\/>\mbox{\hyperlink{struct__Eina__File__Direct__Info_a771ccc59adfbd2f5a11ad5384c666683}{type}}\ ==\ \mbox{\hyperlink{group__Eina__File__Group_gga0b7b2db79f9a05b07273fb3428d46cd8a0b8844f30974a2fa27af9ba78bcfaa53}{EINA\_FILE\_DIR}};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ buffer\ =\ malloc(\textcolor{keyword}{sizeof}\ (\mbox{\hyperlink{struct__Eina__Stat}{Eina\_Stat}}));}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group__Eina__File__Group_ga27f6c06f171f1e28442f7f84acef5666}{eina\_file\_statat}}(\mbox{\hyperlink{group__Eio__Helper_gae8d2adf15a58ba45917c2ef2e8b9a76b}{eio\_file\_container\_get}}(handler),\ info,\ buffer))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ free(buffer);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!isdir\ \&\&\ info-\/>\mbox{\hyperlink{struct__Eina__File__Direct__Info_a771ccc59adfbd2f5a11ad5384c666683}{type}}\ ==\ \mbox{\hyperlink{group__Eina__File__Group_gga0b7b2db79f9a05b07273fb3428d46cd8a0b8844f30974a2fa27af9ba78bcfaa53}{EINA\_FILE\_DIR}})}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }stat\ st;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (lstat(info-\/>\mbox{\hyperlink{struct__Eina__File__Direct__Info_a85b1e39fb487005bf1427a1639fa06a8}{path}},\ \&st)\ ==\ 0)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (S\_ISLNK(st.st\_mode))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ info-\/>\mbox{\hyperlink{struct__Eina__File__Direct__Info_a771ccc59adfbd2f5a11ad5384c666683}{type}}\ =\ \mbox{\hyperlink{group__Eina__File__Group_gga0b7b2db79f9a05b07273fb3428d46cd8abcfb23817258fffca146c9c43df45862}{EINA\_FILE\_LNK}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eio__Helper_ga21ba16681ee628f55693e5222713ef73}{eio\_file\_associate\_direct\_add}}(handler,\ \textcolor{stringliteral}{"{}stat"{}},\ buffer,\ free);}
\DoxyCodeLine{\ \ \ fprintf(stdout,\ \textcolor{stringliteral}{"{}ACCEPTING:\ \%s\(\backslash\)n"{}},\ info-\/>\mbox{\hyperlink{struct__Eina__File__Direct__Info_a85b1e39fb487005bf1427a1639fa06a8}{path}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_test\_main\_cb(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\_File}}\ *handler,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{struct__Eina__File__Direct__Info}{Eina\_File\_Direct\_Info}}\ *info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }stat\ *buffer;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ buffer\ =\ \mbox{\hyperlink{group__Eio__Helper_gac6522fcb1bb47013644513b25bba6f16}{eio\_file\_associate\_find}}(handler,\ \textcolor{stringliteral}{"{}stat"{}});}
\DoxyCodeLine{\ \ \ fprintf(stdout,\ \textcolor{stringliteral}{"{}PROCESS:\ \%s\ of\ size\ \%li\(\backslash\)n"{}},\ info-\/>\mbox{\hyperlink{struct__Eina__File__Direct__Info_a85b1e39fb487005bf1427a1639fa06a8}{path}},\ buffer-\/>st\_size);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_test\_done\_cb(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\_File}}\ *handler)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}ls\ done\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_test\_error\_cb(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\_File}}\ *handler,\ \textcolor{keywordtype}{int}\ error)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ fprintf(stdout,\ \textcolor{stringliteral}{"{}error:\ [\%s]\(\backslash\)n"{}},\ strerror(error));}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{int}\ argc,\ \textcolor{keywordtype}{char}\ **argv)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\_File}}\ *cp;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (argc\ !=\ 2)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(stdout,\ \textcolor{stringliteral}{"{}eio\_ls\ directory\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}();}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eio__Helper_ga557c198fc1a90518d7872b77843fa029}{eio\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ cp\ =\ \mbox{\hyperlink{group__Eio__List_ga3d468c8a619af2fa63df70a4bf1085e6}{eio\_dir\_direct\_ls}}(argv[1],}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_test\_filter\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_test\_main\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_test\_done\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_test\_error\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eio__Helper_ga7c3ad77c3f9a0346aab50f474af54b6c}{eio\_shutdown}}();}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}

\end{DoxyCode}
 