| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=11"/> |
| 6 |
<meta name="generator" content="Doxygen 1.15.0"/> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 |
<title>Hardware Locality (hwloc): Consulting and Adding Info Attributes</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<script type="text/javascript" src="clipboard.js"></script> |
| 13 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 14 |
</head> |
| 15 |
<body> |
| 16 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 17 |
<div id="titlearea"> |
| 18 |
<table cellspacing="0" cellpadding="0"> |
| 19 |
<tbody> |
| 20 |
<tr id="projectrow"> |
| 21 |
<td id="projectalign"> |
| 22 |
<div id="projectname">Hardware Locality (hwloc)<span id="projectnumber"> 2.14.0</span> |
| 23 |
</div> |
| 24 |
</td> |
| 25 |
</tr> |
| 26 |
</tbody> |
| 27 |
</table> |
| 28 |
</div> |
| 29 |
<!-- end header part --> |
| 30 |
<!-- Generated by Doxygen 1.15.0 --> |
| 31 |
<script type="text/javascript"> |
| 32 |
$(function() { codefold.init(); }); |
| 33 |
</script> |
| 34 |
<script type="text/javascript" src="menudata.js"></script> |
| 35 |
<script type="text/javascript" src="menu.js"></script> |
| 36 |
<script type="text/javascript"> |
| 37 |
$(function() { |
| 38 |
initMenu('',false,false,'search.php','Search',false); |
| 39 |
}); |
| 40 |
</script> |
| 41 |
<div id="main-nav"></div> |
| 42 |
</div><!-- top --> |
| 43 |
<div id="doc-content"> |
| 44 |
<div class="header"> |
| 45 |
<div class="summary"> |
| 46 |
<a href="#func-members">Functions</a> </div> |
| 47 |
<div class="headertitle"><div class="title">Consulting and Adding Info Attributes </div></div> |
| 48 |
</div><!--header--> |
| 49 |
<div class="contents"> |
| 50 |
<table class="memberdecls"> |
| 51 |
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a> |
| 52 |
Functions</h2></td></tr> |
| 53 |
<tr class="memitem:ga840c03c835d41cd6f4d91625c25a238d" id="r_ga840c03c835d41cd6f4d91625c25a238d"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga840c03c835d41cd6f4d91625c25a238d">hwloc_obj_get_info_by_name</a> (<a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *name)</td></tr> |
| 54 |
<tr class="memitem:gace7654bb8a9002caae1a4b8a59e7452e" id="r_gace7654bb8a9002caae1a4b8a59e7452e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gace7654bb8a9002caae1a4b8a59e7452e">hwloc_obj_add_info</a> (<a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *name, const char *value)</td></tr> |
| 55 |
<tr class="memitem:ga6a07031b69bc7466b6fc4d13d610d47a" id="r_ga6a07031b69bc7466b6fc4d13d610d47a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga6a07031b69bc7466b6fc4d13d610d47a">hwloc_obj_set_subtype</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *subtype)</td></tr> |
| 56 |
</table> |
| 57 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 58 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2> |
| 59 |
<a id="gace7654bb8a9002caae1a4b8a59e7452e" name="gace7654bb8a9002caae1a4b8a59e7452e"></a> |
| 60 |
<h2 class="memtitle"><span class="permalink"><a href="#gace7654bb8a9002caae1a4b8a59e7452e">◆ </a></span>hwloc_obj_add_info()</h2> |
| 61 |
|
| 62 |
<div class="memitem"> |
| 63 |
<div class="memproto"> |
| 64 |
<table class="memname"> |
| 65 |
<tr> |
| 66 |
<td class="memname">int hwloc_obj_add_info </td> |
| 67 |
<td>(</td> |
| 68 |
<td class="paramtype"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></td> <td class="paramname"><span class="paramname"><em>obj</em></span>, </td> |
| 69 |
</tr> |
| 70 |
<tr> |
| 71 |
<td class="paramkey"></td> |
| 72 |
<td></td> |
| 73 |
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>name</em></span>, </td> |
| 74 |
</tr> |
| 75 |
<tr> |
| 76 |
<td class="paramkey"></td> |
| 77 |
<td></td> |
| 78 |
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>value</em></span> )</td> |
| 79 |
</tr> |
| 80 |
</table> |
| 81 |
</div><div class="memdoc"> |
| 82 |
|
| 83 |
<p>Add the given name and value pair to the given object info attributes. </p> |
| 84 |
<p>The info pair is appended to the existing info array even if another pair with the same name already exists.</p> |
| 85 |
<p>The input strings are copied before being added in the object infos.</p> |
| 86 |
<dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <code>-1</code> on error.</dd></dl> |
| 87 |
<dl class="section note"><dt>Note</dt><dd>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.</dd> |
| 88 |
<dd> |
| 89 |
If <code class="param">name</code> or <code class="param">value</code> contain some non-printable characters, they will be dropped when exporting to XML, see <a class="el" href="a00189.html#ga333f79975b4eeb28a3d8fad3373583ce" title="Export the topology into an XML file.">hwloc_topology_export_xml()</a> in <a class="el" href="a00104_source.html">hwloc/export.h</a>. </dd></dl> |
| 90 |
|
| 91 |
</div> |
| 92 |
</div> |
| 93 |
<a id="ga840c03c835d41cd6f4d91625c25a238d" name="ga840c03c835d41cd6f4d91625c25a238d"></a> |
| 94 |
<h2 class="memtitle"><span class="permalink"><a href="#ga840c03c835d41cd6f4d91625c25a238d">◆ </a></span>hwloc_obj_get_info_by_name()</h2> |
| 95 |
|
| 96 |
<div class="memitem"> |
| 97 |
<div class="memproto"> |
| 98 |
<table class="mlabels"> |
| 99 |
<tr> |
| 100 |
<td class="mlabels-left"> |
| 101 |
<table class="memname"> |
| 102 |
<tr> |
| 103 |
<td class="memname">const char * hwloc_obj_get_info_by_name </td> |
| 104 |
<td>(</td> |
| 105 |
<td class="paramtype"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></td> <td class="paramname"><span class="paramname"><em>obj</em></span>, </td> |
| 106 |
</tr> |
| 107 |
<tr> |
| 108 |
<td class="paramkey"></td> |
| 109 |
<td></td> |
| 110 |
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>name</em></span> )</td> |
| 111 |
</tr> |
| 112 |
</table> |
| 113 |
</td> |
| 114 |
<td class="mlabels-right"> |
| 115 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 116 |
</tr> |
| 117 |
</table> |
| 118 |
</div><div class="memdoc"> |
| 119 |
|
| 120 |
<p>Search the given name in object infos and return the corresponding value. </p> |
| 121 |
<p>If multiple info attributes match the given name, only the first one is returned.</p> |
| 122 |
<dl class="section return"><dt>Returns</dt><dd>A pointer to the value string if it exists. </dd> |
| 123 |
<dd> |
| 124 |
<code>NULL</code> if no such info attribute exists.</dd></dl> |
| 125 |
<dl class="section note"><dt>Note</dt><dd>The string should not be freed by the caller, it belongs to the hwloc library. </dd></dl> |
| 126 |
|
| 127 |
</div> |
| 128 |
</div> |
| 129 |
<a id="ga6a07031b69bc7466b6fc4d13d610d47a" name="ga6a07031b69bc7466b6fc4d13d610d47a"></a> |
| 130 |
<h2 class="memtitle"><span class="permalink"><a href="#ga6a07031b69bc7466b6fc4d13d610d47a">◆ </a></span>hwloc_obj_set_subtype()</h2> |
| 131 |
|
| 132 |
<div class="memitem"> |
| 133 |
<div class="memproto"> |
| 134 |
<table class="memname"> |
| 135 |
<tr> |
| 136 |
<td class="memname">int hwloc_obj_set_subtype </td> |
| 137 |
<td>(</td> |
| 138 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 139 |
</tr> |
| 140 |
<tr> |
| 141 |
<td class="paramkey"></td> |
| 142 |
<td></td> |
| 143 |
<td class="paramtype"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></td> <td class="paramname"><span class="paramname"><em>obj</em></span>, </td> |
| 144 |
</tr> |
| 145 |
<tr> |
| 146 |
<td class="paramkey"></td> |
| 147 |
<td></td> |
| 148 |
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>subtype</em></span> )</td> |
| 149 |
</tr> |
| 150 |
</table> |
| 151 |
</div><div class="memdoc"> |
| 152 |
|
| 153 |
<p>Set (or replace) the subtype of an object. </p> |
| 154 |
<p>The given <code class="param">subtype</code> is copied internally, the caller is responsible for freeing the original <code class="param">subtype</code> if needed.</p> |
| 155 |
<p>If another subtype already exists in <code class="param">object</code>, it is replaced. The given <code class="param">subtype</code> may be <code>NULL</code> to remove the existing subtype.</p> |
| 156 |
<dl class="section note"><dt>Note</dt><dd>This function is mostly meant to initialize the subtype of user-added objects such as groups with <a class="el" href="a00177.html#ga4cea4741165faf5323931a9ed8786ef7" title="Allocate a Group object to insert later with hwloc_topology_insert_group_object().">hwloc_topology_alloc_group_object()</a>.</dd></dl> |
| 157 |
<dl class="section return"><dt>Returns</dt><dd><code>0</code> on success. </dd> |
| 158 |
<dd> |
| 159 |
<code>-1</code> with <code class="param">errno</code> set to <code>ENOMEM</code> on failure to allocate memory. </dd></dl> |
| 160 |
|
| 161 |
</div> |
| 162 |
</div> |
| 163 |
</div><!-- contents --> |
| 164 |
<!-- start footer part --> |
| 165 |
<hr class="footer"/><address class="footer"><small> |
| 166 |
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 |
| 167 |
</small></address> |
| 168 |
</div><!-- doc-content --> |
| 169 |
</body> |
| 170 |
</html> |