## udev_hwdb udev_hwdb — retrieve properties from the hardware database |

## Synopsis

    struct              udev_hwdb;
    struct udev_hwdb *  udev_hwdb_ref                       (struct udev_hwdb *hwdb);
    struct udev_hwdb *  udev_hwdb_unref                     (struct udev_hwdb *hwdb);
    struct udev_hwdb *  udev_hwdb_new                       (struct udev *udev);
    struct udev_list_entry * udev_hwdb_get_properties_list_entry
                                                            (struct udev_hwdb *hwdb,
                                                             const char *modalias,
                                                             unsigned int flags);

## Description

Libudev hardware database interface.

## Details

### struct udev_hwdb

    struct udev_hwdb;

Opaque object representing the hardware database.

### udev_hwdb_ref ()

    struct udev_hwdb *  udev_hwdb_ref                       (struct udev_hwdb *hwdb);

Take a reference of a hwdb context.

`hwdb` : | context
Returns : | the passed enumeration context

### udev_hwdb_unref ()

    struct udev_hwdb *  udev_hwdb_unref                     (struct udev_hwdb *hwdb);

Drop a reference of a hwdb context. If the refcount reaches zero, all resources of the hwdb context will be released.

`hwdb` : | context
Returns : | the passed hwdb context if it has still an active reference, or NULL otherwise.

### udev_hwdb_new ()

    struct udev_hwdb *  udev_hwdb_new                       (struct udev *udev);

Create a hardware database context to query properties for devices.

`udev` : | udev library context
Returns : | a hwdb context.

### udev_hwdb_get_properties_list_entry ()

    struct udev_list_entry * udev_hwdb_get_properties_list_entry
                                                            (struct udev_hwdb *hwdb,
                                                             const char *modalias,
                                                             unsigned int flags);

Lookup a matching device in the hardware database. The lookup key is a modalias string, whose formats are defined for the Linux kernel modules. Examples are: pci:v00008086d00001C2D*, usb:v04F2pB221*. The first entry of a list of retrieved properties is returned.

`hwdb` : | context
`modalias` : | modalias string
`flags` : | (unused)
Returns : | a udev_list_entry.