# discover.h File Reference

Public interface for Discover library. More...

`#include <stdbool.h>`
`#include <discover/sysdep.h>`

Go to the source code of this file.

## Defines

#define | BUS_COUNT 5

## Typedefs

typedef void *( | discover_create_message_t )(struct discover_error **, char *)
typedef discover_error | discover_error_t
typedef discover_bus_map | discover_bus_map_t
typedef discover_device | discover_device_t
typedef discover_data | discover_data_t
typedef discover_xml_busclass | discover_xml_busclass_t
typedef discover_xml_vendor | discover_xml_vendor_t
typedef discover_xml_url | discover_xml_url_t
typedef discover_device_t *( | discover_device_func_t )(discover_error_t *)
typedef discover_xml_busclass_t *( | discover_xml_busclass_func_t )(discover_error_t *)
typedef discover_xml_vendor_t *( | discover_xml_vendor_func_t )(discover_error_t *)
typedef discover_xml_url_t *( | discover_xml_url_func_t )(discover_error_t *)
typedef void( | discover_free_func_t )(void)
typedef discover_sysdep_data_t *( | discover_sysdep_raw_func_t )(void)

## Enumerations

enum | discover_error_code_t { DISCOVER_SUCCESS, DISCOVER_EIO, DISCOVER_EXML, DISCOVER_ESYS, DISCOVER_EBUSDISABLED, DISCOVER_EBUSNOTFOUND, DISCOVER_EDATANOTFOUND, DISCOVER_EDEVICENOTFOUND, DISCOVER_EBADVERSION, DISCOVER_ENOIMPL }
enum | discover_bus_t { ATA, PCI, PCMCIA, SCSI, USB }
enum | discover_filetype_t { VENDOR_TYPE, BUSCLASS_TYPE, DEVICE_TYPE }

## Functions

discover_device_t * | discover_get_devices (discover_bus_t bus, discover_error_t *status)
void | discover_free_devices (void)
discover_error_t * | discover_error_new (void)
void | discover_error_free (discover_error_t *status)
char * | discover_strerror (discover_error_t *err)
int | discover_major_version (void)
int | discover_minor_version (void)
int | discover_micro_version (void)
discover_device_t * | discover_device_new (void)
discover_device_t * | discover_device_find (char *discover_class, discover_error_t *status)
char * | discover_device_get_data (discover_device_t *device, char *path, char *version, discover_error_t *status)
void | discover_device_copy (discover_device_t *src, discover_device_t *dst)
char * | discover_device_get_busclass (discover_device_t *device)
char * | discover_device_get_model_id (discover_device_t *device)
char * | discover_device_get_model_name (discover_device_t *device)
char * | discover_device_get_vendor_id (discover_device_t *device)
char * | discover_device_get_vendor_name (discover_device_t *device)
discover_data_t * | discover_device_get_data_struct (discover_device_t *device)
discover_device_t * | discover_device_get_next (discover_device_t *device)
void | discover_device_free (discover_device_t *devices, int free_data)
discover_data_t * | discover_data_new (void)
char * | discover_data_get_class (discover_data_t *data)
char * | discover_data_get_text (discover_data_t *data)
discover_data_t * | discover_data_get_parent (discover_data_t *data)
discover_data_t * | discover_data_get_child (discover_data_t *data)
discover_data_t * | discover_data_get_next (discover_data_t *data)
discover_data_t * | discover_data_get_prev (discover_data_t *prev)
discover_data_t * | discover_data_get_first (discover_data_t *data)
void | discover_data_free (discover_data_t *data_tree)

## Detailed Description

Public interface for Discover library.

Definition in file discover.h.

## Function Documentation

void discover_free_devices | ( | void |  | ) |

| Free the currently allocated memory holding the device information. Definition at line 301 of file sysdep.c. References BUS_COUNT, and discover_device_free().

discover_device_t* discover_get_devices | ( | discover_bus_t | bus,
|  | discover_error_t * | status
| ) |

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().