📄 group__apr__ring.html
字号:
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</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></td><td valign=top><em>msg</em> </td><td>Descriptive message </td></tr>
<tr><td></td><td valign=top><em>ptr</em> </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">( </td>
<td class="md" nowrap valign="top">h1, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>h2, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>elem, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>link </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><pre class="fragment"><div><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)
</div></pre>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></td><td valign=top><em>h1</em> </td><td>Head of the ring to concatenate onto </td></tr>
<tr><td></td><td valign=top><em>h2</em> </td><td>Head of the ring to concatenate </td></tr>
<tr><td></td><td valign=top><em>elem</em> </td><td>The name of the element struct </td></tr>
<tr><td></td><td valign=top><em>link</em> </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">( </td>
<td class="md" nowrap valign="top">ep, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>link </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><pre class="fragment"><div><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)
</div></pre>Initialize a singleton element <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>ep</em> </td><td>The element </td></tr>
<tr><td></td><td valign=top><em>link</em> </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">( </td>
<td class="md" nowrap valign="top">hp, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>elem, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>link </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> (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>
</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></td><td valign=top><em>hp</em> </td><td>The head of the ring </td></tr>
<tr><td></td><td valign=top><em>elem</em> </td><td>The name of the element struct </td></tr>
<tr><td></td><td valign=top><em>link</em> </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">( </td>
<td class="md" nowrap valign="top">elem </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><pre class="fragment"><div><span class="keyword">struct </span>{ \
<span class="keyword">struct </span>elem *next; \
<span class="keyword">struct </span>elem *prev; \
}
</div></pre>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">( </td>
<td class="md" nowrap valign="top">hp </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> (hp)->next</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</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></td><td valign=top><em>hp</em> </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">( </td>
<td class="md" nowrap valign="top">head, <tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>elem </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -