\hypertarget{drv__admin_8h}{}\section{/home/mk/tmp/lirc/lib/drv\+\_\+admin.h File Reference}
\label{drv__admin_8h}\index{/home/mk/tmp/lirc/lib/drv\+\_\+admin.\+h(ae09b60 2015-\/02-\/12 15\+:37\+:34 +0100)@{/home/mk/tmp/lirc/lib/drv\+\_\+admin.\+h(ae09b60 2015-\/02-\/12 15\+:37\+:34 +0100)}}


Routines for dynamic drivers.

Functions in this file provides primitives to iterate over the dynamic drivers + a single function to install such a driver.  


{\ttfamily \#include \char`\"{}driver.\+h\char`\"{}}\\*
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \hyperlink{structdriver}{driver} $\ast$($\ast$ \hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func}) (struct \hyperlink{structdriver}{driver} $\ast$, void $\ast$)
\item 
typedef struct \hyperlink{structdriver}{driver} $\ast$($\ast$ \hyperlink{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{plugin\+\_\+guest\+\_\+func}) (const char $\ast$, \hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func}, void $\ast$)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{drv__admin_8h_a1eaff4902d2d278d2d42e47e763c89da}{hw\+\_\+choose\+\_\+driver} (const char $\ast$name)
\item 
void \hyperlink{drv__admin_8h_af73a4ec1270778bae0a0376af1c79b6b}{hw\+\_\+print\+\_\+drivers} (F\+I\+L\+E $\ast$)
\begin{DoxyCompactList}\small\item\em Prints all drivers known to the system to the file given as argument. \end{DoxyCompactList}\item 
struct \hyperlink{structdriver}{driver} $\ast$ \hyperlink{drv__admin_8h_a6611f353b900834d1db0df47632be2ef}{for\+\_\+each\+\_\+driver} (\hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func} func, void $\ast$arg)
\item 
void \hyperlink{drv__admin_8h_a9b76aa2090cad96593984bd833c3484c}{for\+\_\+each\+\_\+plugin} (\hyperlink{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{plugin\+\_\+guest\+\_\+func} plugin\+\_\+guest, void $\ast$arg)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Routines for dynamic drivers.

Functions in this file provides primitives to iterate over the dynamic drivers + a single function to install such a driver. 

\begin{DoxyAuthor}{Author}
Alec Leamas 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
August 2014  G\+P\+L2 or later Drivers are loaded from a path defined by (falling priority)\+:
\end{DoxyDate}

\begin{DoxyItemize}
\item The \char`\"{}lircd\+:pluginpath\char`\"{} option.
\item The L\+I\+R\+C\+\_\+\+P\+L\+U\+G\+I\+N\+\_\+\+P\+A\+T\+H environment variable.
\item The hardcoded P\+L\+U\+G\+I\+N\+D\+I\+R constant. 
\end{DoxyItemize}

\subsection{Typedef Documentation}
\hypertarget{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{}\index{drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}!drv\+\_\+guest\+\_\+func@{drv\+\_\+guest\+\_\+func}}
\index{drv\+\_\+guest\+\_\+func@{drv\+\_\+guest\+\_\+func}!drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}}
\subsubsection[{drv\+\_\+guest\+\_\+func}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf driver}$\ast$($\ast$ drv\+\_\+guest\+\_\+func) (struct {\bf driver} $\ast$, void $\ast$)}\label{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}
Argument to \hyperlink{drv__admin_8h_a6611f353b900834d1db0df47632be2ef}{for\+\_\+each\+\_\+driver()}. Called with the loaded struct driver$\ast$ data and the argument given to \hyperlink{drv__admin_8h_a6611f353b900834d1db0df47632be2ef}{for\+\_\+each\+\_\+driver()}. Returns N\+U\+L\+L if iteration should continue, else a struct hardware$\ast$ pointer. 

Definition at line 32 of file drv\+\_\+admin.\+h.

\hypertarget{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{}\index{drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}!plugin\+\_\+guest\+\_\+func@{plugin\+\_\+guest\+\_\+func}}
\index{plugin\+\_\+guest\+\_\+func@{plugin\+\_\+guest\+\_\+func}!drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}}
\subsubsection[{plugin\+\_\+guest\+\_\+func}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf driver}$\ast$($\ast$  plugin\+\_\+guest\+\_\+func) (const char $\ast$, {\bf drv\+\_\+guest\+\_\+func}, void $\ast$)}\label{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}
Argument to for\+\_\+each\+\_\+plugin. Called with a path to the so-\/file, a function to apply to each found driver (see \hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func()}) and an untyped argument given to \hyperlink{drv__admin_8h_a9b76aa2090cad96593984bd833c3484c}{for\+\_\+each\+\_\+plugin()}. Returns N\+U\+L\+L if iteration should continue, else a struct driver$\ast$ pointer. 

