Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > by-pkgid > 4f37b923758ceff94a2c0ccca62b4b43 > files > 191

libapr1-devel-1.1.1-1mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: Ring Macro Implementations</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>Ring Macro Implementations<br>
<small>
[<a class="el" href="group__APR.html">Apache Portability Runtime library</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga0">APR_RING_ENTRY</a>(elem)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga1">APR_RING_HEAD</a>(head, elem)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>(hp, elem, link)&nbsp;&nbsp;&nbsp;(struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link))</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga3">APR_RING_FIRST</a>(hp)&nbsp;&nbsp;&nbsp;(hp)-&gt;next</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga4">APR_RING_LAST</a>(hp)&nbsp;&nbsp;&nbsp;(hp)-&gt;prev</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>(ep, link)&nbsp;&nbsp;&nbsp;(ep)-&gt;link.next</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga6">APR_RING_PREV</a>(ep, link)&nbsp;&nbsp;&nbsp;(ep)-&gt;link.prev</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga7">APR_RING_INIT</a>(hp, elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga8">APR_RING_EMPTY</a>(hp, elem, link)&nbsp;&nbsp;&nbsp;(APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga9">APR_RING_ELEM_INIT</a>(ep, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga10">APR_RING_SPLICE_BEFORE</a>(lep, ep1, epN, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga11">APR_RING_SPLICE_AFTER</a>(lep, ep1, epN, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga12">APR_RING_INSERT_BEFORE</a>(lep, nep, link)&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga13">APR_RING_INSERT_AFTER</a>(lep, nep, link)&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_AFTER((lep), (nep), (nep), link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga14">APR_RING_SPLICE_HEAD</a>(hp, ep1, epN, elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga15">APR_RING_SPLICE_TAIL</a>(hp, ep1, epN, elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga16">APR_RING_INSERT_HEAD</a>(hp, nep, elem, link)&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga17">APR_RING_INSERT_TAIL</a>(hp, nep, elem, link)&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga18">APR_RING_CONCAT</a>(h1, h2, elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga19">APR_RING_PREPEND</a>(h1, h2, elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga20">APR_RING_UNSPLICE</a>(ep1, epN, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga21">APR_RING_REMOVE</a>(ep, link)&nbsp;&nbsp;&nbsp;APR_RING_UNSPLICE((ep), (ep), link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga22">APR_RING_CHECK_ONE</a>(msg, ptr)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga23">APR_RING_CHECK</a>(hp, elem, link, msg)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga24">APR_RING_CHECK_CONSISTENCY</a>(hp, elem, link)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga25">APR_RING_CHECK_ELEM</a>(ep, elem, link, msg)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__ring.html#ga26">APR_RING_CHECK_ELEM_CONSISTENCY</a>(ep, elem, link)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A ring is a kind of doubly-linked list that can be manipulated without knowing where its head is. <hr><h2>Define Documentation</h2>
<a class="anchor" name="ga23" doxytag="apr_ring.h::APR_RING_CHECK"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_CHECK          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>msg&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Dump all ring pointers to STDERR, starting with the head and looping all the way around the ring back to the head. Aborts if an inconsistency is found. (This is a no-op unless APR_RING_DEBUG is defined.) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>Head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>msg</em>&nbsp;</td><td>Descriptive message </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga24" doxytag="apr_ring.h::APR_RING_CHECK_CONSISTENCY"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_CHECK_CONSISTENCY          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Loops around a ring and checks all the pointers for consistency. Pops an assertion if any inconsistency is found. Same idea as <a class="el" href="group__apr__ring.html#ga23">APR_RING_CHECK()</a> except that it's silent if all is well. (This is a no-op unless APR_RING_DEBUG is defined.) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>Head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga25" doxytag="apr_ring.h::APR_RING_CHECK_ELEM"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_CHECK_ELEM          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>msg&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Dump all ring pointers to STDERR, starting with the given element and looping all the way around the ring back to that element. Aborts if an inconsistency is found. (This is a no-op unless APR_RING_DEBUG is defined.) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep</em>&nbsp;</td><td>The element </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>msg</em>&nbsp;</td><td>Descriptive message </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga26" doxytag="apr_ring.h::APR_RING_CHECK_ELEM_CONSISTENCY"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_CHECK_ELEM_CONSISTENCY          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Loops around a ring, starting with the given element, and checks all the pointers for consistency. Pops an assertion if any inconsistency is found. Same idea as <a class="el" href="group__apr__ring.html#ga25">APR_RING_CHECK_ELEM()</a> except that it's silent if all is well. (This is a no-op unless APR_RING_DEBUG is defined.) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep</em>&nbsp;</td><td>The element </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga22" doxytag="apr_ring.h::APR_RING_CHECK_ONE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_CHECK_ONE          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">msg,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>ptr&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Print a single pointer value to STDERR (This is a no-op unless APR_RING_DEBUG is defined.) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>msg</em>&nbsp;</td><td>Descriptive message </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>Pointer value to print </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga18" doxytag="apr_ring.h::APR_RING_CONCAT"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_CONCAT          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">h1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>h2,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                    \
        <span class="keywordflow">if</span> (!<a class="code" href="group__apr__ring.html#ga8">APR_RING_EMPTY</a>((h2), elem, link)) {                        \
            <a class="code" href="group__apr__ring.html#ga10">APR_RING_SPLICE_BEFORE</a>(<a class="code" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>((h1), elem, link), \
                                  <a class="code" href="group__apr__ring.html#ga3">APR_RING_FIRST</a>((h2)),                 \
                                  <a class="code" href="group__apr__ring.html#ga4">APR_RING_LAST</a>((h2)), link);           \
            <a class="code" href="group__apr__ring.html#ga7">APR_RING_INIT</a>((h2), elem, link);                            \
        }                                                               \
    } <span class="keywordflow">while</span> (0)
</pre></div>Concatenate ring h2 onto the end of ring h1, leaving h2 empty. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>h1</em>&nbsp;</td><td>Head of the ring to concatenate onto </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>h2</em>&nbsp;</td><td>Head of the ring to concatenate </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga9" doxytag="apr_ring.h::APR_RING_ELEM_INIT"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_ELEM_INIT          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                            \
        <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((ep), link) = (ep);                               \
        <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((ep), link) = (ep);                               \
    } <span class="keywordflow">while</span> (0)
</pre></div>Initialize a singleton element <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep</em>&nbsp;</td><td>The element </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga8" doxytag="apr_ring.h::APR_RING_EMPTY"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_EMPTY          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Determine if a ring is empty <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>The head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true or false </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga0" doxytag="apr_ring.h::APR_RING_ENTRY"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_ENTRY          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">elem&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keyword">struct </span>{                                                                \
        <span class="keyword">struct </span>elem *next;                                              \
        <span class="keyword">struct </span>elem *prev;                                              \
    }
</pre></div>The Ring Element<p>
A ring element struct is linked to the other elements in the ring through its ring entry field, e.g. <pre>
      struct my_element_t {
          <a class="el" href="group__apr__ring.html#ga0">APR_RING_ENTRY(my_element_t)</a> link;
          int foo;
          char *bar;
      };
 </pre><p>
An element struct may be put on more than one ring if it has more than one APR_RING_ENTRY field. Each APR_RING_ENTRY has a corresponding APR_RING_HEAD declaration.<p>
<dl compact><dt><b>Warning:</b></dt><dd>For strict C standards compliance you should put the APR_RING_ENTRY first in the element struct unless the head is always part of a larger object with enough earlier fields to accommodate the offsetof() used to compute the ring sentinel below. You can usually ignore this caveat. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="apr_ring.h::APR_RING_FIRST"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_FIRST          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(hp)-&gt;next</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The first element of the ring <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>The head of the ring </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga1" doxytag="apr_ring.h::APR_RING_HEAD"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_HEAD          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">head,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keyword">struct </span>head {                                                   \
        <span class="keyword">struct </span>elem *next;                                              \
        <span class="keyword">struct </span>elem *prev;                                              \
    }
</pre></div>The Ring Head<p>
Each ring is managed via its head, which is a struct declared like this: <pre>
      <a class="el" href="group__apr__ring.html#ga1">APR_RING_HEAD(my_ring_t, my_element_t)</a>;
      struct my_ring_t ring, *ringp;
 </pre><p>
This struct looks just like the element link struct so that we can be sure that the typecasting games will work as expected.<p>
The first element in the ring is next after the head, and the last element is just before the head.     </td>
  </tr>
</table>
<a class="anchor" name="ga7" doxytag="apr_ring.h::APR_RING_INIT"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_INIT          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                            \
        <a class="code" href="group__apr__ring.html#ga3">APR_RING_FIRST</a>((hp)) = <a class="code" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>((hp), elem, link);     \
        <a class="code" href="group__apr__ring.html#ga4">APR_RING_LAST</a>((hp))  = <a class="code" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>((hp), elem, link);     \
    } <span class="keywordflow">while</span> (0)
</pre></div>Initialize a ring <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>The head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga13" doxytag="apr_ring.h::APR_RING_INSERT_AFTER"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_INSERT_AFTER          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">lep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>nep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_AFTER((lep), (nep), (nep), link)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Insert the element nep into the ring after element lep (..lep.. becomes ..lep..nep..) <dl compact><dt><b>Warning:</b></dt><dd>This doesn't work for inserting after the last element or on empty rings... see APR_RING_INSERT_TAIL for one that does </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lep</em>&nbsp;</td><td>Element in the ring to insert after </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nep</em>&nbsp;</td><td>Element to insert </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga12" doxytag="apr_ring.h::APR_RING_INSERT_BEFORE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_INSERT_BEFORE          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">lep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>nep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Insert the element nep into the ring before element lep (..lep.. becomes ..nep..lep..) <dl compact><dt><b>Warning:</b></dt><dd>This doesn't work for inserting before the first element or on empty rings... see APR_RING_INSERT_HEAD for one that does </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lep</em>&nbsp;</td><td>Element in the ring to insert before </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nep</em>&nbsp;</td><td>Element to insert </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga16" doxytag="apr_ring.h::APR_RING_INSERT_HEAD"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_INSERT_HEAD          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>nep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Insert the element nep into the ring before the first element (..hp.. becomes ..hp..nep..) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>Head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nep</em>&nbsp;</td><td>Element to insert </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga17" doxytag="apr_ring.h::APR_RING_INSERT_TAIL"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_INSERT_TAIL          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>nep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Insert the element nep into the ring after the last element (..hp.. becomes ..nep..hp..) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>Head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nep</em>&nbsp;</td><td>Element to insert </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="apr_ring.h::APR_RING_LAST"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_LAST          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(hp)-&gt;prev</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The last element of the ring <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>The head of the ring </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga5" doxytag="apr_ring.h::APR_RING_NEXT"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_NEXT          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(ep)-&gt;link.next</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The next element in the ring <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep</em>&nbsp;</td><td>The current element </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga19" doxytag="apr_ring.h::APR_RING_PREPEND"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_PREPEND          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">h1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>h2,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                    \
        <span class="keywordflow">if</span> (!<a class="code" href="group__apr__ring.html#ga8">APR_RING_EMPTY</a>((h2), elem, link)) {                        \
            <a class="code" href="group__apr__ring.html#ga11">APR_RING_SPLICE_AFTER</a>(<a class="code" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>((h1), elem, link),  \
                                  <a class="code" href="group__apr__ring.html#ga3">APR_RING_FIRST</a>((h2)),                 \
                                  <a class="code" href="group__apr__ring.html#ga4">APR_RING_LAST</a>((h2)), link);           \
            <a class="code" href="group__apr__ring.html#ga7">APR_RING_INIT</a>((h2), elem, link);                            \
        }                                                               \
    } <span class="keywordflow">while</span> (0)
</pre></div>Prepend ring h2 onto the beginning of ring h1, leaving h2 empty. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>h1</em>&nbsp;</td><td>Head of the ring to prepend onto </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>h2</em>&nbsp;</td><td>Head of the ring to prepend </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga6" doxytag="apr_ring.h::APR_RING_PREV"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_PREV          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(ep)-&gt;link.prev</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The previous element in the ring <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep</em>&nbsp;</td><td>The current element </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga21" doxytag="apr_ring.h::APR_RING_REMOVE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_REMOVE          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;APR_RING_UNSPLICE((ep), (ep), link)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Remove a single element from a ring <dl compact><dt><b>Warning:</b></dt><dd>The unspliced element is left with dangling pointers at either end </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep</em>&nbsp;</td><td>Element to remove </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga2" doxytag="apr_ring.h::APR_RING_SENTINEL"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_SENTINEL          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link))</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The Ring Sentinel<p>
This is the magic pointer value that occurs before the first and after the last elements in the ring, computed from the address of the ring's head. The head itself isn't an element, but in order to get rid of all the special cases when dealing with the ends of the ring, we play typecasting games to make it look like one.<p>
Here is a diagram to illustrate the arrangements of the next and prev pointers of each element in a single ring. Note that they point to the start of each element, not to the APR_RING_ENTRY structure.<p>
<pre>
     +-&gt;+------+&lt;-+  +-&gt;+------+&lt;-+  +-&gt;+------+&lt;-+
     |  |struct|  |  |  |struct|  |  |  |struct|  |
    /   | elem |   \/   | elem |   \/   | elem |  \
 ...    |      |   /\   |      |   /\   |      |   ...
        +------+  |  |  +------+  |  |  +------+
   ...--|prev  |  |  +--|ring  |  |  +--|prev  |
        |  next|--+     | entry|--+     |  next|--...
        +------+        +------+        +------+
        | etc. |        | etc. |        | etc. |
        :      :        :      :        :      :
 </pre><p>
The APR_RING_HEAD is nothing but a bare APR_RING_ENTRY. The prev and next pointers in the first and last elements don't actually point to the head, they point to a phantom place called the sentinel. Its value is such that last-&gt;next-&gt;next == first because the offset from the sentinel to the head's next pointer is the same as the offset from the start of an element to its next pointer. This also works in the opposite direction.<p>
<pre>
        last                            first
     +-&gt;+------+&lt;-+  +-&gt;sentinel&lt;-+  +-&gt;+------+&lt;-+
     |  |struct|  |  |            |  |  |struct|  |
    /   | elem |   \/              \/   | elem |  \
 ...    |      |   /\              /\   |      |   ...
        +------+  |  |  +------+  |  |  +------+
   ...--|prev  |  |  +--|ring  |  |  +--|prev  |
        |  next|--+     |  head|--+     |  next|--...
        +------+        +------+        +------+
        | etc. |                        | etc. |
        :      :                        :      :
 </pre><p>
Note that the offset mentioned above is different for each kind of ring that the element may be on, and each kind of ring has a unique name for its APR_RING_ENTRY in each element, and has its own type for its APR_RING_HEAD.<p>
Note also that if the offset is non-zero (which is required if an element has more than one APR_RING_ENTRY), the unreality of the sentinel may have bad implications on very perverse implementations of C -- see the warning in APR_RING_ENTRY.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>The head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga11" doxytag="apr_ring.h::APR_RING_SPLICE_AFTER"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_SPLICE_AFTER          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">lep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>ep1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>epN,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                    \
        <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((ep1), link) = (lep);                             \
        <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((epN), link) = <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((lep), link);        \
        <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>(<a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((lep), link), link) = (epN);        \
        <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((lep), link) = (ep1);                             \
    } <span class="keywordflow">while</span> (0)
