dmi_get_registry

Synopsis

#include <opendmi/context.h>

dmi_registry_t *dmi_get_registry(dmi_context_t *context);

Description

The dmi_get_registry function returns the registry of an open context, which holds the structures of its table, looked up by handle or by type.

The registry belongs to the context, and is valid until the context is closed.

Parameters

context

Context to query.

Return value

Returns the registry, or nullptr if the context is not open or context is nullptr.

Errors

None.

Examples

dmi_registry_t *registry = dmi_get_registry(context);
dmi_entity_t   *entity   = dmi_registry_lookup_first(registry,
                                                     DMI_TYPE(system), false);
dmi_system_t   *system   = dmi_entity_info(entity, DMI_TYPE(system));