\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 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{Eeze_8h_ad0ea12df9dec07bb6620721691875b96}{Eeze\+\_\+\+Udev\+\_\+\+Watch} $\ast$ \hyperlink{group__Eeze__Watch_ga41a2c48b35b574c028bffaa5ca6bc121}{eeze\+\_\+udev\+\_\+watch\+\_\+add} (\hyperlink{Eeze_8h_a9001d923dc7c65860cbd2e83ac5ec65c}{Eeze\+\_\+\+Udev\+\_\+\+Type} type, int event, \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 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Eeze__Watch_ga052eaa5a027e45a06bbcd2adc382c67f}{eeze\+\_\+udev\+\_\+watch\+\_\+del} (\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}
\hypertarget{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[{eeze\+\_\+udev\+\_\+watch\+\_\+add}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eeze\+\_\+\+Udev\+\_\+\+Watch}$\ast$ eeze\+\_\+udev\+\_\+watch\+\_\+add (
\begin{DoxyParamCaption}
\item[{{\bf Eeze\+\_\+\+Udev\+\_\+\+Type}}]{type, }
\item[{int}]{event, }
\item[{{\bf Eeze\+\_\+\+Udev\+\_\+\+Watch\+\_\+\+Cb}}]{cb, }
\item[{void $\ast$}]{user\+\_\+data}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Watch_ga41a2c48b35b574c028bffaa5ca6bc121}


Add a watch for a device type. 


\begin{DoxyParams}{Parameters}
{\em type} & The \hyperlink{Eeze_8h_a9001d923dc7c65860cbd2e83ac5ec65c}{Eeze\+\_\+\+Udev\+\_\+\+Type} to watch \\
\hline
{\em event} & The events to watch; an O\+R list of \hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587}{Eeze\+\_\+\+Udev\+\_\+\+Event} (ie (\hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587abfcdd4db03e4defd892074ac0d3b89ab}{E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+E\+V\+E\+N\+T\+\_\+\+A\+D\+D} $\vert$ \hyperlink{Eeze_8h_a8766206372a0ef74dfb8b29945cd3587a6c2c2db768e82495bf28046aca476652}{E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+E\+V\+E\+N\+T\+\_\+\+R\+E\+M\+O\+V\+E})), or 0 for all events \\
\hline
{\em cb} & The function to call when the watch receives data of type \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\+L\+L} 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 E\+C\+O\+R\+E\+\_\+\+F\+D\+\_\+\+R\+E\+A\+D, ecore\+\_\+main\+\_\+fd\+\_\+handler\+\_\+add(), E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+B\+L\+U\+E\+T\+O\+O\+T\+H, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+R\+I\+V\+E\+\_\+\+C\+D\+R\+O\+M, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+R\+I\+V\+E\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+R\+I\+V\+E\+\_\+\+M\+O\+U\+N\+T\+A\+B\+L\+E, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+R\+I\+V\+E\+\_\+\+R\+E\+M\+O\+V\+A\+B\+L\+E, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+R\+M, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+I\+S\+\_\+\+I\+T\+\_\+\+H\+O\+T\+\_\+\+O\+R\+\_\+\+I\+S\+\_\+\+I\+T\+\_\+\+C\+O\+L\+D\+\_\+\+S\+E\+N\+S\+O\+R, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+J\+O\+Y\+S\+T\+I\+C\+K, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+K\+E\+Y\+B\+O\+A\+R\+D, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+M\+O\+U\+S\+E, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+N\+E\+T, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+P\+O\+W\+E\+R\+\_\+\+A\+C, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+P\+O\+W\+E\+R\+\_\+\+B\+A\+T, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+T\+O\+U\+C\+H\+P\+A\+D, E\+E\+Z\+E\+\_\+\+U\+D\+E\+V\+\_\+\+T\+Y\+P\+E\+\_\+\+V4\+L, and E\+R\+R.



Referenced by ecore\+\_\+drm\+\_\+outputs\+\_\+create().

\hypertarget{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[{eeze\+\_\+udev\+\_\+watch\+\_\+del}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void$\ast$ eeze\+\_\+udev\+\_\+watch\+\_\+del (
\begin{DoxyParamCaption}
\item[{{\bf Eeze\+\_\+\+Udev\+\_\+\+Watch} $\ast$}]{watch}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Watch_ga052eaa5a027e45a06bbcd2adc382c67f}


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\+L\+L} 
\end{DoxyReturn}
Deletes a watch, closing file descriptors and freeing related udev memory. 

References ecore\+\_\+main\+\_\+fd\+\_\+handler\+\_\+del().

