Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 87b89b73c41f4440bb86afd421c7548f > files > 122

libnl-devel-1.1-14.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libnl: Caching</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnl&#160;<span id="projectnumber">1.1</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#groups">Modules</a>  </div>
  <div class="headertitle">
<h1>Caching</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache.html">Cache</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngr.html">Manager</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Helps keeping caches up to date. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="member-group"></a>
Cache Operations Sets</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga7657cf661e569b4b43842a82e409b5fd">nl_cache_ops_lookup</a> (const char *name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Lookup the set cache operations of a certain cache type.  <a href="#ga7657cf661e569b4b43842a82e409b5fd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga92ddd84e94041733d8def0492b0afc1e">nl_cache_ops_associate</a> (int protocol, int msgtype)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Associate a message type to a set of cache operations.  <a href="#ga92ddd84e94041733d8def0492b0afc1e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structnl__msgtype.html">nl_msgtype</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga8c4f353b471c72ce5158ad89318eb910">nl_msgtype_lookup</a> (struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *ops, int msgtype)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Lookup message type cache association.  <a href="#ga8c4f353b471c72ce5158ad89318eb910"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga36353f3e7b601bbcb6853bd194e59c67">nl_cache_ops_foreach</a> (void(*cb)(struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *, void *), void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Call a function for each registered cache operation.  <a href="#ga36353f3e7b601bbcb6853bd194e59c67"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga390eeb1fa61634cf1c216792c6df63c3">nl_cache_mngt_register</a> (struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *ops)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a set of cache operations.  <a href="#ga390eeb1fa61634cf1c216792c6df63c3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga09f56b767b3868b7e0cf8559863dde77">nl_cache_mngt_unregister</a> (struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *ops)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregister a set of cache operations.  <a href="#ga09f56b767b3868b7e0cf8559863dde77"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Global Cache Provisioning/Requiring</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga6a5f7016b2aa9485979e2de38076014d">nl_cache_mngt_provide</a> (struct nl_cache *cache)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provide a cache for global use.  <a href="#ga6a5f7016b2aa9485979e2de38076014d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#ga4a0c41c6fc0df3e408f80d14c0565615">nl_cache_mngt_unprovide</a> (struct nl_cache *cache)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Unprovide a cache for global use.  <a href="#ga4a0c41c6fc0df3e408f80d14c0565615"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct nl_cache *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cache__mngt.html#gad06c0755c030845c3c90ed490108ea5d">nl_cache_mngt_require</a> (const char *name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Demand the use of a global cache.  <a href="#gad06c0755c030845c3c90ed490108ea5d"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga7657cf661e569b4b43842a82e409b5fd"></a><!-- doxytag: member="cache_mngt.c::nl_cache_ops_lookup" ref="ga7657cf661e569b4b43842a82e409b5fd" args="(const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a>* nl_cache_ops_lookup </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>name of the cache type</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The cache operations or NULL if no operations have been registered under the specified name. </dd></dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00036">36</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>Referenced by <a class="el" href="cache_8c_source.html#l00196">nl_cache_alloc_name()</a>, <a class="el" href="cache__mngr_8c_source.html#l00209">nl_cache_mngr_add()</a>, <a class="el" href="cache__mngt_8c_source.html#l00127">nl_cache_mngt_register()</a>, <a class="el" href="cache__mngt_8c_source.html#l00229">nl_cache_mngt_require()</a>, and <a class="el" href="object_8c_source.html#l00072">nl_object_alloc_name()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *ops;

        <span class="keywordflow">for</span> (ops = cache_ops; ops; ops = ops-&gt;co_next)
                <span class="keywordflow">if</span> (!strcmp(ops-&gt;co_name, name))
                        <span class="keywordflow">return</span> ops;

        <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga92ddd84e94041733d8def0492b0afc1e"></a><!-- doxytag: member="cache_mngt.c::nl_cache_ops_associate" ref="ga92ddd84e94041733d8def0492b0afc1e" args="(int protocol, int msgtype)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a>* nl_cache_ops_associate </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>protocol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>msgtype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">protocol</td><td>netlink protocol </td></tr>
    <tr><td class="paramname">msgtype</td><td>netlink message type</td></tr>
  </table>
  </dd>
</dl>
<p>Associates the specified netlink message type with a registered set of cache operations.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The cache operations or NULL if no association could be made. </dd></dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00058">58</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>References <a class="el" href="cache-api_8h_source.html#l00131">nl_msgtype::mt_id</a>.</p>

