hwlocality_info_attr.3 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .TH "hwlocality_info_attr" 3 "Thu Sep 7 2023" "Version 2.9.3" "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. .in +1c
  11. .ti -1c
  12. .RI "static const char * \fBhwloc_obj_get_info_by_name\fP (\fBhwloc_obj_t\fP obj, const char *name)"
  13. .br
  14. .ti -1c
  15. .RI "int \fBhwloc_obj_add_info\fP (\fBhwloc_obj_t\fP obj, const char *name, const char *value)"
  16. .br
  17. .in -1c
  18. .SH "Detailed Description"
  19. .PP
  20. .SH "Function Documentation"
  21. .PP
  22. .SS "int hwloc_obj_add_info (\fBhwloc_obj_t\fP obj, const char * name, const char * value)"
  23. .PP
  24. 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\&.
  25. .PP
  26. The input strings are copied before being added in the object infos\&.
  27. .PP
  28. \fBReturns\fP
  29. .RS 4
  30. \fC0\fP on success, \fC-1\fP on error\&.
  31. .RE
  32. .PP
  33. \fBNote\fP
  34. .RS 4
  35. 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\&.
  36. .PP
  37. 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\&.
  38. .RE
  39. .PP
  40. .SS "static const char * hwloc_obj_get_info_by_name (\fBhwloc_obj_t\fP obj, const char * name)\fC [inline]\fP, \fC [static]\fP"
  41. .PP
  42. 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\&.
  43. .PP
  44. \fBReturns\fP
  45. .RS 4
  46. A pointer to the value string if it exists\&.
  47. .PP
  48. \fCNULL\fP if no such info attribute exists\&.
  49. .RE
  50. .PP
  51. \fBNote\fP
  52. .RS 4
  53. The string should not be freed by the caller, it belongs to the hwloc library\&.
  54. .RE
  55. .PP
  56. .SH "Author"
  57. .PP
  58. Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.