\hypertarget{group__Eio__Helper}{}\section{Eio Reference helper A\+PI}
\label{group__Eio__Helper}\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}


This are helper provided around core Eio A\+PI.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{group__Eio__Helper_ga89ffd478ac602179bf7877ed6adc90a9}{eio\+\_\+init}} (void)
\begin{DoxyCompactList}\small\item\em Initialize eio and all its required submodule. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Eio__Helper_ga8eea29cef62953a2916aecb08b222d66}{eio\+\_\+shutdown}} (void)
\begin{DoxyCompactList}\small\item\em Shutdown eio and all its submodule if possible. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eio__Helper_gabb5b4ae1af14aed8a573b436b7563294}{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set}} (size\+\_\+t limit)
\begin{DoxyCompactList}\small\item\em Set the limit to the maximum amount of memory used. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{group__Eio__Helper_gac420f095ab8a07cc011fd3ff63948a22}{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get}} (void)
\begin{DoxyCompactList}\small\item\em Get the actual limit to the maximum amount of memory used. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Eio__Helper_gae9b4601b0e0526d0d574e4e9f1b79781}{eio\+\_\+file\+\_\+container\+\_\+get}} (\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$ls)
\begin{DoxyCompactList}\small\item\em Return the container during E\+IO operation. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eio__Helper_gaa08663f49bcd8b1508a85f0eb5c4dbd3}{eio\+\_\+file\+\_\+cancel}} (\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$ls)
\begin{DoxyCompactList}\small\item\em Cancel any Eio\+\_\+\+File. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eio__Helper_ga13ef0be0b07059d65d990ecbbe33d5ef}{eio\+\_\+file\+\_\+check}} (\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$ls)
\begin{DoxyCompactList}\small\item\em Check if an Eio\+\_\+\+File operation has been cancelled. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eio__Helper_ga28e14e67d1396bfe185c408f2325ff1e}{eio\+\_\+file\+\_\+associate\+\_\+add}} (\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$ls, const char $\ast$key, const void $\ast$data, \mbox{\hyperlink{group__Eina__Types__Group_gadbac560ba2bca5c61d97bfbb542018f3}{Eina\+\_\+\+Free\+\_\+\+Cb}} free\+\_\+cb)
\begin{DoxyCompactList}\small\item\em Associate data with the current filtered file. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eio__Helper_ga5fb2c116e5c135a2531308fc452aecf3}{eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add}} (\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$ls, const char $\ast$key, const void $\ast$data, \mbox{\hyperlink{group__Eina__Types__Group_gadbac560ba2bca5c61d97bfbb542018f3}{Eina\+\_\+\+Free\+\_\+\+Cb}} free\+\_\+cb)
\begin{DoxyCompactList}\small\item\em Associate data with the current filtered file. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Eio__Helper_ga56b02156b1d13fcf633ba7fab8a7dc8b}{eio\+\_\+file\+\_\+associate\+\_\+find}} (\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$ls, const char $\ast$key)
\begin{DoxyCompactList}\small\item\em Get the data associated during the filter callback inside the main loop. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This are helper provided around core Eio A\+PI. 

This set of functions do provide helper to work around data provided by Eio without the need to look at system header. 

\subsection{Function Documentation}
\mbox{\Hypertarget{group__Eio__Helper_ga89ffd478ac602179bf7877ed6adc90a9}\label{group__Eio__Helper_ga89ffd478ac602179bf7877ed6adc90a9}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+init@{eio\+\_\+init}}
\index{eio\+\_\+init@{eio\+\_\+init}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+init()}{eio\_init()}}
{\footnotesize\ttfamily int eio\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Initialize eio and all its required submodule. 

\begin{DoxyReturn}{Returns}
the current number of eio users. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples\+: ]\par
\mbox{\hyperlink{eio_file_ls_8c-example}{eio\+\_\+file\+\_\+ls.\+c}}.\end{Desc}


References ecore\+\_\+init(), efl\+\_\+add, efreet\+\_\+mime\+\_\+init(), eina\+\_\+condition\+\_\+new(), eina\+\_\+init(), eina\+\_\+lock\+\_\+new(), eina\+\_\+log\+\_\+domain\+\_\+register(), E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+E\+RR, eina\+\_\+log\+\_\+timing(), eina\+\_\+spinlock\+\_\+new(), and E\+RR.