</pre></div>Splice the sequence ep1..epN into the ring after element lep (..lep.. becomes ..lep..ep1..epN..) <dl compact><dt><b>Warning:</b></dt><dd>This doesn't work for splicing after the last element or on empty rings... see APR_RING_SPLICE_TAIL for one that does </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lep</em>&nbsp;</td><td>Element in the ring to splice after </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ep1</em>&nbsp;</td><td>First element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>epN</em>&nbsp;</td><td>Last element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga10" doxytag="apr_ring.h::APR_RING_SPLICE_BEFORE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_SPLICE_BEFORE          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">lep,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>ep1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>epN,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {            \
        <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((epN), link) = (lep);                             \
        <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((ep1), link) = <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((lep), link);        \
        <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>(<a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((lep), link), link) = (ep1);        \
        <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((lep), link) = (epN);                             \
    } <span class="keywordflow">while</span> (0)
</pre></div>Splice the sequence ep1..epN into the ring before element lep (..lep.. becomes ..ep1..epN..lep..) <dl compact><dt><b>Warning:</b></dt><dd>This doesn't work for splicing before the first element or on empty rings... see APR_RING_SPLICE_HEAD for one that does </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lep</em>&nbsp;</td><td>Element in the ring to splice before </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ep1</em>&nbsp;</td><td>First element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>epN</em>&nbsp;</td><td>Last element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga14" doxytag="apr_ring.h::APR_RING_SPLICE_HEAD"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_SPLICE_HEAD          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>ep1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>epN,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="group__apr__ring.html#ga11">APR_RING_SPLICE_AFTER</a>(<a class="code" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>((hp), elem, link),      \
                             (ep1), (epN), link)
