\section{/home/pere/src/debiancvs/pkg-discover/discover/trunk/include/discover/discover.h File Reference}
\label{discover_8h}\index{/home/pere/src/debiancvs/pkg-discover/discover/trunk/include/discover/discover.h@{/home/pere/src/debiancvs/pkg-discover/discover/trunk/include/discover/discover.h}}
Public interface for Discover library. 

{\tt \#include $<$stdbool.h$>$}\par
{\tt \#include $<$discover/sysdep.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf BUS\_\-COUNT}~5
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef void $\ast$( {\bf discover\_\-create\_\-message\_\-t} )(struct {\bf discover\_\-error} $\ast$$\ast$, char $\ast$)
\item 
typedef {\bf discover\_\-error} {\bf discover\_\-error\_\-t}
\item 
typedef {\bf discover\_\-bus\_\-map} {\bf discover\_\-bus\_\-map\_\-t}
\item 
typedef discover\_\-device {\bf discover\_\-device\_\-t}
\item 
typedef discover\_\-data {\bf discover\_\-data\_\-t}
\item 
typedef discover\_\-xml\_\-busclass {\bf discover\_\-xml\_\-busclass\_\-t}
\item 
typedef discover\_\-xml\_\-vendor {\bf discover\_\-xml\_\-vendor\_\-t}
\item 
typedef discover\_\-xml\_\-url {\bf discover\_\-xml\_\-url\_\-t}
\item 
typedef {\bf discover\_\-device\_\-t} $\ast$( {\bf discover\_\-device\_\-func\_\-t} )({\bf discover\_\-error\_\-t} $\ast$)
\item 
typedef {\bf discover\_\-xml\_\-busclass\_\-t} $\ast$( {\bf discover\_\-xml\_\-busclass\_\-func\_\-t} )({\bf discover\_\-error\_\-t} $\ast$)
\item 
typedef {\bf discover\_\-xml\_\-vendor\_\-t} $\ast$( {\bf discover\_\-xml\_\-vendor\_\-func\_\-t} )({\bf discover\_\-error\_\-t} $\ast$)
\item 
typedef {\bf discover\_\-xml\_\-url\_\-t} $\ast$( {\bf discover\_\-xml\_\-url\_\-func\_\-t} )({\bf discover\_\-error\_\-t} $\ast$)
\item 
typedef void( {\bf discover\_\-free\_\-func\_\-t} )(void)
\item 
typedef {\bf discover\_\-sysdep\_\-data\_\-t} $\ast$( {\bf discover\_\-sysdep\_\-raw\_\-func\_\-t} )(void)
\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum {\bf discover\_\-error\_\-code\_\-t} \{ \par
{\bf DISCOVER\_\-SUCCESS}, 
{\bf DISCOVER\_\-EIO}, 
{\bf DISCOVER\_\-EXML}, 
{\bf DISCOVER\_\-ESYS}, 
\par
{\bf DISCOVER\_\-EBUSDISABLED}, 
{\bf DISCOVER\_\-EBUSNOTFOUND}, 
{\bf DISCOVER\_\-EDATANOTFOUND}, 
{\bf DISCOVER\_\-EDEVICENOTFOUND}, 
\par
{\bf DISCOVER\_\-EBADVERSION}, 
{\bf DISCOVER\_\-ENOIMPL}
 \}
\item 
enum {\bf discover\_\-bus\_\-t} \{ \par
{\bf ATA}, 
{\bf PCI}, 
{\bf PCMCIA}, 
{\bf SCSI}, 
\par
{\bf USB}
 \}
\item 
enum {\bf discover\_\-filetype\_\-t} \{ {\bf VENDOR\_\-TYPE}, 
{\bf BUSCLASS\_\-TYPE}, 
{\bf DEVICE\_\-TYPE}
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf discover\_\-device\_\-t} $\ast$ {\bf discover\_\-get\_\-devices} ({\bf discover\_\-bus\_\-t} bus, {\bf discover\_\-error\_\-t} $\ast$status)
\item 
void {\bf discover\_\-free\_\-devices} (void)
\item 
{\bf discover\_\-error\_\-t} $\ast$ {\bf discover\_\-error\_\-new} (void)
\item 
void {\bf discover\_\-error\_\-free} ({\bf discover\_\-error\_\-t} $\ast$status)
\item 
char $\ast$ {\bf discover\_\-strerror} ({\bf discover\_\-error\_\-t} $\ast$err)
\item 
int {\bf discover\_\-major\_\-version} (void)
\item 
int {\bf discover\_\-minor\_\-version} (void)
\item 
int {\bf discover\_\-micro\_\-version} (void)
\item 
{\bf discover\_\-device\_\-t} $\ast$ {\bf discover\_\-device\_\-new} (void)
\item 
{\bf discover\_\-device\_\-t} $\ast$ {\bf discover\_\-device\_\-find} (char $\ast$discover\_\-class, {\bf discover\_\-error\_\-t} $\ast$status)
\item 
char $\ast$ {\bf discover\_\-device\_\-get\_\-data} ({\bf discover\_\-device\_\-t} $\ast$device, char $\ast$path, char $\ast$version, {\bf discover\_\-error\_\-t} $\ast$status)
\item 
void {\bf discover\_\-device\_\-copy} ({\bf discover\_\-device\_\-t} $\ast$src, {\bf discover\_\-device\_\-t} $\ast$dst)
\item 
char $\ast$ {\bf discover\_\-device\_\-get\_\-busclass} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
char $\ast$ {\bf discover\_\-device\_\-get\_\-model\_\-id} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
char $\ast$ {\bf discover\_\-device\_\-get\_\-model\_\-name} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
char $\ast$ {\bf discover\_\-device\_\-get\_\-vendor\_\-id} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
char $\ast$ {\bf discover\_\-device\_\-get\_\-vendor\_\-name} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-device\_\-get\_\-data\_\-struct} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
{\bf discover\_\-device\_\-t} $\ast$ {\bf discover\_\-device\_\-get\_\-next} ({\bf discover\_\-device\_\-t} $\ast$device)
\item 
void {\bf discover\_\-device\_\-free} ({\bf discover\_\-device\_\-t} $\ast$devices, int free\_\-data)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-data\_\-new} (void)
\item 
char $\ast$ {\bf discover\_\-data\_\-get\_\-class} ({\bf discover\_\-data\_\-t} $\ast$data)
\item 
char $\ast$ {\bf discover\_\-data\_\-get\_\-text} ({\bf discover\_\-data\_\-t} $\ast$data)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-data\_\-get\_\-parent} ({\bf discover\_\-data\_\-t} $\ast$data)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-data\_\-get\_\-child} ({\bf discover\_\-data\_\-t} $\ast$data)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-data\_\-get\_\-next} ({\bf discover\_\-data\_\-t} $\ast$data)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-data\_\-get\_\-prev} ({\bf discover\_\-data\_\-t} $\ast$prev)
\item 
{\bf discover\_\-data\_\-t} $\ast$ {\bf discover\_\-data\_\-get\_\-first} ({\bf discover\_\-data\_\-t} $\ast$data)
\item 
void {\bf discover\_\-data\_\-free} ({\bf discover\_\-data\_\-t} $\ast$data\_\-tree)
\end{CompactItemize}


