\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(3a062f7 2016-\/01-\/06 15\+:30\+:13 +0100)@{/home/mk/tmp/lirc/lib/drv\+\_\+admin.\+c(3a062f7 2016-\/01-\/06 15\+:30\+:13 +0100)}}


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


{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$dirent.\+h$>$}\newline
{\ttfamily \#include $<$dlfcn.\+h$>$}\newline
{\ttfamily \#include \char`\"{}lirc/driver.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}lirc/drv\+\_\+admin.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}lirc/lirc\+\_\+options.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}lirc\+\_\+log.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}driver.\+h\char`\"{}}\newline
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{drv__admin_8c_a253adbfdf28c48f8e6cbe1e85b31e05a}{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS}~256
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structdriver}{driver} $\ast$ \hyperlink{drv__admin_8c_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_8c_aac333496b18370092de4b8a1efde53d5}{for\+\_\+each\+\_\+plugin} (\hyperlink{drv__admin_8h_a061d49469cbffaa34c2b73062a2607ab}{plugin\+\_\+guest\+\_\+func} plugin\+\_\+guest, void $\ast$arg, const char $\ast$pluginpath)
\item 
void \hyperlink{drv__admin_8c_aa7842693457def5402214040a01004b1}{hw\+\_\+print\+\_\+drivers} (F\+I\+LE $\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}{}\label{drv__admin_8c_a253adbfdf28c48f8e6cbe1e85b31e05a} 
\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS@{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS}}
\index{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS@{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\subsubsection{\texorpdfstring{M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS}{MAX\_PLUGINS}}
{\footnotesize\ttfamily \#define M\+A\+X\+\_\+\+P\+L\+U\+G\+I\+NS~256}

Max number if plugins handled. No point to malloc() this. 

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



\subsection{Function Documentation}
\hypertarget{drv__admin_8c_a20c8785b0c4a112a87b05eec158ecef7}{}\label{drv__admin_8c_a20c8785b0c4a112a87b05eec158ecef7} 
\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{\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_8c_aac333496b18370092de4b8a1efde53d5}{}\label{drv__admin_8c_aac333496b18370092de4b8a1efde53d5} 
\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{\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_8c_a1eaff4902d2d278d2d42e47e763c89da}{}\label{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{\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_8c_aa7842693457def5402214040a01004b1}{}\label{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{\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.



\subsection{Variable Documentation}
\hypertarget{drv__admin_8c_a18548a9bde23bdaa38bd8be5ab24428f}{}\label{drv__admin_8c_a18548a9bde23bdaa38bd8be5ab24428f} 
\index{drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}!drv@{drv}}
\index{drv@{drv}!drv\+\_\+admin.\+c@{drv\+\_\+admin.\+c}}
\subsubsection{\texorpdfstring{drv}{drv}}
{\footnotesize\ttfamily struct \hyperlink{structdriver}{driver} drv}

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 22 of file driver.\+c.

\hypertarget{drv__admin_8c_a4812505d2b58c85f504503c9cbc3ef45}{}\label{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{\texorpdfstring{drv\+\_\+null}{drv\_null}}
{\footnotesize\ttfamily const struct \hyperlink{structdriver}{driver} drv\+\_\+null}

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