\mbox{\Hypertarget{group__Eio__Helper_ga8eea29cef62953a2916aecb08b222d66}\label{group__Eio__Helper_ga8eea29cef62953a2916aecb08b222d66}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+shutdown@{eio\+\_\+shutdown}}
\index{eio\+\_\+shutdown@{eio\+\_\+shutdown}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+shutdown()}{eio\_shutdown()}}
{\footnotesize\ttfamily int eio\+\_\+shutdown (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Shutdown eio and all its submodule if possible. 

\begin{DoxyReturn}{Returns}
the number of pending users of eio. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples\+: ]\par
\mbox{\hyperlink{eio_file_ls_8c-example}{eio\+\_\+file\+\_\+ls.\+c}}.\end{Desc}


References eina\+\_\+log\+\_\+timing(), and E\+RR.

\mbox{\Hypertarget{group__Eio__Helper_gabb5b4ae1af14aed8a573b436b7563294}\label{group__Eio__Helper_gabb5b4ae1af14aed8a573b436b7563294}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set@{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set}}
\index{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set@{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set()}{eio\_memory\_burst\_limit\_set()}}
{\footnotesize\ttfamily void eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{limit }\end{DoxyParamCaption})}



Set the limit to the maximum amount of memory used. 


\begin{DoxyParams}{Parameters}
{\em limit} & The actual limit to set.\\
\hline
\end{DoxyParams}
Eio work by burst, allocating memory in a thread and moving it back to the main loop. This result in quite some huge memory usage if the main loop is to slow to cope with the speed of the thread. By setting this limit, the thread will block until enough memory has been freed to be below the limit again.

By default no limit is set and any value $<$ 0 will mean no limit.

\begin{DoxyNote}{Note}
You should give at least a reasonable amount of memory or the thread might stall. 
\end{DoxyNote}
\begin{DoxySince}{Since}
1.\+10 
\end{DoxySince}


References eina\+\_\+condition\+\_\+broadcast(), eina\+\_\+lock\+\_\+release(), and eina\+\_\+lock\+\_\+take().

\mbox{\Hypertarget{group__Eio__Helper_gac420f095ab8a07cc011fd3ff63948a22}\label{group__Eio__Helper_gac420f095ab8a07cc011fd3ff63948a22}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get@{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get}}
\index{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get@{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get()}{eio\_memory\_burst\_limit\_get()}}
{\footnotesize\ttfamily size\+\_\+t eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+get (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Get the actual limit to the maximum amount of memory used. 

\begin{DoxyReturn}{Returns}
The current limit being set.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+10 
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eio__Helper_gabb5b4ae1af14aed8a573b436b7563294}{eio\+\_\+memory\+\_\+burst\+\_\+limit\+\_\+set}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eio__Helper_gae9b4601b0e0526d0d574e4e9f1b79781}\label{group__Eio__Helper_gae9b4601b0e0526d0d574e4e9f1b79781}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+file\+\_\+container\+\_\+get@{eio\+\_\+file\+\_\+container\+\_\+get}}
\index{eio\+\_\+file\+\_\+container\+\_\+get@{eio\+\_\+file\+\_\+container\+\_\+get}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+file\+\_\+container\+\_\+get()}{eio\_file\_container\_get()}}
{\footnotesize\ttfamily void$\ast$ eio\+\_\+file\+\_\+container\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$}]{ls }\end{DoxyParamCaption})}



Return the container during E\+IO operation. 


\begin{DoxyParams}{Parameters}
{\em ls} & The asynchronous I/O operation to retrieve container from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
N\+U\+LL if not available, a D\+I\+RP if it is.
\end{DoxyReturn}
This is only available and make sense in the thread callback, not in the mainloop. \mbox{\Hypertarget{group__Eio__Helper_gaa08663f49bcd8b1508a85f0eb5c4dbd3}\label{group__Eio__Helper_gaa08663f49bcd8b1508a85f0eb5c4dbd3}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+file\+\_\+cancel@{eio\+\_\+file\+\_\+cancel}}
\index{eio\+\_\+file\+\_\+cancel@{eio\+\_\+file\+\_\+cancel}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+file\+\_\+cancel()}{eio\_file\_cancel()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eio\+\_\+file\+\_\+cancel (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$}]{ls }\end{DoxyParamCaption})}



Cancel any Eio\+\_\+\+File. 


\begin{DoxyParams}{Parameters}
{\em ls} & The asynchronous I/O operation to cancel. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+F\+A\+L\+SE if the destruction is delayed, E\+I\+N\+A\+\_\+\+T\+R\+UE if it\textquotesingle{}s done.
\end{DoxyReturn}
This will cancel any kind of I/O operation and cleanup the mess. This means that it could take time to cancel an I/O. 

References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE.

\mbox{\Hypertarget{group__Eio__Helper_ga13ef0be0b07059d65d990ecbbe33d5ef}\label{group__Eio__Helper_ga13ef0be0b07059d65d990ecbbe33d5ef}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+file\+\_\+check@{eio\+\_\+file\+\_\+check}}
\index{eio\+\_\+file\+\_\+check@{eio\+\_\+file\+\_\+check}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+file\+\_\+check()}{eio\_file\_check()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eio\+\_\+file\+\_\+check (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$}]{ls }\end{DoxyParamCaption})}



Check if an Eio\+\_\+\+File operation has been cancelled. 


