1SD_HWDB_NEW(3)                    sd_hwdb_new                   SD_HWDB_NEW(3)
2
3
4

NAME

6       sd_hwdb_new, sd_hwdb_ref, sd_hwdb_unref - Create a new hwdb object and
7       create or destroy references to it
8

SYNOPSIS

10       #include <systemd/sd-hwdb.h>
11
12       int sd_hwdb_new(sd_hwdb **hwdb);
13
14       sd_hwdb* sd_hwdb_ref(sd_hwdb *hwdb);
15
16       sd_hwdb* sd_hwdb_unref(sd_hwdb *hwdb);
17

DESCRIPTION

19       sd_hwdb_new() creates a new hwdb object to access the binary hwdb
20       database. Upon initialization, the file containing the binary
21       representation of the hardware database is located and opened. The new
22       object is returned in hwdb.
23
24       The hwdb object is reference counted.  sd_hwdb_ref() and
25       sd_hwdb_unref() may be used to get a new reference or destroy an
26       existing reference to an object. The caller must dispose of the
27       reference acquired with sd_hwdb_new() by calling sd_hwdb_unref() when
28       done with the object.
29
30       Use sd_hwdb_seek(3), sd_hwdb_get(3), and sd_hwdb_enumerate(3) to access
31       entries.
32

RETURN VALUE

34       On success, sd_hwdb_new() returns a non-negative integer. On failure,
35       it returns a negative errno-style error code.
36
37       sd_hwdb_ref() always returns the argument.
38
39       sd_hwdb_unref() always returns NULL.
40
41   Errors
42       Returned errors may indicate the following problems:
43
44       -ENOENT
45           The binary hardware database file could not be located. See
46           systemd-hwdb(8) for more information.
47
48       -EINVAL
49           The located binary hardware database file is in an incompatible
50           format.
51
52       -ENOMEM
53           Memory allocation failed.
54

NOTES

56       These APIs are implemented as a shared library, which can be compiled
57       and linked to with the libsystemd pkg-config(1) file.
58

SEE ALSO

60       systemd(1), systemd-udevd.service(8), sd-hwdb(3), systemd-hwdb(3)
61
62
63
64systemd 251                                                     SD_HWDB_NEW(3)
Impressum