\hypertarget{group__Eeze__Watch}{}\section{Watch}
\label{group__Eeze__Watch}\index{Watch@{Watch}}


These are functions which monitor udev for events.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{Eeze_8h_ad0ea12df9dec07bb6620721691875b96}{Eeze\+\_\+\+Udev\+\_\+\+Watch}} $\ast$ \mbox{\hyperlink{group__Eeze__Watch_ga41a2c48b35b574c028bffaa5ca6bc121}{eeze\+\_\+udev\+\_\+watch\+\_\+add}} (\mbox{\hyperlink{Eeze_8h_a9001d923dc7c65860cbd2e83ac5ec65c}{Eeze\+\_\+\+Udev\+\_\+\+Type}} type, int event, \mbox{\hyperlink{Eeze_8h_a24f40261adaa00ddaa6bb92e84ad44dd}{Eeze\+\_\+\+Udev\+\_\+\+Watch\+\_\+\+Cb}} cb, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Add a watch for a device type. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eeze__Watch_ga052eaa5a027e45a06bbcd2adc382c67f}{eeze\+\_\+udev\+\_\+watch\+\_\+del}} (\mbox{\hyperlink{Eeze_8h_ad0ea12df9dec07bb6620721691875b96}{Eeze\+\_\+\+Udev\+\_\+\+Watch}} $\ast$watch)
\begin{DoxyCompactList}\small\item\em Deletes a watch. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
These are functions which monitor udev for events. 

Eeze watches are simple\+: you specify a type of device to watch (or all devices), some events (or all) to watch for, a callback, and some data, and then udev watches those device types for events of the type you specified. Your callback is called with a syspath of the triggering device and the event that happened to the device, along with the data you associated with the watch and the watch object itself in case you want to stop the watch easily in a callback. 

\subsection{Function Documentation}
\mbox{\Hypertarget{group__Eeze__Watch_ga41a2c48b35b574c028bffaa5ca6bc121}\label{group__Eeze__Watch_ga41a2c48b35b574c028bffaa5ca6bc121}} 
\index{Watch@{Watch}!eeze\+\_\+udev\+\_\+watch\+\_\+add@{eeze\+\_\+udev\+\_\+watch\+\_\+add}}
\index{eeze\+\_\+udev\+\_\+watch\+\_\+add@{eeze\+\_\+udev\+\_\+watch\+\_\+add}!Watch@{Watch}}
\subsubsection{\texorpdfstring{eeze\+\_\+udev\+\_\+watch\+\_\+add()}{eeze\_udev\_watch\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{Eeze_8h_ad0ea12df9dec07bb6620721691875b96}{Eeze\+\_\+\+Udev\+\_\+\+Watch}}$\ast$ eeze\+\_\+udev\+\_\+watch\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Eeze_8h_a9001d923dc7c65860cbd2e83ac5ec65c}{Eeze\+\_\+\+Udev\+\_\+\+Type}}}]{type,  }\item[{int}]{event,  }\item[{\mbox{\hyperlink{Eeze_8h_a24f40261adaa00ddaa6bb92e84ad44dd}{Eeze\+\_\+\+Udev\+\_\+\+Watch\+\_\+\+Cb}}}]{cb,  }\item[{void $\ast$}]{user\+\_\+data }\end{DoxyParamCaption})}



Add a watch for a device type. 


\begin{DoxyParams}{Parameters}
{\em type} & The \mbox{\hyperlink{Eeze_8h_a9001d923dc7c65860cbd2e83ac5ec65c}{Eeze\+\_\+\+Udev\+\_\+\+Type}} to watch \\
\hline
{\em event} & The events to watch; an OR list of \mbox{\hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587}{Eeze\+\_\+\+Udev\+\_\+\+Event}} (ie (\mbox{\hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587abfcdd4db03e4defd892074ac0d3b89ab}{E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+E\+V\+E\+N\+T\+\_\+\+A\+DD}} $\vert$ \mbox{\hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587a6c2c2db768e82495bf28046aca476652}{E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+E\+V\+E\+N\+T\+\_\+\+R\+E\+M\+O\+VE}})), or 0 for all events \\
\hline
{\em cb} & The function to call when the watch receives data of type \mbox{\hyperlink{Eeze_8h_a24f40261adaa00ddaa6bb92e84ad44dd}{Eeze\+\_\+\+Udev\+\_\+\+Watch\+\_\+\+Cb}} \\
\hline
{\em user\+\_\+data} & Data to pass to the callback function\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A watch struct for the watch type specified, or {\ttfamily N\+U\+LL} on failure
\end{DoxyReturn}
Eeze watches will monitor udev for changes of type(s) {\ttfamily event} to devices of type {\ttfamily type}. When these changes occur, the stringshared syspath of the device will be sent to function {\ttfamily func}, along with the bitmask of the event type which can be detected through binary \&. 

Referenced by ecore\+\_\+drm\+\_\+device\+\_\+open().

\mbox{\Hypertarget{group__Eeze__Watch_ga052eaa5a027e45a06bbcd2adc382c67f}\label{group__Eeze__Watch_ga052eaa5a027e45a06bbcd2adc382c67f}} 
\index{Watch@{Watch}!eeze\+\_\+udev\+\_\+watch\+\_\+del@{eeze\+\_\+udev\+\_\+watch\+\_\+del}}
\index{eeze\+\_\+udev\+\_\+watch\+\_\+del@{eeze\+\_\+udev\+\_\+watch\+\_\+del}!Watch@{Watch}}
\subsubsection{\texorpdfstring{eeze\+\_\+udev\+\_\+watch\+\_\+del()}{eeze\_udev\_watch\_del()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eeze\+\_\+udev\+\_\+watch\+\_\+del (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Eeze_8h_ad0ea12df9dec07bb6620721691875b96}{Eeze\+\_\+\+Udev\+\_\+\+Watch}} $\ast$}]{watch }\end{DoxyParamCaption})}



Deletes a watch. 


\begin{DoxyParams}{Parameters}
{\em watch} & An Eeze\+\_\+\+Udev\+\_\+\+Watch object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The data originally associated with the watch, or {\ttfamily N\+U\+LL} 
\end{DoxyReturn}
Deletes a watch, closing file descriptors and freeing related udev memory. 

References ecore\+\_\+fork\+\_\+reset\+\_\+callback\+\_\+del(), ecore\+\_\+main\+\_\+fd\+\_\+handler\+\_\+del(), E\+I\+N\+A\+\_\+\+I\+N\+L\+I\+S\+T\+\_\+\+G\+ET, and eina\+\_\+inlist\+\_\+remove().