\begin{DoxyParams}{Parameters}
{\em ls} & The asynchronous I/O operation to check. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+UE if it was canceled, E\+I\+N\+A\+\_\+\+F\+A\+L\+SE other wise.
\end{DoxyReturn}
In case of an error it also return E\+I\+N\+A\+\_\+\+T\+R\+UE. \mbox{\Hypertarget{group__Eio__Helper_ga28e14e67d1396bfe185c408f2325ff1e}\label{group__Eio__Helper_ga28e14e67d1396bfe185c408f2325ff1e}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+file\+\_\+associate\+\_\+add@{eio\+\_\+file\+\_\+associate\+\_\+add}}
\index{eio\+\_\+file\+\_\+associate\+\_\+add@{eio\+\_\+file\+\_\+associate\+\_\+add}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+file\+\_\+associate\+\_\+add()}{eio\_file\_associate\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eio\+\_\+file\+\_\+associate\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$}]{ls,  }\item[{const char $\ast$}]{key,  }\item[{const void $\ast$}]{data,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_gadbac560ba2bca5c61d97bfbb542018f3}{Eina\+\_\+\+Free\+\_\+\+Cb}}}]{free\+\_\+cb }\end{DoxyParamCaption})}



Associate data with the current filtered file. 


\begin{DoxyParams}{Parameters}
{\em ls} & The Eio\+\_\+\+File ls request currently calling the filter callback. \\
\hline
{\em key} & The key to associate data to. \\
\hline
{\em data} & The data to associate the data to. \\
\hline
{\em free\+\_\+cb} & Optionally a function to call to free the associated data, {\ttfamily data} is passed as the callback data parameter. If no {\ttfamily free\+\_\+cb} is provided the user {\ttfamily data} remains untouched. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+UE if insertion was fine.
\end{DoxyReturn}
This function can only be safely called from within the filter callback. If you don\textquotesingle{}t need to copy the key around you can use \mbox{\hyperlink{group__Eio__Helper_ga5fb2c116e5c135a2531308fc452aecf3}{eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add}} \mbox{\Hypertarget{group__Eio__Helper_ga5fb2c116e5c135a2531308fc452aecf3}\label{group__Eio__Helper_ga5fb2c116e5c135a2531308fc452aecf3}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add@{eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add}}
\index{eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add@{eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add()}{eio\_file\_associate\_direct\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eio\+\_\+file\+\_\+associate\+\_\+direct\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$}]{ls,  }\item[{const char $\ast$}]{key,  }\item[{const void $\ast$}]{data,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_gadbac560ba2bca5c61d97bfbb542018f3}{Eina\+\_\+\+Free\+\_\+\+Cb}}}]{free\+\_\+cb }\end{DoxyParamCaption})}



Associate data with the current filtered file. 


\begin{DoxyParams}{Parameters}
{\em ls} & The Eio\+\_\+\+File ls request currently calling the filter callback. \\
\hline
{\em key} & The key to associate data to (will not be copied, and the pointer will not be used as long as the file is not notified). \\
\hline
{\em data} & The data to associate the data to. \\
\hline
{\em free\+\_\+cb} & The function to call to free the associated data, {\ttfamily free\+\_\+cb} will be called if not specified. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+UE if insertion was fine.
\end{DoxyReturn}
This function can only be safely called from within the filter callback. If you need eio to make a proper copy of the {\ttfamily key} to be safe use \mbox{\hyperlink{group__Eio__Helper_ga28e14e67d1396bfe185c408f2325ff1e}{eio\+\_\+file\+\_\+associate\+\_\+add}} instead. \mbox{\Hypertarget{group__Eio__Helper_ga56b02156b1d13fcf633ba7fab8a7dc8b}\label{group__Eio__Helper_ga56b02156b1d13fcf633ba7fab8a7dc8b}} 
\index{Eio Reference helper A\+PI@{Eio Reference helper A\+PI}!eio\+\_\+file\+\_\+associate\+\_\+find@{eio\+\_\+file\+\_\+associate\+\_\+find}}
\index{eio\+\_\+file\+\_\+associate\+\_\+find@{eio\+\_\+file\+\_\+associate\+\_\+find}!Eio Reference helper A\+PI@{Eio Reference helper A\+PI}}
\subsubsection{\texorpdfstring{eio\+\_\+file\+\_\+associate\+\_\+find()}{eio\_file\_associate\_find()}}
{\footnotesize\ttfamily void$\ast$ eio\+\_\+file\+\_\+associate\+\_\+find (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eio_ga1145f009745ecb4d9f6a01a9bc5a9ac0}{Eio\+\_\+\+File}} $\ast$}]{ls,  }\item[{const char $\ast$}]{key }\end{DoxyParamCaption})}



Get the data associated during the filter callback inside the main loop. 


\begin{DoxyParams}{Parameters}
{\em ls} & The Eio\+\_\+\+File ls request currently calling the notify callback. \\
\hline
{\em key} & The key pointing to the data to retrieve. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the data associated with the key or {\ttfamily N\+U\+LL} if not found. 
\end{DoxyReturn}