<p>Referenced by <a class="el" href="msg_8c_source.html#l00947">nl_msg_dump()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordtype">int</span> i;
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *ops;

        <span class="keywordflow">for</span> (ops = cache_ops; ops; ops = ops-&gt;co_next)
                <span class="keywordflow">for</span> (i = 0; ops-&gt;co_msgtypes[i].<a class="code" href="structnl__msgtype.html#a2b51527c3258ef4231b84d856a7c4164" title="Netlink message type.">mt_id</a> &gt;= 0; i++)
                        <span class="keywordflow">if</span> (ops-&gt;co_msgtypes[i].<a class="code" href="structnl__msgtype.html#a2b51527c3258ef4231b84d856a7c4164" title="Netlink message type.">mt_id</a> == msgtype &amp;&amp;
                            ops-&gt;co_protocol == protocol)
                                <span class="keywordflow">return</span> ops;

        <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga8c4f353b471c72ce5158ad89318eb910"></a><!-- doxytag: member="cache_mngt.c::nl_msgtype_lookup" ref="ga8c4f353b471c72ce5158ad89318eb910" args="(struct nl_cache_ops *ops, int msgtype)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structnl__msgtype.html">nl_msgtype</a>* nl_msgtype_lookup </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *&#160;</td>
          <td class="paramname"><em>ops</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>msgtype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ops</td><td>cache operations </td></tr>
    <tr><td class="paramname">msgtype</td><td>netlink message type</td></tr>
  </table>
  </dd>
