File: hwlocality_info_attr.3

package info (click to toggle)
hwloc 2.12.0-4~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 23,576 kB
  • sloc: ansic: 60,875; xml: 13,559; sh: 7,332; makefile: 2,154; javascript: 879; cpp: 93; php: 8; sed: 5
file content (87 lines) | stat: -rw-r--r-- 2,843 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.TH "hwlocality_info_attr" 3 "Version 2.12.0" "Hardware Locality (hwloc)" \" -*- nroff -*-
.ad l
.nh
.SH NAME
hwlocality_info_attr \- Consulting and Adding Info Attributes
.SH SYNOPSIS
.br
.PP
.SS "Functions"

.in +1c
.ti -1c
.RI "const char * \fBhwloc_obj_get_info_by_name\fP (\fBhwloc_obj_t\fP obj, const char *name)"
.br
.ti -1c
.RI "int \fBhwloc_obj_add_info\fP (\fBhwloc_obj_t\fP obj, const char *name, const char *value)"
.br
.ti -1c
.RI "int \fBhwloc_obj_set_subtype\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj, const char *subtype)"
.br
.in -1c
.SH "Detailed Description"
.PP 

.SH "Function Documentation"
.PP 
.SS "int hwloc_obj_add_info (\fBhwloc_obj_t\fP obj, const char * name, const char * value)"

.PP
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\&.
.PP
The input strings are copied before being added in the object infos\&.
.PP
\fBReturns\fP
.RS 4
\fC0\fP on success, \fC-1\fP on error\&.
.RE
.PP
\fBNote\fP
.RS 4
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\&.
.PP
If \fCname\fP or \fCvalue\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\&. 
.RE
.PP

.SS "const char * hwloc_obj_get_info_by_name (\fBhwloc_obj_t\fP obj, const char * name)\fC [inline]\fP"

.PP
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\&.
.PP
\fBReturns\fP
.RS 4
A pointer to the value string if it exists\&. 
.PP
\fCNULL\fP if no such info attribute exists\&.
.RE
.PP
\fBNote\fP
.RS 4
The string should not be freed by the caller, it belongs to the hwloc library\&. 
.RE
.PP

.SS "int hwloc_obj_set_subtype (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj, const char * subtype)"

.PP
Set (or replace) the subtype of an object\&. The given \fCsubtype\fP is copied internally, the caller is responsible for freeing the original \fCsubtype\fP if needed\&.
.PP
If another subtype already exists in \fCobject\fP, it is replaced\&. The given \fCsubtype\fP may be \fCNULL\fP to remove the existing subtype\&.
.PP
\fBNote\fP
.RS 4
This function is mostly meant to initialize the subtype of user-added objects such as groups with \fBhwloc_topology_alloc_group_object()\fP\&.
.RE
.PP
\fBReturns\fP
.RS 4
\fC0\fP on success\&. 
.PP
\fC-1\fP with \fCerrno\fP set to \fCENOMEM\fP on failure to allocate memory\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.