\hypertarget{eina_file_01_8c-example}{\section{eina\+\_\+file\+\_\+01.\+c}
}

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

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_print\_cb(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *path, \textcolor{keywordtype}{void} *data EINA\_UNUSED)
\{
   printf(\textcolor{stringliteral}{"file %s in %s\(\backslash\)n"}, name, path);
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc EINA\_UNUSED, \textcolor{keywordtype}{char} **argv EINA\_UNUSED)
\{
   \hyperlink{struct__Eina__Iterator}{Eina\_Iterator} *it;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *f\_name;
   \textcolor{keyword}{const} \hyperlink{struct__Eina__File__Direct__Info}{Eina\_File\_Direct\_Info} *f\_info;

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

   \hyperlink{group__Eina__File__Group_ga186dc8dd1a166a8972189f78bbee15ea}{eina\_file\_dir\_list}(\textcolor{stringliteral}{"/home/"}, \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}, \_print\_cb, NULL);

   it = \hyperlink{group__Eina__File__Group_ga8c4fabb379b865a4ec134a5c4436be2a}{eina\_file\_ls}(\textcolor{stringliteral}{"/home/"});
   \hyperlink{group__Eina__Iterator__Group_gad2f796ac4df0e500d25235c29821faa3}{EINA\_ITERATOR\_FOREACH}(it, f\_name)
     \{
        printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, f\_name);
        \hyperlink{group__Eina__Stringshare__Group_ga4453d2aff2b325c7b45048f30df9b1f5}{eina\_stringshare\_del}(f\_name);
     \}
   \hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}(it);

   it = \hyperlink{group__Eina__File__Group_ga21d5e94767ae9932751649ce09a2f98f}{eina\_file\_stat\_ls}(\textcolor{stringliteral}{"/home/"});
   \hyperlink{group__Eina__Iterator__Group_gad2f796ac4df0e500d25235c29821faa3}{EINA\_ITERATOR\_FOREACH}(it, f\_info)
     printf("%s if of type %d\(\backslash\)n", f\_info->path, f\_info->type);
   \hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}(it);

   it = \hyperlink{group__Eina__File__Group_gab20cc163550854f917960f7971c45ca6}{eina\_file\_direct\_ls}("/home/");
   \hyperlink{group__Eina__Iterator__Group_gad2f796ac4df0e500d25235c29821faa3}{EINA\_ITERATOR\_FOREACH}(it, f\_info)
     printf("%s if of type %d\(\backslash\)n", f\_info->path, f\_info->type);
   \hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}(it);

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

   return 0;
\}
\end{DoxyCodeInclude}
 