dmi_attribute_name
Synopsis
#include <opendmi/attribute.h>
const char *dmi_attribute_name(const dmi_attribute_t *attr, const char *owner);
Description
The dmi_attribute_name function returns the printable name of the attribute
attr, e.g. Data bus width, translated to the locale set by
dmi_set_locale if the library has a translation for it, and the .name
the attribute is declared with otherwise, see DMI_ATTRIBUTE.
Translations are keyed by the code of the attribute, .code, and are looked
up in the attribute table of the structure the attribute belongs to, named
by owner, and then in the shared attribute table, which holds the names
common to all structures, e.g. manufacturer. The name of the structure takes
precedence, so that a common name may be overridden where it does not fit. An
attribute with no code is never translated.
The string belongs to the attribute or to the translation, and must not be
freed. A translated name is valid until the locale is changed by
dmi_set_locale.
Return value
Returns the printable name of the attribute, or nullptr if attr is
nullptr, or if the attribute has neither a translation nor a .name.
Errors
DMI_ERROR_ARGUMENT_NULL-
Raised if
attrisnullptr. The function takes no context, so the error reaches no error queue.