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


These are functions which monitor udev for events.  


\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI Eeze\+\_\+\+Udev\+\_\+\+Watch $\ast$ \mbox{\hyperlink{group__Eeze__Watch_ga89cbd97910b2a713a71ede0a495c69c3}{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 
EAPI void $\ast$ \mbox{\hyperlink{group__Eeze__Watch_ga6d17487ee2db125e2f61308e285ac8dc}{eeze\+\_\+udev\+\_\+watch\+\_\+del}} (Eeze\+\_\+\+Udev\+\_\+\+Watch $\ast$watch)
\begin{DoxyCompactList}\small\item\em Deletes a watch. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{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. 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eeze__Watch_ga89cbd97910b2a713a71ede0a495c69c3}\label{group__Eeze__Watch_ga89cbd97910b2a713a71ede0a495c69c3}} 
\index{Watch@{Watch}!eeze\_udev\_watch\_add@{eeze\_udev\_watch\_add}}
\index{eeze\_udev\_watch\_add@{eeze\_udev\_watch\_add}!Watch@{Watch}}
\doxysubsubsection{\texorpdfstring{eeze\_udev\_watch\_add()}{eeze\_udev\_watch\_add()}}
{\footnotesize\ttfamily EAPI 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}{EEZE\+\_\+\+UDEV\+\_\+\+EVENT\+\_\+\+ADD}} $\vert$ \mbox{\hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587a6c2c2db768e82495bf28046aca476652}{EEZE\+\_\+\+UDEV\+\_\+\+EVENT\+\_\+\+REMOVE}})), 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 NULL} 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 \&. 

References \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gad4c3bd5fb81af093ce3d64f6f8331043}{ecore\+\_\+fork\+\_\+reset\+\_\+callback\+\_\+add()}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_gaef650e653f43178ecfee2c661bea7a85}{eina\+\_\+inlist\+\_\+append()}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\+\_\+\+INLIST\+\_\+\+GET}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{struct__Eina__Value_a1fd07b3214c901eec252a786cca47239}{\+\_\+\+Eina\+\_\+\+Value\+::type}}.



Referenced by \mbox{\hyperlink{group__Ecore__Drm2__Output__Group_ga8b0dd04e09164ee351cc7f92dcfd82af}{ecore\+\_\+drm2\+\_\+outputs\+\_\+create()}}, and \mbox{\hyperlink{group__Ecore__Drm__Device__Group_ga553c3126d3eec540772b9216713ff1c7}{ecore\+\_\+drm\+\_\+device\+\_\+open()}}.

\mbox{\Hypertarget{group__Eeze__Watch_ga6d17487ee2db125e2f61308e285ac8dc}\label{group__Eeze__Watch_ga6d17487ee2db125e2f61308e285ac8dc}} 
\index{Watch@{Watch}!eeze\_udev\_watch\_del@{eeze\_udev\_watch\_del}}
\index{eeze\_udev\_watch\_del@{eeze\_udev\_watch\_del}!Watch@{Watch}}
\doxysubsubsection{\texorpdfstring{eeze\_udev\_watch\_del()}{eeze\_udev\_watch\_del()}}
{\footnotesize\ttfamily EAPI void $\ast$ eeze\+\_\+udev\+\_\+watch\+\_\+del (\begin{DoxyParamCaption}\item[{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 NULL} 
\end{DoxyReturn}
Deletes a watch, closing file descriptors and freeing related udev memory. 

References \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga10a1b477404946b0de4d01e32f84fec5}{ecore\+\_\+fork\+\_\+reset\+\_\+callback\+\_\+del()}}, \mbox{\hyperlink{group__Ecore__FD__Handler__Group_ga259d711cf297b5c2c9dc223005fec583}{ecore\+\_\+main\+\_\+fd\+\_\+handler\+\_\+del()}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\+\_\+\+INLIST\+\_\+\+GET}}, and \mbox{\hyperlink{group__Eina__Inline__List__Group_gaf885b08d5b5a750a901f3780d3c65338}{eina\+\_\+inlist\+\_\+remove()}}.



Referenced by \mbox{\hyperlink{group__Ecore__Drm__Device__Group_gab36f4196c95f819739506f140ef15284}{ecore\+\_\+drm\+\_\+device\+\_\+close()}}, and \mbox{\hyperlink{group__Ecore__Drm__Device__Group_gab206267ef3b8706b22c42391f0dee07e}{ecore\+\_\+drm\+\_\+device\+\_\+free()}}.