</pre></div>Splice the sequence ep1..epN into the ring before the first element (..hp.. becomes ..hp..ep1..epN..) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>Head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ep1</em>&nbsp;</td><td>First element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>epN</em>&nbsp;</td><td>Last element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga15" doxytag="apr_ring.h::APR_RING_SPLICE_TAIL"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_SPLICE_TAIL          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">hp,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>ep1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>epN,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>elem,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="group__apr__ring.html#ga10">APR_RING_SPLICE_BEFORE</a>(<a class="code" href="group__apr__ring.html#ga2">APR_RING_SENTINEL</a>((hp), elem, link),     \
                             (ep1), (epN), link)
</pre></div>Splice the sequence ep1..epN into the ring after the last element (..hp.. becomes ..ep1..epN..hp..) <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hp</em>&nbsp;</td><td>Head of the ring </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ep1</em>&nbsp;</td><td>First element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>epN</em>&nbsp;</td><td>Last element in the sequence to splice in </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>elem</em>&nbsp;</td><td>The name of the element struct </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga20" doxytag="apr_ring.h::APR_RING_UNSPLICE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define APR_RING_UNSPLICE          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ep1,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>epN,         <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>link&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                            \
        <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>(<a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((ep1), link), link) =               \
                     <a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((epN), link);                        \
        <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>(<a class="code" href="group__apr__ring.html#ga5">APR_RING_NEXT</a>((epN), link), link) =               \
                     <a class="code" href="group__apr__ring.html#ga6">APR_RING_PREV</a>((ep1), link);                        \
    } <span class="keywordflow">while</span> (0)
</pre></div>Unsplice a sequence of elements from a ring <dl compact><dt><b>Warning:</b></dt><dd>The unspliced sequence is left with dangling pointers at either end </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ep1</em>&nbsp;</td><td>First element in the sequence to unsplice </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>epN</em>&nbsp;</td><td>Last element in the sequence to unsplice </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>link</em>&nbsp;</td><td>The name of the APR_RING_ENTRY in the element struct </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Mar 20 19:52:27 2005 for Apache Portable Runtime by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>