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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Locality (hwloc): Consulting and Adding Info Attributes</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Hardware Locality (hwloc)<span id="projectnumber"> 2.12.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">Consulting and Adding Info Attributes</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<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="a00169.html#ga840c03c835d41cd6f4d91625c25a238d">hwloc_obj_get_info_by_name</a> (<a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *name)</td></tr>
<tr class="separator:ga840c03c835d41cd6f4d91625c25a238d"><td class="memSeparator" colspan="2"> </td></tr>
<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="a00169.html#gace7654bb8a9002caae1a4b8a59e7452e">hwloc_obj_add_info</a> (<a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *name, const char *value)</td></tr>
<tr class="separator:gace7654bb8a9002caae1a4b8a59e7452e"><td class="memSeparator" colspan="2"> </td></tr>
<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="a00169.html#ga6a07031b69bc7466b6fc4d13d610d47a">hwloc_obj_set_subtype</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *subtype)</td></tr>
<tr class="separator:ga6a07031b69bc7466b6fc4d13d610d47a"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="gace7654bb8a9002caae1a4b8a59e7452e" name="gace7654bb8a9002caae1a4b8a59e7452e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gace7654bb8a9002caae1a4b8a59e7452e">◆ </a></span>hwloc_obj_add_info()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_add_info </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add the given name and value pair to the given object info attributes. </p>
<p>The info pair is appended to the existing info array even if another pair with the same name already exists.</p>
<p>The input strings are copied before being added in the object infos.</p>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <code>-1</code> on error.</dd></dl>
<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>
<dd>
If <code>name</code> or <code>value</code> contain some non-printable characters, they will be dropped when exporting to XML, see <a class="el" href="a00186.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>
</div>
</div>
<a id="ga840c03c835d41cd6f4d91625c25a238d" name="ga840c03c835d41cd6f4d91625c25a238d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga840c03c835d41cd6f4d91625c25a238d">◆ </a></span>hwloc_obj_get_info_by_name()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const char * hwloc_obj_get_info_by_name </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>name</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Search the given name in object infos and return the corresponding value. </p>
<p>If multiple info attributes match the given name, only the first one is returned.</p>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the value string if it exists. </dd>
<dd>
<code>NULL</code> if no such info attribute exists.</dd></dl>
<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>
</div>
</div>
<a id="ga6a07031b69bc7466b6fc4d13d610d47a" name="ga6a07031b69bc7466b6fc4d13d610d47a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6a07031b69bc7466b6fc4d13d610d47a">◆ </a></span>hwloc_obj_set_subtype()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_set_subtype </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>subtype</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set (or replace) the subtype of an object. </p>
<p>The given <code>subtype</code> is copied internally, the caller is responsible for freeing the original <code>subtype</code> if needed.</p>
<p>If another subtype already exists in <code>object</code>, it is replaced. The given <code>subtype</code> may be <code>NULL</code> to remove the existing subtype.</p>
<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="a00174.html#ga4cea4741165faf5323931a9ed8786ef7" title="Allocate a Group object to insert later with hwloc_topology_insert_group_object().">hwloc_topology_alloc_group_object()</a>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> on success. </dd>
<dd>
<code>-1</code> with <code>errno</code> set to <code>ENOMEM</code> on failure to allocate memory. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
|