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


Implements \hyperlink{drv__admin_8h}{drv\+\_\+admin.\+h}.  


{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$dirent.\+h$>$}\\*
{\ttfamily \#include $<$dlfcn.\+h$>$}\\*
{\ttfamily \#include \char`\"{}lirc/driver.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}lirc/drv\+\_\+admin.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}lirc/lirc\+\_\+options.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}lirc\+\_\+log.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}driver.\+h\char`\"{}}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{drv__admin_8c_a253adbfdf28c48f8e6cbe1e85b31e05a}{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S}~256
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structdriver}{driver} $\ast$ \hyperlink{drv__admin_8c_a6611f353b900834d1db0df47632be2ef}{for\+\_\+each\+\_\+driver} (\hyperlink{drv__admin_8h_a66ecd0448214de7b954a4c0307fc1e4b}{drv\+\_\+guest\+\_\+func} func, void $\ast$arg)
\item 
void \hyperlink{drv__admin_8c_a9b76aa2090cad96593984bd833c3484c}{for\+\_\+each\+\_\+plugin} (\hyperlink{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{plugin\+\_\+guest\+\_\+func} plugin\+\_\+guest, void $\ast$arg)
\item 
void \hyperlink{drv__admin_8c_aa7842693457def5402214040a01004b1}{hw\+\_\+print\+\_\+drivers} (F\+I\+L\+E $\ast$file)
\begin{DoxyCompactList}\small\item\em Prints all drivers known to the system to the file given as argument. \end{DoxyCompactList}\item 
int \hyperlink{drv__admin_8c_a1eaff4902d2d278d2d42e47e763c89da}{hw\+\_\+choose\+\_\+driver} (const char $\ast$name)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structdriver}{driver} \hyperlink{drv__admin_8c_a18548a9bde23bdaa38bd8be5ab24428f}{drv}
\item 
const struct \hyperlink{structdriver}{driver} \hyperlink{drv__admin_8c_a4812505d2b58c85f504503c9cbc3ef45}{drv\+\_\+null}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Implements \hyperlink{drv__admin_8h}{drv\+\_\+admin.\+h}. 

\begin{DoxyAuthor}{Author}
Alec Leamas 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
August 2014 license\+: G\+P\+L2 or later 
\end{DoxyDate}


\subsection{Macro Definition Documentation}
\hypertarget{drv__admin_8c_a253adbfdf28c48f8e6cbe1e85b31e05a}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S@{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S}}
\index{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S@{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\subsubsection[{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+N\+S~256}\label{drv__admin_8c_a253adbfdf28c48f8e6cbe1e85b31e05a}
Max number if plugins handled. No point to malloc() this. 

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



\subsection{Function Documentation}
\hypertarget{drv__admin_8c_a6611f353b900834d1db0df47632be2ef}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!for\+\_\+each\+\_\+driver@{for\+\_\+each\+\_\+driver}}
\index{for\+\_\+each\+\_\+driver@{for\+\_\+each\+\_\+driver}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\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_8c_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_8c_a9b76aa2090cad96593984bd833c3484c}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!for\+\_\+each\+\_\+plugin@{for\+\_\+each\+\_\+plugin}}
\index{for\+\_\+each\+\_\+plugin@{for\+\_\+each\+\_\+plugin}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\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_8c_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_8c_a1eaff4902d2d278d2d42e47e763c89da}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!hw\+\_\+choose\+\_\+driver@{hw\+\_\+choose\+\_\+driver}}
\index{hw\+\_\+choose\+\_\+driver@{hw\+\_\+choose\+\_\+driver}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\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_8c_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_8c_aa7842693457def5402214040a01004b1}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!hw\+\_\+print\+\_\+drivers@{hw\+\_\+print\+\_\+drivers}}
\index{hw\+\_\+print\+\_\+drivers@{hw\+\_\+print\+\_\+drivers}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\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_8c_aa7842693457def5402214040a01004b1}


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.



\subsection{Variable Documentation}
\hypertarget{drv__admin_8c_a18548a9bde23bdaa38bd8be5ab24428f}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!drv@{drv}}
\index{drv@{drv}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\subsubsection[{drv}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf driver} drv}\label{drv__admin_8c_a18548a9bde23bdaa38bd8be5ab24428f}
Access to otherwise private drv.

The global driver data that drivers etc are accessing. Set by \hyperlink{drv__admin_8c_a1eaff4902d2d278d2d42e47e763c89da}{hw\+\_\+choose\+\_\+driver()}. 

Definition at line 20 of file driver.\+c.

\hypertarget{drv__admin_8c_a4812505d2b58c85f504503c9cbc3ef45}{}\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!drv\+\_\+null@{drv\+\_\+null}}
\index{drv\+\_\+null@{drv\+\_\+null}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\subsubsection[{drv\+\_\+null}]{\setlength{\rightskip}{0pt plus 5cm}const struct {\bf driver} drv\+\_\+null}\label{drv__admin_8c_a4812505d2b58c85f504503c9cbc3ef45}
{\bfseries Initial value\+:}
\begin{DoxyCode}
= \{
        .name           = \textcolor{stringliteral}{"null"},
        .device         = \textcolor{stringliteral}{"/dev/null"},
        .features       = 0,
        .send\_mode      = 0,
        .rec\_mode       = 0,
        .code\_length    = 0,
        .init\_func      = NULL,
        .deinit\_func    = NULL,
        .send\_func      = NULL,
        .rec\_func       = NULL,
        .decode\_func    = NULL,
        .readdata       = NULL,
        .drvctl\_func    = \hyperlink{group__driver__api_ga96e3243bc45ff488f6c55dde5e9b377b}{default\_drvctl},
        .open\_func      = \hyperlink{group__driver__api_gac0f7baaef9fe524365c16022001804d3}{default\_open},
        .close\_func     = \hyperlink{group__driver__api_ga683dd53e7e5d62746c1a645fe133daf0}{default\_close},
        .api\_version    = 2,
        .driver\_version = \textcolor{stringliteral}{"0.9.2"}
\}
\end{DoxyCode}
Default driver, a placeholder. 

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