\subsection{Detailed Description}
Public interface for Discover library. 



Definition in file {\bf discover.h}.

\subsection{Function Documentation}
\index{discover.h@{discover.h}!discover_free_devices@{discover\_\-free\_\-devices}}
\index{discover_free_devices@{discover\_\-free\_\-devices}!discover.h@{discover.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void discover\_\-free\_\-devices (void)}\label{discover_8h_a34}


Free the currently allocated memory holding the device information. 

Definition at line 301 of file sysdep.c.

References BUS\_\-COUNT, and discover\_\-device\_\-free().\index{discover.h@{discover.h}!discover_get_devices@{discover\_\-get\_\-devices}}
\index{discover_get_devices@{discover\_\-get\_\-devices}!discover.h@{discover.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf discover\_\-device\_\-t}$\ast$ discover\_\-get\_\-devices ({\bf discover\_\-bus\_\-t} {\em bus}, {\bf discover\_\-error\_\-t} $\ast$ {\em status})}\label{discover_8h_a33}


Function responsible for returning a devicelist of current devices 

Definition at line 206 of file sysdep.c.

References \_\-discover\_\-convert\_\-device\_\-data(), \_\-discover\_\-free\_\-sysdep\_\-data(), discover\_\-error::code, discover\_\-conf\_\-get\_\-bus\_\-map(), discover\_\-device\_\-new(), DISCOVER\_\-EBUSDISABLED, DISCOVER\_\-SUCCESS, discover\_\-xml\_\-get\_\-devices(), discover\_\-xml\_\-get\_\-matching\_\-devices(), discover\_\-bus\_\-map::get\_\-raw, and discover\_\-bus\_\-map::scan\_\-never.

Referenced by discover\_\-device\_\-find().