group__apr__tables.html

来自「apr函数库使用手册」· HTML 代码 · 共 1,455 行 · 第 1/5 页

HTML
1,455
字号
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>p</em>&nbsp;</td><td>The pool to allocate the new table out of </td></tr>
    <tr><td></td><td valign=top><em>t</em>&nbsp;</td><td>The table to copy </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A copy of the table passed in </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga27" doxytag="apr_tables.h::apr_table_do" ></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"> int apr_table_do           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__tables.html#ga3">apr_table_do_callback_fn_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>comp</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>void *&nbsp;</td>
          <td class="mdname" nowrap> <em>rec</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="group__apr__tables.html#ga0">apr_table_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>&nbsp;</td>
          <td class="mdname" nowrap> <em>...</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Iterate over a table running the provided function once for every element in the table. If there is data passed in as a vararg, then the function is only run on those elements whose key matches something in the vararg. If the vararg is NULL, then every element is run through the function. Iteration continues while the function returns non-zero. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>comp</em>&nbsp;</td><td>The function to run </td></tr>
    <tr><td></td><td valign=top><em>rec</em>&nbsp;</td><td>The data to pass as the first argument to the function </td></tr>
    <tr><td></td><td valign=top><em>t</em>&nbsp;</td><td>The table to iterate over </td></tr>
    <tr><td></td><td valign=top><em>...</em>&nbsp;</td><td>The vararg. If this is NULL, then all elements in the table are run through the function, otherwise only those whose key matches are run. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>FALSE if one of the comp() iterations returned zero; TRUE if all iterations returned non-zero </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__apr__tables.html#ga3">apr_table_do_callback_fn_t</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="apr_tables.h::apr_table_elts" ></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"> const <a class="el" href="structapr__array__header__t.html">apr_array_header_t</a>* apr_table_elts           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="group__apr__tables.html#ga0">apr_table_t</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>t</em>          </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>
Get the elements from a table <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>t</em>&nbsp;</td><td>The table </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>An array containing the contents of the table </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga18" doxytag="apr_tables.h::apr_table_get" ></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"> const char* apr_table_get           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="group__apr__tables.html#ga0">apr_table_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>key</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the value associated with a given key from the table. After this call, The data is still in the table <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>t</em>&nbsp;</td><td>The table to search for the key </td></tr>
    <tr><td></td><td valign=top><em>key</em>&nbsp;</td><td>The key to search for </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The value associated with the key </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga15" doxytag="apr_tables.h::apr_table_make" ></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"> <a class="el" href="group__apr__tables.html#ga0">apr_table_t</a>* apr_table_make           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>p</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>nelts</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Make a new table <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>p</em>&nbsp;</td><td>The pool to allocate the pool out of </td></tr>
    <tr><td></td><td valign=top><em>nelts</em>&nbsp;</td><td>The number of elements in the initial table. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The new table. </dd></dl>
<dl compact><dt><b>Warning:</b></dt><dd>This table can only store text data </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga22" doxytag="apr_tables.h::apr_table_merge" ></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"> void apr_table_merge           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__tables.html#ga0">apr_table_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>val</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Add data to a table by merging the value with data that has already been stored <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>t</em>&nbsp;</td><td>The table to search for the data </td></tr>
    <tr><td></td><td valign=top><em>key</em>&nbsp;</td><td>The key to merge data for </td></tr>
    <tr><td></td><td valign=top><em>val</em>&nbsp;</td><td>The data to add </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>If the key is not found, then this function acts like apr_table_add </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga23" doxytag="apr_tables.h::apr_table_mergen" ></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"> void apr_table_mergen           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__tables.html#ga0">apr_table_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>val</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Add data to a table by merging the value with data that has already been stored <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td></td><td valign=top><em>t</em>&nbsp;</td><td>The table to search for the data </td></tr>
    <tr><td></td><td valign=top><em>key</em>&nbsp;</td><td>The key to merge data for </td></tr>
    <tr><td></td><td valign=top><em>val</em>&nbsp;</td><td>The data to add </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>If the key is not found, then this function acts like apr_table_addn </dd></dl>
    </td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?