\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(3a062f7 2016-\/01-\/06 15\+:30\+:13 +0100)@{/home/mk/tmp/lirc/lib/drv\+\_\+admin.\+h(3a062f7 2016-\/01-\/06 15\+:30\+:13 +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`\"{}}\newline
\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\+LE $\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_a20c8785b0c4a112a87b05eec158ecef7}{for\+\_\+each\+\_\+driver} (\hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func} func, void $\ast$arg, const char $\ast$pluginpath)
\item 
void \hyperlink{drv__admin_8h_aac333496b18370092de4b8a1efde53d5}{for\+\_\+each\+\_\+plugin} (\hyperlink{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{plugin\+\_\+guest\+\_\+func} plugin\+\_\+guest, void $\ast$arg, const char $\ast$pluginpath)
\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\+TH environment variable.
\item The hardcoded P\+L\+U\+G\+I\+N\+D\+IR constant. 
\end{DoxyItemize}

\subsection{Typedef Documentation}
\hypertarget{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{}\label{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{\texorpdfstring{drv\+\_\+guest\+\_\+func}{drv\_guest\_func}}
{\footnotesize\ttfamily typedef struct \hyperlink{structdriver}{driver}$\ast$($\ast$ drv\+\_\+guest\+\_\+func) (struct \hyperlink{structdriver}{driver} $\ast$, void $\ast$)}

Argument to \hyperlink{drv__admin_8h_a20c8785b0c4a112a87b05eec158ecef7}{for\+\_\+each\+\_\+driver()}. Called with the loaded struct driver$\ast$ data and the argument given to \hyperlink{drv__admin_8h_a20c8785b0c4a112a87b05eec158ecef7}{for\+\_\+each\+\_\+driver()}. Returns N\+U\+LL if iteration should continue, else a struct hardware$\ast$ pointer. 

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

\hypertarget{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{}\label{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{\texorpdfstring{plugin\+\_\+guest\+\_\+func}{plugin\_guest\_func}}
{\footnotesize\ttfamily typedef struct \hyperlink{structdriver}{driver}$\ast$($\ast$  plugin\+\_\+guest\+\_\+func) (const char $\ast$, \hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func}, void $\ast$)}

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_aac333496b18370092de4b8a1efde53d5}{for\+\_\+each\+\_\+plugin()}. Returns N\+U\+LL 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_a20c8785b0c4a112a87b05eec158ecef7}{}\label{drv__admin_8h_a20c8785b0c4a112a87b05eec158ecef7} 
\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{\texorpdfstring{for\+\_\+each\+\_\+driver()}{for\_each\_driver()}}
{\footnotesize\ttfamily struct \hyperlink{structdriver}{driver}$\ast$ for\+\_\+each\+\_\+driver (\begin{DoxyParamCaption}\item[{\hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func}}]{func,  }\item[{void $\ast$}]{arg,  }\item[{const char $\ast$}]{pluginpath }\end{DoxyParamCaption})}

Apply func to all existing drivers. Returns pointer to a driver if such a pointer is returned by func(), else N\+U\+LL. Pluginpath defaults to lircd\+:pluginpath, L\+I\+R\+C\+\_\+\+P\+L\+U\+G\+I\+N\+P\+A\+TH and a hardcoded last resort. 

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

\hypertarget{drv__admin_8h_aac333496b18370092de4b8a1efde53d5}{}\label{drv__admin_8h_aac333496b18370092de4b8a1efde53d5} 
\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{\texorpdfstring{for\+\_\+each\+\_\+plugin()}{for\_each\_plugin()}}
{\footnotesize\ttfamily void for\+\_\+each\+\_\+plugin (\begin{DoxyParamCaption}\item[{\hyperlink{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{plugin\+\_\+guest\+\_\+func}}]{plugin\+\_\+guest,  }\item[{void $\ast$}]{arg,  }\item[{const char $\ast$}]{pluginpath }\end{DoxyParamCaption})}

Apply func to all plugins (i. e., .so-\/files) in plugin path. plugin path default to lircd\+:pluginpath, L\+I\+R\+C\+\_\+\+P\+L\+U\+G\+I\+N\+P\+A\+TH and a hardcoded last resort. 

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

\hypertarget{drv__admin_8h_a1eaff4902d2d278d2d42e47e763c89da}{}\label{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{\texorpdfstring{hw\+\_\+choose\+\_\+driver()}{hw\_choose\_driver()}}
{\footnotesize\ttfamily int hw\+\_\+choose\+\_\+driver (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}

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 256 of file drv\+\_\+admin.\+c.

\hypertarget{drv__admin_8h_af73a4ec1270778bae0a0376af1c79b6b}{}\label{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{\texorpdfstring{hw\+\_\+print\+\_\+drivers()}{hw\_print\_drivers()}}
{\footnotesize\ttfamily void hw\+\_\+print\+\_\+drivers (\begin{DoxyParamCaption}\item[{F\+I\+LE $\ast$}]{file }\end{DoxyParamCaption})}



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 238 of file drv\+\_\+admin.\+c.