Definition at line 41 of file drv\+\_\+admin.\+h.



\subsection{Function Documentation}
\hypertarget{drv__admin_8h_a6611f353b900834d1db0df47632be2ef}{}\index{drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}!for\+\_\+each\+\_\+driver@{for\+\_\+each\+\_\+driver}}
\index{for\+\_\+each\+\_\+driver@{for\+\_\+each\+\_\+driver}!drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}}
\subsubsection[{for\+\_\+each\+\_\+driver}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf driver}$\ast$ for\+\_\+each\+\_\+driver (
\begin{DoxyParamCaption}
\item[{{\bf drv\+\_\+guest\+\_\+func}}]{func, }
\item[{void $\ast$}]{arg}
\end{DoxyParamCaption}
)}\label{drv__admin_8h_a6611f353b900834d1db0df47632be2ef}
Apply func to all existing drivers. Returns pointer to a driver if such a pointer is returned by func(), else N\+U\+L\+L. 

Definition at line 213 of file drv\+\_\+admin.\+c.

\hypertarget{drv__admin_8h_a9b76aa2090cad96593984bd833c3484c}{}\index{drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}!for\+\_\+each\+\_\+plugin@{for\+\_\+each\+\_\+plugin}}
\index{for\+\_\+each\+\_\+plugin@{for\+\_\+each\+\_\+plugin}!drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}}
\subsubsection[{for\+\_\+each\+\_\+plugin}]{\setlength{\rightskip}{0pt plus 5cm}void for\+\_\+each\+\_\+plugin (
\begin{DoxyParamCaption}
\item[{{\bf plugin\+\_\+guest\+\_\+func}}]{plugin\+\_\+guest, }
\item[{void $\ast$}]{arg}
\end{DoxyParamCaption}
)}\label{drv__admin_8h_a9b76aa2090cad96593984bd833c3484c}
Apply func to all plugins (i. e., .so-\/files) in current plugin path. 

Definition at line 219 of file drv\+\_\+admin.\+c.

\hypertarget{drv__admin_8h_a1eaff4902d2d278d2d42e47e763c89da}{}\index{drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}!hw\+\_\+choose\+\_\+driver@{hw\+\_\+choose\+\_\+driver}}
\index{hw\+\_\+choose\+\_\+driver@{hw\+\_\+choose\+\_\+driver}!drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}}
\subsubsection[{hw\+\_\+choose\+\_\+driver}]{\setlength{\rightskip}{0pt plus 5cm}int hw\+\_\+choose\+\_\+driver (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}\label{drv__admin_8h_a1eaff4902d2d278d2d42e47e763c89da}
Search for driver with given name, update global drv with driver data if found.

\begin{DoxyReturn}{Returns}
Returns 0 if found and hw updated, else -\/1. 
\end{DoxyReturn}


Definition at line 247 of file drv\+\_\+admin.\+c.

\hypertarget{drv__admin_8h_af73a4ec1270778bae0a0376af1c79b6b}{}\index{drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}!hw\+\_\+print\+\_\+drivers@{hw\+\_\+print\+\_\+drivers}}
\index{hw\+\_\+print\+\_\+drivers@{hw\+\_\+print\+\_\+drivers}!drv\+\_\+admin.\+h@{drv\+\_\+admin.\+h}}
\subsubsection[{hw\+\_\+print\+\_\+drivers}]{\setlength{\rightskip}{0pt plus 5cm}void hw\+\_\+print\+\_\+drivers (
\begin{DoxyParamCaption}
\item[{F\+I\+L\+E $\ast$}]{file}
\end{DoxyParamCaption}
)}\label{drv__admin_8h_af73a4ec1270778bae0a0376af1c79b6b}


Prints all drivers known to the system to the file given as argument. 


\begin{DoxyParams}{Parameters}
{\em file} & File to print to. \\
\hline
\end{DoxyParams}


Definition at line 229 of file drv\+\_\+admin.\+c.

