dmi_bool_code

Synopsis

#include <opendmi/value.h>

const char *dmi_bool_code(bool value);
const char *dmi_bool_name(bool value);

Description

The dmi_bool_code function returns the code of a boolean value, a machine-readable identifier which is the same in every language: true or false.

The dmi_bool_name function returns the name of a boolean value, as the command line tool prints a flag: yes or no. The name is translated to the locale set with dmi_set_locale if the library is built with ICU4C support and the locale has a translation of it, and is in English otherwise.

Boolean attributes whose values are not named by the attribute itself are formatted with these functions, see DMI_ATTRIBUTE.

Parameters

value

Value to get the code or the name of.

Return value

The functions return the code or the name of the value, which is never nullptr. The string belongs to the library and must not be modified or freed; a translated name may become invalid once the locale is changed.

Errors

None: the functions take no context to raise errors in.