</dl>
<p>Searches for a matching message type association ing the specified cache operations.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A message type association or NULL. </dd></dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00082">82</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>References <a class="el" href="cache-api_8h_source.html#l00131">nl_msgtype::mt_id</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordtype">int</span> i;

        <span class="keywordflow">for</span> (i = 0; ops-&gt;co_msgtypes[i].<a class="code" href="structnl__msgtype.html#a2b51527c3258ef4231b84d856a7c4164" title="Netlink message type.">mt_id</a> &gt;= 0; i++)
                <span class="keywordflow">if</span> (ops-&gt;co_msgtypes[i].<a class="code" href="structnl__msgtype.html#a2b51527c3258ef4231b84d856a7c4164" title="Netlink message type.">mt_id</a> == msgtype)
                        <span class="keywordflow">return</span> &amp;ops-&gt;co_msgtypes[i];

        <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga36353f3e7b601bbcb6853bd194e59c67"></a><!-- doxytag: member="cache_mngt.c::nl_cache_ops_foreach" ref="ga36353f3e7b601bbcb6853bd194e59c67" args="(void(*cb)(struct nl_cache_ops *, void *), void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nl_cache_ops_foreach </td>
          <td>(</td>
          <td class="paramtype">void(*)(struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *, void *)&#160;</td>
          <td class="paramname"><em>cb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cb</td><td>Callback function to be called </td></tr>
    <tr><td class="paramname">arg</td><td>User specific argument. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00110">110</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *ops;

        <span class="keywordflow">for</span> (ops = cache_ops; ops; ops = ops-&gt;co_next)
                cb(ops, arg);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga390eeb1fa61634cf1c216792c6df63c3"></a><!-- doxytag: member="cache_mngt.c::nl_cache_mngt_register" ref="ga390eeb1fa61634cf1c216792c6df63c3" args="(struct nl_cache_ops *ops)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int nl_cache_mngt_register </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *&#160;</td>
          <td class="paramname"><em>ops</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ops</td><td>cache operations</td></tr>
  </table>
  </dd>
</dl>
<p>Called by users of caches to announce the avaibility of a certain cache type.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or a negative error code. </dd></dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00127">127</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>References <a class="el" href="cache__mngt_8c_source.html#l00036">nl_cache_ops_lookup()</a>.</p>

<p>Referenced by <a class="el" href="mngt_8c_source.html#l00172">genl_register()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordflow">if</span> (!ops-&gt;co_name)
                <span class="keywordflow">return</span> nl_error(EINVAL, <span class="stringliteral">&quot;No cache name specified&quot;</span>);

        <span class="keywordflow">if</span> (!ops-&gt;co_obj_ops)
                <span class="keywordflow">return</span> nl_error(EINVAL, <span class="stringliteral">&quot;No obj cache ops specified&quot;</span>);

        <span class="keywordflow">if</span> (<a class="code" href="group__cache__mngt.html#ga7657cf661e569b4b43842a82e409b5fd" title="Lookup the set cache operations of a certain cache type.">nl_cache_ops_lookup</a>(ops-&gt;co_name))
                <span class="keywordflow">return</span> nl_error(EEXIST, <span class="stringliteral">&quot;Cache operations already exist&quot;</span>);
            
        ops-&gt;co_next = cache_ops;
        cache_ops = ops;

        NL_DBG(1, <span class="stringliteral">&quot;Registered cache operations %s\n&quot;</span>, ops-&gt;co_name);

        <span class="keywordflow">return</span> 0;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga09f56b767b3868b7e0cf8559863dde77"></a><!-- doxytag: member="cache_mngt.c::nl_cache_mngt_unregister" ref="ga09f56b767b3868b7e0cf8559863dde77" args="(struct nl_cache_ops *ops)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int nl_cache_mngt_unregister </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnl__cache__ops.html">nl_cache_ops</a> *&#160;</td>
          <td class="paramname"><em>ops</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ops</td><td>cache operations</td></tr>
  </table>
  </dd>
</dl>
<p>Called by users of caches to announce a set of cache operations is no longer available. The specified cache operations must have been registered previously using <a class="el" href="group__cache__mngt.html#ga390eeb1fa61634cf1c216792c6df63c3" title="Register a set of cache operations.">nl_cache_mngt_register()</a></p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or a negative error code </dd></dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00157">157</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>Referenced by <a class="el" href="mngt_8c_source.html#l00214">genl_unregister()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *t, **tp;

        <span class="keywordflow">for</span> (tp = &amp;cache_ops; (t=*tp) != NULL; tp = &amp;t-&gt;co_next)
                <span class="keywordflow">if</span> (t == ops)
                        <span class="keywordflow">break</span>;

        <span class="keywordflow">if</span> (!t)
                <span class="keywordflow">return</span> nl_error(ENOENT, <span class="stringliteral">&quot;No such cache operations&quot;</span>);

        NL_DBG(1, <span class="stringliteral">&quot;Unregistered cache operations %s\n&quot;</span>, ops-&gt;co_name);

        *tp = t-&gt;co_next;
        <span class="keywordflow">return</span> 0;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga6a5f7016b2aa9485979e2de38076014d"></a><!-- doxytag: member="cache_mngt.c::nl_cache_mngt_provide" ref="ga6a5f7016b2aa9485979e2de38076014d" args="(struct nl_cache *cache)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nl_cache_mngt_provide </td>
          <td>(</td>
          <td class="paramtype">struct nl_cache *&#160;</td>
          <td class="paramname"><em>cache</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cache</td><td>cache to provide</td></tr>
  </table>
  </dd>
</dl>
<p>Offers the specified cache to be used by other modules. Only one cache per type may be shared at a time, a previsouly provided caches will be overwritten. </p>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00189">189</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>Referenced by <a class="el" href="cache__mngr_8c_source.html#l00209">nl_cache_mngr_add()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *ops;

        ops = cache_ops_lookup_for_obj(cache-&gt;c_ops-&gt;co_obj_ops);
        <span class="keywordflow">if</span> (!ops)
                BUG();
        <span class="keywordflow">else</span>
                ops-&gt;co_major_cache = cache;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga4a0c41c6fc0df3e408f80d14c0565615"></a><!-- doxytag: member="cache_mngt.c::nl_cache_mngt_unprovide" ref="ga4a0c41c6fc0df3e408f80d14c0565615" args="(struct nl_cache *cache)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nl_cache_mngt_unprovide </td>
          <td>(</td>
          <td class="paramtype">struct nl_cache *&#160;</td>
          <td class="paramname"><em>cache</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cache</td><td>cache to unprovide</td></tr>
  </table>
  </dd>
</dl>
<p>Cancels the offer to use a cache globally. The cache will no longer be returned via lookups but may still be in use. </p>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00208">208</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *ops;

        ops = cache_ops_lookup_for_obj(cache-&gt;c_ops-&gt;co_obj_ops);
        <span class="keywordflow">if</span> (!ops)
                BUG();
        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ops-&gt;co_major_cache == cache)
                ops-&gt;co_major_cache = NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="gad06c0755c030845c3c90ed490108ea5d"></a><!-- doxytag: member="cache_mngt.c::nl_cache_mngt_require" ref="gad06c0755c030845c3c90ed490108ea5d" args="(const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct nl_cache* nl_cache_mngt_require </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>name of the required object type</td></tr>
  </table>
  </dd>
</dl>
<p>Trys to find a cache of the specified type for global use.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A cache provided by another subsystem of the specified type marked to be available. </dd></dl>

<p>Definition at line <a class="el" href="cache__mngt_8c_source.html#l00229">229</a> of file <a class="el" href="cache__mngt_8c_source.html">cache_mngt.c</a>.</p>

<p>References <a class="el" href="cache__mngt_8c_source.html#l00036">nl_cache_ops_lookup()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span><a class="code" href="structnl__cache__ops.html" title="Cache Operations.">nl_cache_ops</a> *ops;

        ops = <a class="code" href="group__cache__mngt.html#ga7657cf661e569b4b43842a82e409b5fd" title="Lookup the set cache operations of a certain cache type.">nl_cache_ops_lookup</a>(name);
        <span class="keywordflow">if</span> (!ops || !ops-&gt;co_major_cache) {
                fprintf(stderr, <span class="stringliteral">&quot;Application BUG: Your application must &quot;</span>
                        <span class="stringliteral">&quot;call nl_cache_mngt_provide() and\nprovide a valid &quot;</span>
                        <span class="stringliteral">&quot;%s cache to be used for internal lookups.\nSee the &quot;</span>
                        <span class="stringliteral">&quot; API documentation for more details.\n&quot;</span>, name);

                <span class="keywordflow">return</span> NULL;
        }
        
        <span class="keywordflow">return</span> ops-&gt;co_major_cache;
}
</pre></div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Mar 21 2011 for libnl by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>