DMI_NAMES
Synopsis
#include <opendmi/utils/name.h>
DMI_NAMES({ name, ..., {} })
DMI_NAME_RANGES({ range, ..., {} })
DMI_NAME_UNSPEC(id)
DMI_NAME_UNKNOWN(id)
DMI_NAME_OTHER(id)
DMI_NAME_NONE(id)
DMI_NAME_UNSUPPORTED(id)
DMI_NAME_RESERVED(id)
DMI_NAME_FUNCTION(prefix)
Description
A name set, dmi_name_set_t, names the values of an enumeration or the bits
of a set, see dmi_name_lookup, and is what the .values of an attribute
refers to, see DMI_ATTRIBUTE.
DMI_NAMES-
List of the names of single values, a compound literal of
dmi_name_t, each of an.id, a.codeand a.name, terminated by an empty entry,{}, which the list itself ends with. DMI_NAME_RANGES-
List of the names of ranges of values, a compound literal of
dmi_name_range_t, each of a.start_idand an.end_id, inclusive, a.codeand a.name, terminated the same way. A value named on its own is named so rather than by its range. DMI_NAME_UNSPEC,DMI_NAME_UNKNOWN,DMI_NAME_OTHER,DMI_NAME_NONE,DMI_NAME_UNSUPPORTED,DMI_NAME_RESERVED-
Entries of
DMI_NAMESfor the values the specification names the same way everywhere, e.g.unspecifiedandUnspecified. DMI_NAME_FUNCTION-
Definition of the function naming the values of an enumeration, which returns the name of a value of
<prefix>_tin the name set<prefix>_names, seedmi_name_lookup. The function,<prefix>_name, is declared on its own, and the macro is not followed by a semicolon.
The code of the name set, .code, names the table its names are translated
in, by the codes of the entries, see dmi_name_lookup.
Example
const dmi_name_set_t dmi_chassis_type_names =
{
.code = "chassis-type",
.names = DMI_NAMES({
DMI_NAME_UNSPEC(DMI_CHASSIS_TYPE_UNSPEC),
DMI_NAME_OTHER(DMI_CHASSIS_TYPE_OTHER),
DMI_NAME_UNKNOWN(DMI_CHASSIS_TYPE_UNKNOWN),
{
.id = DMI_CHASSIS_TYPE_DESKTOP,
.code = "desktop",
.name = "Desktop"
},
...
{}
})
};
DMI_NAME_FUNCTION(dmi_chassis_type)