| 1 |
.TH "hwlocality_info_attr" 3 "Version 2.14.0" "Hardware Locality (hwloc)" \" -*- nroff -*- |
| 2 |
.ad l |
| 3 |
.nh |
| 4 |
.SH NAME |
| 5 |
hwlocality_info_attr \- Consulting and Adding Info Attributes |
| 6 |
.SH SYNOPSIS |
| 7 |
.br |
| 8 |
.PP |
| 9 |
.SS "Functions" |
| 10 |
|
| 11 |
.in +1c |
| 12 |
.ti -1c |
| 13 |
.RI "const char * \fBhwloc_obj_get_info_by_name\fP (\fBhwloc_obj_t\fP obj, const char *name)" |
| 14 |
.br |
| 15 |
.ti -1c |
| 16 |
.RI "int \fBhwloc_obj_add_info\fP (\fBhwloc_obj_t\fP obj, const char *name, const char *value)" |
| 17 |
.br |
| 18 |
.ti -1c |
| 19 |
.RI "int \fBhwloc_obj_set_subtype\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj, const char *subtype)" |
| 20 |
.br |
| 21 |
.in -1c |
| 22 |
.SH "Detailed Description" |
| 23 |
.PP |
| 24 |
|
| 25 |
.SH "Function Documentation" |
| 26 |
.PP |
| 27 |
.SS "int hwloc_obj_add_info (\fBhwloc_obj_t\fP obj, const char * name, const char * value)" |
| 28 |
|
| 29 |
.PP |
| 30 |
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\&. |
| 31 |
|
| 32 |
.PP |
| 33 |
The input strings are copied before being added in the object infos\&. |
| 34 |
|
| 35 |
.PP |
| 36 |
\fBReturns\fP |
| 37 |
.RS 4 |
| 38 |
\fR0\fP on success, \fR-1\fP on error\&. |
| 39 |
.RE |
| 40 |
.PP |
| 41 |
\fBNote\fP |
| 42 |
.RS 4 |
| 43 |
This function may be used to enforce object colors in the lstopo graphical output by adding "lstopoStyle" as a name and "Background=#rrggbb" as a value\&. See CUSTOM COLORS in the lstopo(1) manpage for details\&. |
| 44 |
|
| 45 |
.PP |
| 46 |
If \fRname\fP or \fRvalue\fP contain some non-printable characters, they will be dropped when exporting to XML, see \fBhwloc_topology_export_xml()\fP in \fBhwloc/export\&.h\fP\&. |
| 47 |
.RE |
| 48 |
.PP |
| 49 |
|
| 50 |
.SS "const char * hwloc_obj_get_info_by_name (\fBhwloc_obj_t\fP obj, const char * name)\fR [inline]\fP" |
| 51 |
|
| 52 |
.PP |
| 53 |
Search the given name in object infos and return the corresponding value\&. If multiple info attributes match the given name, only the first one is returned\&. |
| 54 |
|
| 55 |
.PP |
| 56 |
\fBReturns\fP |
| 57 |
.RS 4 |
| 58 |
A pointer to the value string if it exists\&. |
| 59 |
|
| 60 |
.PP |
| 61 |
\fRNULL\fP if no such info attribute exists\&. |
| 62 |
.RE |
| 63 |
.PP |
| 64 |
\fBNote\fP |
| 65 |
.RS 4 |
| 66 |
The string should not be freed by the caller, it belongs to the hwloc library\&. |
| 67 |
.RE |
| 68 |
.PP |
| 69 |
|
| 70 |
.SS "int hwloc_obj_set_subtype (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj, const char * subtype)" |
| 71 |
|
| 72 |
.PP |
| 73 |
Set (or replace) the subtype of an object\&. The given \fRsubtype\fP is copied internally, the caller is responsible for freeing the original \fRsubtype\fP if needed\&. |
| 74 |
|
| 75 |
.PP |
| 76 |
If another subtype already exists in \fRobject\fP, it is replaced\&. The given \fRsubtype\fP may be \fRNULL\fP to remove the existing subtype\&. |
| 77 |
|
| 78 |
.PP |
| 79 |
\fBNote\fP |
| 80 |
.RS 4 |
| 81 |
This function is mostly meant to initialize the subtype of user-added objects such as groups with \fBhwloc_topology_alloc_group_object()\fP\&. |
| 82 |
.RE |
| 83 |
.PP |
| 84 |
\fBReturns\fP |
| 85 |
.RS 4 |
| 86 |
\fR0\fP on success\&. |
| 87 |
|
| 88 |
.PP |
| 89 |
\fR-1\fP with \fRerrno\fP set to \fRENOMEM\fP on failure to allocate memory\&. |
| 90 |
.RE |
| 91 |
.PP |
| 92 |
|
| 93 |
.SH "Author" |
| 94 |
.PP |
| 95 |
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&. |