sd_hwdb_unref(3) — Linux manual page


SD_HWDB_NEW(3)                   sd_hwdb_new                  SD_HWDB_NEW(3)

NAME         top

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

SYNOPSIS         top

       #include <systemd/sd-hwdb.h>

       int sd_hwdb_new(sd_hwdb **hwdb);

       sd_hwdb* sd_hwdb_ref(sd_hwdb *hwdb);

       sd_hwdb* sd_hwdb_unref(sd_hwdb *hwdb);

DESCRIPTION         top

       sd_hwdb_new() creates a new hwdb object to access the binary hwdb
       database. Upon initialization, the file containing the binary
       representation of the hardware database is located and opened. The
       new object is returned in hwdb.

       The hwdb object is reference counted.  sd_hwdb_ref() and
       sd_hwdb_unref() may be used to get a new reference or destroy an
       existing reference to an object. The caller must dispose of the
       reference acquired with sd_hwdb_new() by calling sd_hwdb_unref() when
       done with the object.

       Use sd_hwdb_seek(3), sd_hwdb_get(3), and sd_hwdb_enumerate(3) to
       access entries.

RETURN VALUE         top

       On success, sd_hwdb_new() returns a non-negative integer. On failure,
       it returns a negative errno-style error code.

       sd_hwdb_ref() always returns the argument.

       sd_hwdb_unref() always returns NULL.

       Returned errors may indicate the following problems:

           The binary hardware database file could not be located. See
           systemd-hwdb(8) for more information.

           The located binary hardware database file is in an incompatible

           Memory allocation failed.

NOTES         top

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

SEE ALSO         top

       systemd(1), systemd-udevd.service(8), sd-hwdb(3), systemd-hwdb(3)

COLOPHON         top

       This page is part of the systemd (systemd system and service manager)
       project.  Information about the project can be found at 
       ⟨⟩.  If you have a bug
       report for this manual page, see
       ⟨⟩.  This
       page was obtained from the project's upstream Git repository
       ⟨⟩ on 2020-09-18.  (At that
       time, the date of the most recent commit that was found in the repos‐
       itory was 2020-09-18.)  If you discover any rendering problems in
       this HTML version of the page, or you believe there is a better or
       more up-to-date source for the page, or you have corrections or
       improvements to the information in this COLOPHON (which is not part
       of the original manual page), send a mail to

systemd 246                                                   SD_HWDB_NEW(3)

Pages that refer to this page: 30-systemd-environment-d-generator(7)systemd.index(7)