Hardware Locality (hwloc)
master-20230831.0905.git364652f8b
|
Enumerations | |
enum | hwloc_modify_infos_op_e { HWLOC_MODIFY_INFOS_OP_ADD, HWLOC_MODIFY_INFOS_OP_ADD_UNIQUE, HWLOC_MODIFY_INFOS_OP_REPLACE, HWLOC_MODIFY_INFOS_OP_REMOVE } |
Functions | |
static const char * | hwloc_obj_get_info_by_name (hwloc_obj_t obj, const char *name) |
static const char * | hwloc_get_info_by_name (struct hwloc_infos_s *infos, const char *name) |
int | hwloc_modify_infos (struct hwloc_infos_s *infos, unsigned long operation, const char *name, const char *value) |
static int | hwloc_obj_add_info (hwloc_obj_t obj, const char *name, const char *value) |
struct hwloc_infos_s * | hwloc_topology_get_infos (hwloc_topology_t topology) |
Operations given to hwloc_modify_infos().
|
inlinestatic |
Search the given name in the array of infos and return the corresponding value.
If multiple info attributes match the given name, only the first one is returned.
NULL
if no such info attribute exists.int hwloc_modify_infos | ( | struct hwloc_infos_s * | infos, |
unsigned long | operation, | ||
const char * | name, | ||
const char * | value | ||
) |
Modify an array of info attributes.
operation
is a single value among hwloc_modify_infos_op_e.
If adding (HWLOC_MODIFY_INFOS_OP_ADD or HWLOC_MODIFY_INFOS_OP_ADD_UNIQUE) or replacing (HWLOC_MODIFY_INFOS_OP_REPLACE) an info attribute, name
and value
cannot be NULL
. The input strings are copied before being added in the object infos.
If removing existing info pairs (HWLOC_MODIFY_INFOS_OP_REMOVE), name
and/or value
may be non NULL
to specify which pair(s) to remove. If both name
and value
are NULL
, all pairs are removed.
0
if the request was valid but no change was applied. -1
on error.value
contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h.
|
inlinestatic |
Add the given name and value pair to the given object info attributes.
The info pair is appended to the existing info array even if another pair with the same name already exists. See hwloc_modify_infos() for a more flexible variant.
The input strings are copied before being added in the object infos.
name
and value
must be non NULL
.
0
on success, -1
on error.name
or value
contain some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h.
|
inlinestatic |
Search the given name in the object array of infos and return the corresponding value.
Identical to hwloc_get_info_by_name() but operates on the infos of the given object.
struct hwloc_infos_s* hwloc_topology_get_infos | ( | hwloc_topology_t | topology | ) |
Get the structure of info attributes attached to the topology.
These attributes contain information about the topology discovery (backends) and about the operating system.
NULL
.