apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r784636 [3/47] - in /apr/site/trunk/docs/docs: apr-util/trunk/ apr/trunk/
Date Mon, 15 Jun 2009 00:01:47 GMT
Added: apr/site/trunk/docs/docs/apr/trunk/apr__buckets_8h-source.html
URL: http://svn.apache.org/viewvc/apr/site/trunk/docs/docs/apr/trunk/apr__buckets_8h-source.html?rev=784636&view=auto
==============================================================================
--- apr/site/trunk/docs/docs/apr/trunk/apr__buckets_8h-source.html (added)
+++ apr/site/trunk/docs/docs/apr/trunk/apr__buckets_8h-source.html Mon Jun 15 00:01:38 2009
@@ -0,0 +1,1600 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>Apache Portable Runtime: apr_buckets.h Source File</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.5.8 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
+      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
+      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+      <li><a href="examples.html"><span>Examples</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+    </ul>
+  </div>
+<h1>apr_buckets.h</h1><a href="apr__buckets_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Licensed to the Apache Software Foundation (ASF) under one or more</span>
+<a name="l00002"></a>00002 <span class="comment"> * contributor license agreements.  See the NOTICE file distributed with</span>
+<a name="l00003"></a>00003 <span class="comment"> * this work for additional information regarding copyright ownership.</span>
+<a name="l00004"></a>00004 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span>
+<a name="l00005"></a>00005 <span class="comment"> * (the "License"); you may not use this file except in compliance with</span>
+<a name="l00006"></a>00006 <span class="comment"> * the License.  You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span><span class="comment"></span>
+<a name="l00016"></a>00016 <span class="comment">/**</span>
+<a name="l00017"></a>00017 <span class="comment"> * @file apr_buckets.h</span>
+<a name="l00018"></a>00018 <span class="comment"> * @brief APR-UTIL Buckets/Bucket Brigades</span>
+<a name="l00019"></a>00019 <span class="comment"> */</span>
+<a name="l00020"></a>00020 
+<a name="l00021"></a>00021 <span class="preprocessor">#ifndef APR_BUCKETS_H</span>
+<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define APR_BUCKETS_H</span>
+<a name="l00023"></a>00023 <span class="preprocessor"></span>
+<a name="l00024"></a>00024 <span class="preprocessor">#if defined(APR_BUCKET_DEBUG) &amp;&amp; !defined(APR_RING_DEBUG)</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define APR_RING_DEBUG</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00027"></a>00027 <span class="preprocessor"></span>
+<a name="l00028"></a>00028 <span class="preprocessor">#include "apu.h"</span>
+<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="apr__network__io_8h.html" title="APR Network library.">apr_network_io.h</a>"</span>
+<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="apr__file__io_8h.html" title="APR File I/O Handling.">apr_file_io.h</a>"</span>
+<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="apr__general_8h.html" title="APR Miscellaneous library routines.">apr_general.h</a>"</span>
+<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="apr__mmap_8h.html" title="APR MMAP routines.">apr_mmap.h</a>"</span>
+<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="apr__errno_8h.html" title="APR Error Codes.">apr_errno.h</a>"</span>
+<a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="apr__ring_8h.html" title="APR Rings.">apr_ring.h</a>"</span>
+<a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="apr_8h.html" title="APR Platform Definitions.">apr.h</a>"</span>
+<a name="l00036"></a>00036 <span class="preprocessor">#if APR_HAVE_SYS_UIO_H</span>
+<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#include &lt;sys/uio.h&gt;</span>    <span class="comment">/* for struct iovec */</span>
+<a name="l00038"></a>00038 <span class="preprocessor">#endif</span>
+<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#if APR_HAVE_STDARG_H</span>
+<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#include &lt;stdarg.h&gt;</span>
+<a name="l00041"></a>00041 <span class="preprocessor">#endif</span>
+<a name="l00042"></a>00042 <span class="preprocessor"></span>
+<a name="l00043"></a>00043 <span class="preprocessor">#ifdef __cplusplus</span>
+<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
+<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
+<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00047"></a>00047 <span class="comment">/**</span>
+<a name="l00048"></a>00048 <span class="comment"> * @defgroup APR_Util_Bucket_Brigades Bucket Brigades</span>
+<a name="l00049"></a>00049 <span class="comment"> * @ingroup APR_Util</span>
+<a name="l00050"></a>00050 <span class="comment"> * @{ </span>
+<a name="l00051"></a>00051 <span class="comment"> */</span>
+<a name="l00052"></a>00052 <span class="comment"></span>
+<a name="l00053"></a>00053 <span class="comment">/** default bucket buffer size - 8KB minus room for memory allocator headers */</span>
+<a name="l00054"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g82bf404af30875135c65e2c13ad035e5">00054</a> <span class="preprocessor">#define APR_BUCKET_BUFF_SIZE 8000</span>
+<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00056"></a>00056 <span class="comment">/** Determines how a bucket or brigade should be read */</span>
+<a name="l00057"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g756973fb6392bd1026c3d96b4519776d">00057</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
+<a name="l00058"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gg756973fb6392bd1026c3d96b4519776d2d983f5b7fd996434e0dded171c261d8">00058</a>     <a class="code" href="group___a_p_r___util___bucket___brigades.html#gg756973fb6392bd1026c3d96b4519776d2d983f5b7fd996434e0dded171c261d8">APR_BLOCK_READ</a>,   <span class="comment">/**&lt; block until data becomes available */</span>
+<a name="l00059"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gg756973fb6392bd1026c3d96b4519776d42b97663ca71fbbf2e2af7c8192e5dd8">00059</a>     <a class="code" href="group___a_p_r___util___bucket___brigades.html#gg756973fb6392bd1026c3d96b4519776d42b97663ca71fbbf2e2af7c8192e5dd8">APR_NONBLOCK_READ</a> <span class="comment">/**&lt; return immediately if no data is available */</span>
+<a name="l00060"></a>00060 } <a class="code" href="group___a_p_r___util___bucket___brigades.html#g756973fb6392bd1026c3d96b4519776d">apr_read_type_e</a>;
+<a name="l00061"></a>00061 <span class="comment"></span>
+<a name="l00062"></a>00062 <span class="comment">/**</span>
+<a name="l00063"></a>00063 <span class="comment"> * The one-sentence buzzword-laden overview: Bucket brigades represent</span>
+<a name="l00064"></a>00064 <span class="comment"> * a complex data stream that can be passed through a layered IO</span>
+<a name="l00065"></a>00065 <span class="comment"> * system without unnecessary copying. A longer overview follows...</span>
+<a name="l00066"></a>00066 <span class="comment"> *</span>
+<a name="l00067"></a>00067 <span class="comment"> * A bucket brigade is a doubly linked list (ring) of buckets, so we</span>
+<a name="l00068"></a>00068 <span class="comment"> * aren't limited to inserting at the front and removing at the end.</span>
+<a name="l00069"></a>00069 <span class="comment"> * Buckets are only passed around as members of a brigade, although</span>
+<a name="l00070"></a>00070 <span class="comment"> * singleton buckets can occur for short periods of time.</span>
+<a name="l00071"></a>00071 <span class="comment"> *</span>
+<a name="l00072"></a>00072 <span class="comment"> * Buckets are data stores of various types. They can refer to data in</span>
+<a name="l00073"></a>00073 <span class="comment"> * memory, or part of a file or mmap area, or the output of a process,</span>
+<a name="l00074"></a>00074 <span class="comment"> * etc. Buckets also have some type-dependent accessor functions:</span>
+<a name="l00075"></a>00075 <span class="comment"> * read, split, copy, setaside, and destroy.</span>
+<a name="l00076"></a>00076 <span class="comment"> *</span>
+<a name="l00077"></a>00077 <span class="comment"> * read returns the address and size of the data in the bucket. If the</span>
+<a name="l00078"></a>00078 <span class="comment"> * data isn't in memory then it is read in and the bucket changes type</span>
+<a name="l00079"></a>00079 <span class="comment"> * so that it can refer to the new location of the data. If all the</span>
+<a name="l00080"></a>00080 <span class="comment"> * data doesn't fit in the bucket then a new bucket is inserted into</span>
+<a name="l00081"></a>00081 <span class="comment"> * the brigade to hold the rest of it.</span>
+<a name="l00082"></a>00082 <span class="comment"> *</span>
+<a name="l00083"></a>00083 <span class="comment"> * split divides the data in a bucket into two regions. After a split</span>
+<a name="l00084"></a>00084 <span class="comment"> * the original bucket refers to the first part of the data and a new</span>
+<a name="l00085"></a>00085 <span class="comment"> * bucket inserted into the brigade after the original bucket refers</span>
+<a name="l00086"></a>00086 <span class="comment"> * to the second part of the data. Reference counts are maintained as</span>
+<a name="l00087"></a>00087 <span class="comment"> * necessary.</span>
+<a name="l00088"></a>00088 <span class="comment"> *</span>
+<a name="l00089"></a>00089 <span class="comment"> * setaside ensures that the data in the bucket has a long enough</span>
+<a name="l00090"></a>00090 <span class="comment"> * lifetime. Sometimes it is convenient to create a bucket referring</span>
+<a name="l00091"></a>00091 <span class="comment"> * to data on the stack in the expectation that it will be consumed</span>
+<a name="l00092"></a>00092 <span class="comment"> * (output to the network) before the stack is unwound. If that</span>
+<a name="l00093"></a>00093 <span class="comment"> * expectation turns out not to be valid, the setaside function is</span>
+<a name="l00094"></a>00094 <span class="comment"> * called to move the data somewhere safer.</span>
+<a name="l00095"></a>00095 <span class="comment"> *</span>
+<a name="l00096"></a>00096 <span class="comment"> * copy makes a duplicate of the bucket structure as long as it's</span>
+<a name="l00097"></a>00097 <span class="comment"> * possible to have multiple references to a single copy of the</span>
+<a name="l00098"></a>00098 <span class="comment"> * data itself.  Not all bucket types can be copied.</span>
+<a name="l00099"></a>00099 <span class="comment"> *</span>
+<a name="l00100"></a>00100 <span class="comment"> * destroy maintains the reference counts on the resources used by a</span>
+<a name="l00101"></a>00101 <span class="comment"> * bucket and frees them if necessary.</span>
+<a name="l00102"></a>00102 <span class="comment"> *</span>
+<a name="l00103"></a>00103 <span class="comment"> * Note: all of the above functions have wrapper macros (apr_bucket_read(),</span>
+<a name="l00104"></a>00104 <span class="comment"> * apr_bucket_destroy(), etc), and those macros should be used rather</span>
+<a name="l00105"></a>00105 <span class="comment"> * than using the function pointers directly.</span>
+<a name="l00106"></a>00106 <span class="comment"> *</span>
+<a name="l00107"></a>00107 <span class="comment"> * To write a bucket brigade, they are first made into an iovec, so that we</span>
+<a name="l00108"></a>00108 <span class="comment"> * don't write too little data at one time.  Currently we ignore compacting the</span>
+<a name="l00109"></a>00109 <span class="comment"> * buckets into as few buckets as possible, but if we really want good</span>
+<a name="l00110"></a>00110 <span class="comment"> * performance, then we need to compact the buckets before we convert to an</span>
+<a name="l00111"></a>00111 <span class="comment"> * iovec, or possibly while we are converting to an iovec.</span>
+<a name="l00112"></a>00112 <span class="comment"> */</span>
+<a name="l00113"></a>00113 
+<a name="l00114"></a>00114 <span class="comment">/*</span>
+<a name="l00115"></a>00115 <span class="comment"> * Forward declaration of the main types.</span>
+<a name="l00116"></a>00116 <span class="comment"> */</span>
+<a name="l00117"></a>00117 <span class="comment"></span>
+<a name="l00118"></a>00118 <span class="comment">/** @see apr_bucket_brigade */</span>
+<a name="l00119"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g9f50254e85c7aad79ca289a0ba069025">00119</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> <a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a>;<span class="comment"></span>
+<a name="l00120"></a>00120 <span class="comment">/** @see apr_bucket */</span>
+<a name="l00121"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#ga17a456120961b1c5af0525f4900a457">00121</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket.html">apr_bucket</a> <a class="code" href="structapr__bucket.html">apr_bucket</a>;<span class="comment"></span>
+<a name="l00122"></a>00122 <span class="comment">/** @see apr_bucket_alloc_t */</span>
+<a name="l00123"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">00123</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">apr_bucket_alloc_t</a> <a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">apr_bucket_alloc_t</a>;
+<a name="l00124"></a>00124 <span class="comment"></span>
+<a name="l00125"></a>00125 <span class="comment">/** @see apr_bucket_type_t */</span>
+<a name="l00126"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g4a152aaf7d851c81af73b7e84dc1a8a2">00126</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__type__t.html">apr_bucket_type_t</a> <a class="code" href="structapr__bucket__type__t.html">apr_bucket_type_t</a>;
+<a name="l00127"></a>00127 <span class="comment"></span>
+<a name="l00128"></a>00128 <span class="comment">/**</span>
+<a name="l00129"></a>00129 <span class="comment"> * Basic bucket type</span>
+<a name="l00130"></a>00130 <span class="comment"> */</span>
+<a name="l00131"></a><a class="code" href="structapr__bucket__type__t.html">00131</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__type__t.html">apr_bucket_type_t</a> {<span class="comment"></span>
+<a name="l00132"></a>00132 <span class="comment">    /**</span>
+<a name="l00133"></a>00133 <span class="comment">     * The name of the bucket type</span>
+<a name="l00134"></a>00134 <span class="comment">     */</span>
+<a name="l00135"></a><a class="code" href="structapr__bucket__type__t.html#c6d779be45de214c6abd2cc205c48901">00135</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structapr__bucket__type__t.html#c6d779be45de214c6abd2cc205c48901">name</a>;<span class="comment"></span>
+<a name="l00136"></a>00136 <span class="comment">    /** </span>
+<a name="l00137"></a>00137 <span class="comment">     * The number of functions this bucket understands.  Can not be less than</span>
+<a name="l00138"></a>00138 <span class="comment">     * five.</span>
+<a name="l00139"></a>00139 <span class="comment">     */</span>
+<a name="l00140"></a><a class="code" href="structapr__bucket__type__t.html#d4bd2ffb03cb2f5f3b3941ce20468038">00140</a>     <span class="keywordtype">int</span> <a class="code" href="structapr__bucket__type__t.html#d4bd2ffb03cb2f5f3b3941ce20468038">num_func</a>;<span class="comment"></span>
+<a name="l00141"></a>00141 <span class="comment">    /**</span>
+<a name="l00142"></a>00142 <span class="comment">     * Whether the bucket contains metadata (ie, information that</span>
+<a name="l00143"></a>00143 <span class="comment">     * describes the regular contents of the brigade).  The metadata</span>
+<a name="l00144"></a>00144 <span class="comment">     * is not returned by apr_bucket_read() and is not indicated by</span>
+<a name="l00145"></a>00145 <span class="comment">     * the -&gt;length of the apr_bucket itself.  In other words, an</span>
+<a name="l00146"></a>00146 <span class="comment">     * empty bucket is safe to arbitrarily remove if and only if it</span>
+<a name="l00147"></a>00147 <span class="comment">     * contains no metadata.  In this sense, "data" is just raw bytes</span>
+<a name="l00148"></a>00148 <span class="comment">     * that are the "content" of the brigade and "metadata" describes</span>
+<a name="l00149"></a>00149 <span class="comment">     * that data but is not a proper part of it.</span>
+<a name="l00150"></a>00150 <span class="comment">     */</span>
+<a name="l00151"></a>00151     <span class="keyword">enum</span> {<span class="comment"></span>
+<a name="l00152"></a>00152 <span class="comment">        /** This bucket type represents actual data to send to the client. */</span>
+<a name="l00153"></a><a class="code" href="structapr__bucket__type__t.html#117f85e4a58c5e7d7e373705ad138f8553d3ef9d6a275fe2b72a91acea7017d5">00153</a>         <a class="code" href="structapr__bucket__type__t.html#117f85e4a58c5e7d7e373705ad138f8553d3ef9d6a275fe2b72a91acea7017d5">APR_BUCKET_DATA</a> = 0,<span class="comment"></span>
+<a name="l00154"></a>00154 <span class="comment">        /** This bucket type represents metadata. */</span>
+<a name="l00155"></a><a class="code" href="structapr__bucket__type__t.html#117f85e4a58c5e7d7e373705ad138f859bf38b4eb3ea41c4af230432ac7a5fb1">00155</a>         <a class="code" href="structapr__bucket__type__t.html#117f85e4a58c5e7d7e373705ad138f859bf38b4eb3ea41c4af230432ac7a5fb1">APR_BUCKET_METADATA</a> = 1
+<a name="l00156"></a>00156     } <a class="code" href="structapr__bucket__type__t.html#34cef542a8eee5bb734ba8dcd8329711">is_metadata</a>;<span class="comment"></span>
+<a name="l00157"></a>00157 <span class="comment">    /**</span>
+<a name="l00158"></a>00158 <span class="comment">     * Free the private data and any resources used by the bucket (if they</span>
+<a name="l00159"></a>00159 <span class="comment">     *  aren't shared with another bucket).  This function is required to be</span>
+<a name="l00160"></a>00160 <span class="comment">     *  implemented for all bucket types, though it might be a no-op on some</span>
+<a name="l00161"></a>00161 <span class="comment">     *  of them (namely ones that never allocate any private data structures).</span>
+<a name="l00162"></a>00162 <span class="comment">     * @param data The private data pointer from the bucket to be destroyed</span>
+<a name="l00163"></a>00163 <span class="comment">     */</span>
+<a name="l00164"></a>00164     void (*<a class="code" href="structapr__bucket__type__t.html#a5a8ae7611ba3be480e3fd12ff3ac352">destroy</a>)(<span class="keywordtype">void</span> *data);
+<a name="l00165"></a>00165 <span class="comment"></span>
+<a name="l00166"></a>00166 <span class="comment">    /**</span>
+<a name="l00167"></a>00167 <span class="comment">     * Read the data from the bucket. This is required to be implemented</span>
+<a name="l00168"></a>00168 <span class="comment">     *  for all bucket types.</span>
+<a name="l00169"></a>00169 <span class="comment">     * @param b The bucket to read from</span>
+<a name="l00170"></a>00170 <span class="comment">     * @param str A place to store the data read.  Allocation should only be</span>
+<a name="l00171"></a>00171 <span class="comment">     *            done if absolutely necessary. </span>
+<a name="l00172"></a>00172 <span class="comment">     * @param len The amount of data read.</span>
+<a name="l00173"></a>00173 <span class="comment">     * @param block Should this read function block if there is more data that</span>
+<a name="l00174"></a>00174 <span class="comment">     *              cannot be read immediately.</span>
+<a name="l00175"></a>00175 <span class="comment">     */</span>
+<a name="l00176"></a>00176     <a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*<a class="code" href="structapr__bucket__type__t.html#8e9f3f5b2a5513691f3cea130a1aa54b">read</a>)(<a class="code" href="structapr__bucket.html">apr_bucket</a> *b, <span class="keyword">const</span> <span class="keywordtype">char</span> **str, apr_size_t *len, 
+<a name="l00177"></a>00177                          <a class="code" href="group___a_p_r___util___bucket___brigades.html#g756973fb6392bd1026c3d96b4519776d">apr_read_type_e</a> block);
+<a name="l00178"></a>00178     <span class="comment"></span>
+<a name="l00179"></a>00179 <span class="comment">    /**</span>
+<a name="l00180"></a>00180 <span class="comment">     * Make it possible to set aside the data for at least as long as the</span>
+<a name="l00181"></a>00181 <span class="comment">     *  given pool. Buckets containing data that could potentially die before</span>
+<a name="l00182"></a>00182 <span class="comment">     *  this pool (e.g. the data resides on the stack, in a child pool of</span>
+<a name="l00183"></a>00183 <span class="comment">     *  the given pool, or in a disjoint pool) must somehow copy, shift, or</span>
+<a name="l00184"></a>00184 <span class="comment">     *  transform the data to have the proper lifetime.</span>
+<a name="l00185"></a>00185 <span class="comment">     * @param e The bucket to convert</span>
+<a name="l00186"></a>00186 <span class="comment">     * @remark Some bucket types contain data that will always outlive the</span>
+<a name="l00187"></a>00187 <span class="comment">     *         bucket itself. For example no data (EOS and FLUSH), or the data</span>
+<a name="l00188"></a>00188 <span class="comment">     *         resides in global, constant memory (IMMORTAL), or the data is on</span>
+<a name="l00189"></a>00189 <span class="comment">     *      the heap (HEAP). For these buckets, apr_bucket_setaside_noop can</span>
+<a name="l00190"></a>00190 <span class="comment">     *      be used.</span>
+<a name="l00191"></a>00191 <span class="comment">     */</span>
+<a name="l00192"></a>00192     <a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*<a class="code" href="structapr__bucket__type__t.html#4e2015fd6e927ed55157a9b003ed5fdb">setaside</a>)(<a class="code" href="structapr__bucket.html">apr_bucket</a> *e, <a class="code" href="group__apr__pools.html#gf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *pool);
+<a name="l00193"></a>00193 <span class="comment"></span>
+<a name="l00194"></a>00194 <span class="comment">    /**</span>
+<a name="l00195"></a>00195 <span class="comment">     * Split one bucket in two at the specified position by duplicating</span>
+<a name="l00196"></a>00196 <span class="comment">     *  the bucket structure (not the data) and modifying any necessary</span>
+<a name="l00197"></a>00197 <span class="comment">     *  start/end/offset information.  If it's not possible to do this</span>
+<a name="l00198"></a>00198 <span class="comment">     *  for the bucket type (perhaps the length of the data is indeterminate,</span>
+<a name="l00199"></a>00199 <span class="comment">     *  as with pipe and socket buckets), then APR_ENOTIMPL is returned.</span>
+<a name="l00200"></a>00200 <span class="comment">     * @param e The bucket to split</span>
+<a name="l00201"></a>00201 <span class="comment">     * @param point The offset of the first byte in the new bucket</span>
+<a name="l00202"></a>00202 <span class="comment">     */</span>
+<a name="l00203"></a>00203     <a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*<a class="code" href="structapr__bucket__type__t.html#f30959bc15fc60e21224d5e3c8c0a814">split</a>)(<a class="code" href="structapr__bucket.html">apr_bucket</a> *e, apr_size_t point);
+<a name="l00204"></a>00204 <span class="comment"></span>
+<a name="l00205"></a>00205 <span class="comment">    /**</span>
+<a name="l00206"></a>00206 <span class="comment">     * Copy the bucket structure (not the data), assuming that this is</span>
+<a name="l00207"></a>00207 <span class="comment">     *  possible for the bucket type. If it's not, APR_ENOTIMPL is returned.</span>
+<a name="l00208"></a>00208 <span class="comment">     * @param e The bucket to copy</span>
+<a name="l00209"></a>00209 <span class="comment">     * @param c Returns a pointer to the new bucket</span>
+<a name="l00210"></a>00210 <span class="comment">     */</span>
+<a name="l00211"></a>00211     <a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*<a class="code" href="structapr__bucket__type__t.html#300d6b15d55a3a1f13eeec7379100c38">copy</a>)(<a class="code" href="structapr__bucket.html">apr_bucket</a> *e, <a class="code" href="structapr__bucket.html">apr_bucket</a> **c);
+<a name="l00212"></a>00212 
+<a name="l00213"></a>00213 };
+<a name="l00214"></a>00214 <span class="comment"></span>
+<a name="l00215"></a>00215 <span class="comment">/**</span>
+<a name="l00216"></a>00216 <span class="comment"> * apr_bucket structures are allocated on the malloc() heap and</span>
+<a name="l00217"></a>00217 <span class="comment"> * their lifetime is controlled by the parent apr_bucket_brigade</span>
+<a name="l00218"></a>00218 <span class="comment"> * structure. Buckets can move from one brigade to another e.g. by</span>
+<a name="l00219"></a>00219 <span class="comment"> * calling APR_BRIGADE_CONCAT(). In general the data in a bucket has</span>
+<a name="l00220"></a>00220 <span class="comment"> * the same lifetime as the bucket and is freed when the bucket is</span>
+<a name="l00221"></a>00221 <span class="comment"> * destroyed; if the data is shared by more than one bucket (e.g.</span>
+<a name="l00222"></a>00222 <span class="comment"> * after a split) the data is freed when the last bucket goes away.</span>
+<a name="l00223"></a>00223 <span class="comment"> */</span>
+<a name="l00224"></a><a class="code" href="structapr__bucket.html">00224</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket.html">apr_bucket</a> {<span class="comment"></span>
+<a name="l00225"></a>00225 <span class="comment">    /** Links to the rest of the brigade */</span>
+<a name="l00226"></a>00226     <a class="code" href="structapr__bucket.html#b1acff965e57e067dfde80321d04dea7">APR_RING_ENTRY</a>(<a class="code" href="structapr__bucket.html">apr_bucket</a>) link;<span class="comment"></span>
+<a name="l00227"></a>00227 <span class="comment">    /** The type of bucket.  */</span>
+<a name="l00228"></a><a class="code" href="structapr__bucket.html#c27fa5ce798e688ad243ebe1615937fc">00228</a>     <span class="keyword">const</span> <a class="code" href="structapr__bucket__type__t.html">apr_bucket_type_t</a> *<a class="code" href="structapr__bucket.html#c27fa5ce798e688ad243ebe1615937fc">type</a>;<span class="comment"></span>
+<a name="l00229"></a>00229 <span class="comment">    /** The length of the data in the bucket.  This could have been implemented</span>
+<a name="l00230"></a>00230 <span class="comment">     *  with a function, but this is an optimization, because the most</span>
+<a name="l00231"></a>00231 <span class="comment">     *  common thing to do will be to get the length.  If the length is unknown,</span>
+<a name="l00232"></a>00232 <span class="comment">     *  the value of this field will be (apr_size_t)(-1).</span>
+<a name="l00233"></a>00233 <span class="comment">     */</span>
+<a name="l00234"></a><a class="code" href="structapr__bucket.html#0898dfc78d9275187189b9a745e619bf">00234</a>     apr_size_t <a class="code" href="structapr__bucket.html#0898dfc78d9275187189b9a745e619bf">length</a>;<span class="comment"></span>
+<a name="l00235"></a>00235 <span class="comment">    /** The start of the data in the bucket relative to the private base</span>
+<a name="l00236"></a>00236 <span class="comment">     *  pointer.  The vast majority of bucket types allow a fixed block of</span>
+<a name="l00237"></a>00237 <span class="comment">     *  data to be referenced by multiple buckets, each bucket pointing to</span>
+<a name="l00238"></a>00238 <span class="comment">     *  a different segment of the data.  That segment starts at base+start</span>
+<a name="l00239"></a>00239 <span class="comment">     *  and ends at base+start+length.  </span>
+<a name="l00240"></a>00240 <span class="comment">     *  If the length == (apr_size_t)(-1), then start == -1.</span>
+<a name="l00241"></a>00241 <span class="comment">     */</span>
+<a name="l00242"></a><a class="code" href="structapr__bucket.html#4a8791b606b3ad613b8672ec94145628">00242</a>     apr_off_t <a class="code" href="structapr__bucket.html#4a8791b606b3ad613b8672ec94145628">start</a>;<span class="comment"></span>
+<a name="l00243"></a>00243 <span class="comment">    /** type-dependent data hangs off this pointer */</span>
+<a name="l00244"></a><a class="code" href="structapr__bucket.html#7fc4604750889b3f762bda1a786d276a">00244</a>     <span class="keywordtype">void</span> *<a class="code" href="structapr__bucket.html#7fc4604750889b3f762bda1a786d276a">data</a>; <span class="comment"></span>
+<a name="l00245"></a>00245 <span class="comment">    /**</span>
+<a name="l00246"></a>00246 <span class="comment">     * Pointer to function used to free the bucket. This function should</span>
+<a name="l00247"></a>00247 <span class="comment">     * always be defined and it should be consistent with the memory</span>
+<a name="l00248"></a>00248 <span class="comment">     * function used to allocate the bucket. For example, if malloc() is </span>
+<a name="l00249"></a>00249 <span class="comment">     * used to allocate the bucket, this pointer should point to free().</span>
+<a name="l00250"></a>00250 <span class="comment">     * @param e Pointer to the bucket being freed</span>
+<a name="l00251"></a>00251 <span class="comment">     */</span>
+<a name="l00252"></a>00252     void (*<a class="code" href="structapr__bucket.html#c50b1c1de2b171938c33bf3ac478f359">free</a>)(<span class="keywordtype">void</span> *e);<span class="comment"></span>
+<a name="l00253"></a>00253 <span class="comment">    /** The freelist from which this bucket was allocated */</span>
+<a name="l00254"></a><a class="code" href="structapr__bucket.html#5a500b80105834621514d6c0814d0966">00254</a>     <a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">apr_bucket_alloc_t</a> *<a class="code" href="structapr__bucket.html#5a500b80105834621514d6c0814d0966">list</a>;
+<a name="l00255"></a>00255 };
+<a name="l00256"></a>00256 <span class="comment"></span>
+<a name="l00257"></a>00257 <span class="comment">/** A list of buckets */</span>
+<a name="l00258"></a><a class="code" href="structapr__bucket__brigade.html">00258</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> {<span class="comment"></span>
+<a name="l00259"></a>00259 <span class="comment">    /** The pool to associate the brigade with.  The data is not allocated out</span>
+<a name="l00260"></a>00260 <span class="comment">     *  of the pool, but a cleanup is registered with this pool.  If the </span>
+<a name="l00261"></a>00261 <span class="comment">     *  brigade is destroyed by some mechanism other than pool destruction,</span>
+<a name="l00262"></a>00262 <span class="comment">     *  the destroying function is responsible for killing the cleanup.</span>
+<a name="l00263"></a>00263 <span class="comment">     */</span>
+<a name="l00264"></a><a class="code" href="structapr__bucket__brigade.html#8e03b4dd531903709ae3ae8ebe9e46ee">00264</a>     <a class="code" href="group__apr__pools.html#gf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *<a class="code" href="structapr__bucket__brigade.html#8e03b4dd531903709ae3ae8ebe9e46ee">p</a>;<span class="comment"></span>
+<a name="l00265"></a>00265 <span class="comment">    /** The buckets in the brigade are on this list. */</span>
+<a name="l00266"></a>00266     <span class="comment">/*</span>
+<a name="l00267"></a>00267 <span class="comment">     * The apr_bucket_list structure doesn't actually need a name tag</span>
+<a name="l00268"></a>00268 <span class="comment">     * because it has no existence independent of struct apr_bucket_brigade;</span>
+<a name="l00269"></a>00269 <span class="comment">     * the ring macros are designed so that you can leave the name tag</span>
+<a name="l00270"></a>00270 <span class="comment">     * argument empty in this situation but apparently the Windows compiler</span>
+<a name="l00271"></a>00271 <span class="comment">     * doesn't like that.</span>
+<a name="l00272"></a>00272 <span class="comment">     */</span>
+<a name="l00273"></a>00273     <a class="code" href="structapr__bucket__brigade.html#76a313afc83dd161916f3f9b83eea734">APR_RING_HEAD</a>(apr_bucket_list, <a class="code" href="structapr__bucket.html">apr_bucket</a>) list;<span class="comment"></span>
+<a name="l00274"></a>00274 <span class="comment">    /** The freelist from which this bucket was allocated */</span>
+<a name="l00275"></a><a class="code" href="structapr__bucket__brigade.html#9f58f90a088f02ebb6f935f004092aaa">00275</a>     <a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">apr_bucket_alloc_t</a> *<a class="code" href="structapr__bucket__brigade.html#9f58f90a088f02ebb6f935f004092aaa">bucket_alloc</a>;
+<a name="l00276"></a>00276 };
+<a name="l00277"></a>00277 
+<a name="l00278"></a>00278 <span class="comment"></span>
+<a name="l00279"></a>00279 <span class="comment">/**</span>
+<a name="l00280"></a>00280 <span class="comment"> * Function called when a brigade should be flushed</span>
+<a name="l00281"></a>00281 <span class="comment"> */</span>
+<a name="l00282"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gcdf6dc9d4c81c64834e5e509281f7f16">00282</a> typedef <a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*<a class="code" href="group___a_p_r___util___bucket___brigades.html#gcdf6dc9d4c81c64834e5e509281f7f16">apr_brigade_flush</a>)(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb, <span class="keywordtype">void</span> *ctx);
+<a name="l00283"></a>00283 
+<a name="l00284"></a>00284 <span class="comment">/*</span>
+<a name="l00285"></a>00285 <span class="comment"> * define APR_BUCKET_DEBUG if you want your brigades to be checked for</span>
+<a name="l00286"></a>00286 <span class="comment"> * validity at every possible instant.  this will slow your code down</span>
+<a name="l00287"></a>00287 <span class="comment"> * substantially but is a very useful debugging tool.</span>
+<a name="l00288"></a>00288 <span class="comment"> */</span>
+<a name="l00289"></a>00289 <span class="preprocessor">#ifdef APR_BUCKET_DEBUG</span>
+<a name="l00290"></a>00290 <span class="preprocessor"></span>
+<a name="l00291"></a>00291 <span class="preprocessor">#define APR_BRIGADE_CHECK_CONSISTENCY(b)                                \</span>
+<a name="l00292"></a>00292 <span class="preprocessor">        APR_RING_CHECK_CONSISTENCY(&amp;(b)-&gt;list, apr_bucket, link)</span>
+<a name="l00293"></a>00293 <span class="preprocessor"></span>
+<a name="l00294"></a>00294 <span class="preprocessor">#define APR_BUCKET_CHECK_CONSISTENCY(e)                                 \</span>
+<a name="l00295"></a>00295 <span class="preprocessor">        APR_RING_CHECK_ELEM_CONSISTENCY((e), apr_bucket, link)</span>
+<a name="l00296"></a>00296 <span class="preprocessor"></span>
+<a name="l00297"></a>00297 <span class="preprocessor">#else</span>
+<a name="l00298"></a>00298 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00299"></a>00299 <span class="comment"> * checks the ring pointers in a bucket brigade for consistency.  an</span>
+<a name="l00300"></a>00300 <span class="comment"> * abort() will be triggered if any inconsistencies are found.</span>
+<a name="l00301"></a>00301 <span class="comment"> *   note: this is a no-op unless APR_BUCKET_DEBUG is defined.</span>
+<a name="l00302"></a>00302 <span class="comment"> * @param b The brigade</span>
+<a name="l00303"></a>00303 <span class="comment"> */</span>
+<a name="l00304"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#ge1dfe8bf117d10e7dc5b8e0c08f0ebb2">00304</a> <span class="preprocessor">#define APR_BRIGADE_CHECK_CONSISTENCY(b)</span>
+<a name="l00305"></a>00305 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00306"></a>00306 <span class="comment"> * checks the brigade a bucket is in for ring consistency.  an</span>
+<a name="l00307"></a>00307 <span class="comment"> * abort() will be triggered if any inconsistencies are found.</span>
+<a name="l00308"></a>00308 <span class="comment"> *   note: this is a no-op unless APR_BUCKET_DEBUG is defined.</span>
+<a name="l00309"></a>00309 <span class="comment"> * @param e The bucket</span>
+<a name="l00310"></a>00310 <span class="comment"> */</span>
+<a name="l00311"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gedaeb3fbe71aac408377471b8a54dc08">00311</a> <span class="preprocessor">#define APR_BUCKET_CHECK_CONSISTENCY(e)</span>
+<a name="l00312"></a>00312 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00313"></a>00313 <span class="preprocessor"></span>
+<a name="l00314"></a>00314 <span class="comment"></span>
+<a name="l00315"></a>00315 <span class="comment">/**</span>
+<a name="l00316"></a>00316 <span class="comment"> * Wrappers around the RING macros to reduce the verbosity of the code</span>
+<a name="l00317"></a>00317 <span class="comment"> * that handles bucket brigades.</span>
+<a name="l00318"></a>00318 <span class="comment"> */</span><span class="comment"></span>
+<a name="l00319"></a>00319 <span class="comment">/**</span>
+<a name="l00320"></a>00320 <span class="comment"> * The magic pointer value that indicates the head of the brigade</span>
+<a name="l00321"></a>00321 <span class="comment"> * @remark This is used to find the beginning and end of the brigade, eg:</span>
+<a name="l00322"></a>00322 <span class="comment"> * &lt;pre&gt;</span>
+<a name="l00323"></a>00323 <span class="comment"> *      while (e != APR_BRIGADE_SENTINEL(b)) {</span>
+<a name="l00324"></a>00324 <span class="comment"> *          ...</span>
+<a name="l00325"></a>00325 <span class="comment"> *          e = APR_BUCKET_NEXT(e);</span>
+<a name="l00326"></a>00326 <span class="comment"> *      }</span>
+<a name="l00327"></a>00327 <span class="comment"> * &lt;/pre&gt;</span>
+<a name="l00328"></a>00328 <span class="comment"> * @param  b The brigade</span>
+<a name="l00329"></a>00329 <span class="comment"> * @return The magic pointer value</span>
+<a name="l00330"></a>00330 <span class="comment"> */</span>
+<a name="l00331"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g858da66dccab1e063415678bb115788a">00331</a> <span class="preprocessor">#define APR_BRIGADE_SENTINEL(b) APR_RING_SENTINEL(&amp;(b)-&gt;list, apr_bucket, link)</span>
+<a name="l00332"></a>00332 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00333"></a>00333 <span class="comment">/**</span>
+<a name="l00334"></a>00334 <span class="comment"> * Determine if the bucket brigade is empty</span>
+<a name="l00335"></a>00335 <span class="comment"> * @param b The brigade to check</span>
+<a name="l00336"></a>00336 <span class="comment"> * @return true or false</span>
+<a name="l00337"></a>00337 <span class="comment"> */</span>
+<a name="l00338"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g836f61da6cce15074eff257ce4b6fc0f">00338</a> <span class="preprocessor">#define APR_BRIGADE_EMPTY(b)    APR_RING_EMPTY(&amp;(b)-&gt;list, apr_bucket, link)</span>
+<a name="l00339"></a>00339 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00340"></a>00340 <span class="comment">/**</span>
+<a name="l00341"></a>00341 <span class="comment"> * Return the first bucket in a brigade</span>
+<a name="l00342"></a>00342 <span class="comment"> * @param b The brigade to query</span>
+<a name="l00343"></a>00343 <span class="comment"> * @return The first bucket in the brigade</span>
+<a name="l00344"></a>00344 <span class="comment"> */</span>
+<a name="l00345"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gb5826a11eb6ba90786a94282f806c230">00345</a> <span class="preprocessor">#define APR_BRIGADE_FIRST(b)    APR_RING_FIRST(&amp;(b)-&gt;list)</span>
+<a name="l00346"></a>00346 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00347"></a>00347 <span class="comment"> * Return the last bucket in a brigade</span>
+<a name="l00348"></a>00348 <span class="comment"> * @param b The brigade to query</span>
+<a name="l00349"></a>00349 <span class="comment"> * @return The last bucket in the brigade</span>
+<a name="l00350"></a>00350 <span class="comment"> */</span>
+<a name="l00351"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g40e0ef2a904aa519ca9d63288dee0b4d">00351</a> <span class="preprocessor">#define APR_BRIGADE_LAST(b)     APR_RING_LAST(&amp;(b)-&gt;list)</span>
+<a name="l00352"></a>00352 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00353"></a>00353 <span class="comment">/**</span>
+<a name="l00354"></a>00354 <span class="comment"> * Insert a list of buckets at the front of a brigade</span>
+<a name="l00355"></a>00355 <span class="comment"> * @param b The brigade to add to</span>
+<a name="l00356"></a>00356 <span class="comment"> * @param e The first bucket in a list of buckets to insert</span>
+<a name="l00357"></a>00357 <span class="comment"> */</span>
+<a name="l00358"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g6dc39d8757e18941a6fb069b0c18fbd3">00358</a> <span class="preprocessor">#define APR_BRIGADE_INSERT_HEAD(b, e) do {                              \</span>
+<a name="l00359"></a>00359 <span class="preprocessor">        apr_bucket *ap__b = (e);                                        \</span>
+<a name="l00360"></a>00360 <span class="preprocessor">        APR_RING_INSERT_HEAD(&amp;(b)-&gt;list, ap__b, apr_bucket, link);      \</span>
+<a name="l00361"></a>00361 <span class="preprocessor">        APR_BRIGADE_CHECK_CONSISTENCY((b));                             \</span>
+<a name="l00362"></a>00362 <span class="preprocessor">    } while (0)</span>
+<a name="l00363"></a>00363 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00364"></a>00364 <span class="comment">/**</span>
+<a name="l00365"></a>00365 <span class="comment"> * Insert a list of buckets at the end of a brigade</span>
+<a name="l00366"></a>00366 <span class="comment"> * @param b The brigade to add to</span>
+<a name="l00367"></a>00367 <span class="comment"> * @param e The first bucket in a list of buckets to insert</span>
+<a name="l00368"></a>00368 <span class="comment"> */</span>
+<a name="l00369"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g5447595f8374296c5ffe208db39b2f5d">00369</a> <span class="preprocessor">#define APR_BRIGADE_INSERT_TAIL(b, e) do {                              \</span>
+<a name="l00370"></a>00370 <span class="preprocessor">        apr_bucket *ap__b = (e);                                        \</span>
+<a name="l00371"></a>00371 <span class="preprocessor">        APR_RING_INSERT_TAIL(&amp;(b)-&gt;list, ap__b, apr_bucket, link);      \</span>
+<a name="l00372"></a>00372 <span class="preprocessor">        APR_BRIGADE_CHECK_CONSISTENCY((b));                             \</span>
+<a name="l00373"></a>00373 <span class="preprocessor">    } while (0)</span>
+<a name="l00374"></a>00374 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00375"></a>00375 <span class="comment">/**</span>
+<a name="l00376"></a>00376 <span class="comment"> * Concatenate brigade b onto the end of brigade a, leaving brigade b empty</span>
+<a name="l00377"></a>00377 <span class="comment"> * @param a The first brigade</span>
+<a name="l00378"></a>00378 <span class="comment"> * @param b The second brigade</span>
+<a name="l00379"></a>00379 <span class="comment"> */</span>
+<a name="l00380"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g7cecbc89be912ce9ab24c889eb8f955b">00380</a> <span class="preprocessor">#define APR_BRIGADE_CONCAT(a, b) do {                                   \</span>
+<a name="l00381"></a>00381 <span class="preprocessor">        APR_RING_CONCAT(&amp;(a)-&gt;list, &amp;(b)-&gt;list, apr_bucket, link);      \</span>
+<a name="l00382"></a>00382 <span class="preprocessor">        APR_BRIGADE_CHECK_CONSISTENCY((a));                             \</span>
+<a name="l00383"></a>00383 <span class="preprocessor">    } while (0)</span>
+<a name="l00384"></a>00384 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00385"></a>00385 <span class="comment">/**</span>
+<a name="l00386"></a>00386 <span class="comment"> * Prepend brigade b onto the beginning of brigade a, leaving brigade b empty</span>
+<a name="l00387"></a>00387 <span class="comment"> * @param a The first brigade</span>
+<a name="l00388"></a>00388 <span class="comment"> * @param b The second brigade</span>
+<a name="l00389"></a>00389 <span class="comment"> */</span>
+<a name="l00390"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g52ba212f76507a79ccae213875150ad1">00390</a> <span class="preprocessor">#define APR_BRIGADE_PREPEND(a, b) do {                                  \</span>
+<a name="l00391"></a>00391 <span class="preprocessor">        APR_RING_PREPEND(&amp;(a)-&gt;list, &amp;(b)-&gt;list, apr_bucket, link);     \</span>
+<a name="l00392"></a>00392 <span class="preprocessor">        APR_BRIGADE_CHECK_CONSISTENCY((a));                             \</span>
+<a name="l00393"></a>00393 <span class="preprocessor">    } while (0)</span>
+<a name="l00394"></a>00394 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00395"></a>00395 <span class="comment">/**</span>
+<a name="l00396"></a>00396 <span class="comment"> * Insert a list of buckets before a specified bucket</span>
+<a name="l00397"></a>00397 <span class="comment"> * @param a The bucket to insert before</span>
+<a name="l00398"></a>00398 <span class="comment"> * @param b The buckets to insert</span>
+<a name="l00399"></a>00399 <span class="comment"> */</span>
+<a name="l00400"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#ge012adeccda754eabc42b7855bec081e">00400</a> <span class="preprocessor">#define APR_BUCKET_INSERT_BEFORE(a, b) do {                             \</span>
+<a name="l00401"></a>00401 <span class="preprocessor">        apr_bucket *ap__a = (a), *ap__b = (b);                          \</span>
+<a name="l00402"></a>00402 <span class="preprocessor">        APR_RING_INSERT_BEFORE(ap__a, ap__b, link);                     \</span>
+<a name="l00403"></a>00403 <span class="preprocessor">        APR_BUCKET_CHECK_CONSISTENCY(ap__a);                            \</span>
+<a name="l00404"></a>00404 <span class="preprocessor">    } while (0)</span>
+<a name="l00405"></a>00405 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00406"></a>00406 <span class="comment">/**</span>
+<a name="l00407"></a>00407 <span class="comment"> * Insert a list of buckets after a specified bucket</span>
+<a name="l00408"></a>00408 <span class="comment"> * @param a The bucket to insert after</span>
+<a name="l00409"></a>00409 <span class="comment"> * @param b The buckets to insert</span>
+<a name="l00410"></a>00410 <span class="comment"> */</span>
+<a name="l00411"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g1f8114b7316d1fef1deb95abc8f02341">00411</a> <span class="preprocessor">#define APR_BUCKET_INSERT_AFTER(a, b) do {                              \</span>
+<a name="l00412"></a>00412 <span class="preprocessor">        apr_bucket *ap__a = (a), *ap__b = (b);                          \</span>
+<a name="l00413"></a>00413 <span class="preprocessor">        APR_RING_INSERT_AFTER(ap__a, ap__b, link);                      \</span>
+<a name="l00414"></a>00414 <span class="preprocessor">        APR_BUCKET_CHECK_CONSISTENCY(ap__a);                            \</span>
+<a name="l00415"></a>00415 <span class="preprocessor">    } while (0)</span>
+<a name="l00416"></a>00416 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00417"></a>00417 <span class="comment">/**</span>
+<a name="l00418"></a>00418 <span class="comment"> * Get the next bucket in the list</span>
+<a name="l00419"></a>00419 <span class="comment"> * @param e The current bucket</span>
+<a name="l00420"></a>00420 <span class="comment"> * @return The next bucket</span>
+<a name="l00421"></a>00421 <span class="comment"> */</span>
+<a name="l00422"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g7171f690b203d548a5b6ae0b079068d8">00422</a> <span class="preprocessor">#define APR_BUCKET_NEXT(e)      APR_RING_NEXT((e), link)</span>
+<a name="l00423"></a>00423 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00424"></a>00424 <span class="comment"> * Get the previous bucket in the list</span>
+<a name="l00425"></a>00425 <span class="comment"> * @param e The current bucket</span>
+<a name="l00426"></a>00426 <span class="comment"> * @return The previous bucket</span>
+<a name="l00427"></a>00427 <span class="comment"> */</span>
+<a name="l00428"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gf229fecd4174efd4d6a9774e3048ae28">00428</a> <span class="preprocessor">#define APR_BUCKET_PREV(e)      APR_RING_PREV((e), link)</span>
+<a name="l00429"></a>00429 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00430"></a>00430 <span class="comment">/**</span>
+<a name="l00431"></a>00431 <span class="comment"> * Remove a bucket from its bucket brigade</span>
+<a name="l00432"></a>00432 <span class="comment"> * @param e The bucket to remove</span>
+<a name="l00433"></a>00433 <span class="comment"> */</span>
+<a name="l00434"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g2c46a1b717a87b68bd98b425e0c64977">00434</a> <span class="preprocessor">#define APR_BUCKET_REMOVE(e)    APR_RING_REMOVE((e), link)</span>
+<a name="l00435"></a>00435 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00436"></a>00436 <span class="comment">/**</span>
+<a name="l00437"></a>00437 <span class="comment"> * Initialize a new bucket's prev/next pointers</span>
+<a name="l00438"></a>00438 <span class="comment"> * @param e The bucket to initialize</span>
+<a name="l00439"></a>00439 <span class="comment"> */</span>
+<a name="l00440"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g00c2e104125f124c3a52627863432de9">00440</a> <span class="preprocessor">#define APR_BUCKET_INIT(e)      APR_RING_ELEM_INIT((e), link)</span>
+<a name="l00441"></a>00441 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00442"></a>00442 <span class="comment">/**</span>
+<a name="l00443"></a>00443 <span class="comment"> * Determine if a bucket contains metadata.  An empty bucket is</span>
+<a name="l00444"></a>00444 <span class="comment"> * safe to arbitrarily remove if and only if this is false.</span>
+<a name="l00445"></a>00445 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00446"></a>00446 <span class="comment"> * @return true or false</span>
+<a name="l00447"></a>00447 <span class="comment"> */</span>
+<a name="l00448"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g506cb29cc1ec1abeb487e01b122bd4d9">00448</a> <span class="preprocessor">#define APR_BUCKET_IS_METADATA(e)    ((e)-&gt;type-&gt;is_metadata)</span>
+<a name="l00449"></a>00449 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00450"></a>00450 <span class="comment">/**</span>
+<a name="l00451"></a>00451 <span class="comment"> * Determine if a bucket is a FLUSH bucket</span>
+<a name="l00452"></a>00452 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00453"></a>00453 <span class="comment"> * @return true or false</span>
+<a name="l00454"></a>00454 <span class="comment"> */</span>
+<a name="l00455"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g24105da0bb755a775c4b2a519d7c25f9">00455</a> <span class="preprocessor">#define APR_BUCKET_IS_FLUSH(e)       ((e)-&gt;type == &amp;apr_bucket_type_flush)</span>
+<a name="l00456"></a>00456 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00457"></a>00457 <span class="comment"> * Determine if a bucket is an EOS bucket</span>
+<a name="l00458"></a>00458 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00459"></a>00459 <span class="comment"> * @return true or false</span>
+<a name="l00460"></a>00460 <span class="comment"> */</span>
+<a name="l00461"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g89b225e1c08473766eec719b985ca0d6">00461</a> <span class="preprocessor">#define APR_BUCKET_IS_EOS(e)         ((e)-&gt;type == &amp;apr_bucket_type_eos)</span>
+<a name="l00462"></a>00462 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00463"></a>00463 <span class="comment"> * Determine if a bucket is a FILE bucket</span>
+<a name="l00464"></a>00464 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00465"></a>00465 <span class="comment"> * @return true or false</span>
+<a name="l00466"></a>00466 <span class="comment"> */</span>
+<a name="l00467"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g1d54037bb6953c73d5c61f64c311d470">00467</a> <span class="preprocessor">#define APR_BUCKET_IS_FILE(e)        ((e)-&gt;type == &amp;apr_bucket_type_file)</span>
+<a name="l00468"></a>00468 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00469"></a>00469 <span class="comment"> * Determine if a bucket is a PIPE bucket</span>
+<a name="l00470"></a>00470 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00471"></a>00471 <span class="comment"> * @return true or false</span>
+<a name="l00472"></a>00472 <span class="comment"> */</span>
+<a name="l00473"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g03e62d86c994d1d1cc9be3eb8b8f6ac6">00473</a> <span class="preprocessor">#define APR_BUCKET_IS_PIPE(e)        ((e)-&gt;type == &amp;apr_bucket_type_pipe)</span>
+<a name="l00474"></a>00474 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00475"></a>00475 <span class="comment"> * Determine if a bucket is a SOCKET bucket</span>
+<a name="l00476"></a>00476 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00477"></a>00477 <span class="comment"> * @return true or false</span>
+<a name="l00478"></a>00478 <span class="comment"> */</span>
+<a name="l00479"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g4b8315b498e4eb67efde1c83bdbe8b87">00479</a> <span class="preprocessor">#define APR_BUCKET_IS_SOCKET(e)      ((e)-&gt;type == &amp;apr_bucket_type_socket)</span>
+<a name="l00480"></a>00480 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00481"></a>00481 <span class="comment"> * Determine if a bucket is a HEAP bucket</span>
+<a name="l00482"></a>00482 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00483"></a>00483 <span class="comment"> * @return true or false</span>
+<a name="l00484"></a>00484 <span class="comment"> */</span>
+<a name="l00485"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g3dee4fbd5b4e16e5188a6cfec40b6961">00485</a> <span class="preprocessor">#define APR_BUCKET_IS_HEAP(e)        ((e)-&gt;type == &amp;apr_bucket_type_heap)</span>
+<a name="l00486"></a>00486 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00487"></a>00487 <span class="comment"> * Determine if a bucket is a TRANSIENT bucket</span>
+<a name="l00488"></a>00488 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00489"></a>00489 <span class="comment"> * @return true or false</span>
+<a name="l00490"></a>00490 <span class="comment"> */</span>
+<a name="l00491"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g1a7e7ac5fddbab4ce189e8d3007446ff">00491</a> <span class="preprocessor">#define APR_BUCKET_IS_TRANSIENT(e)   ((e)-&gt;type == &amp;apr_bucket_type_transient)</span>
+<a name="l00492"></a>00492 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00493"></a>00493 <span class="comment"> * Determine if a bucket is a IMMORTAL bucket</span>
+<a name="l00494"></a>00494 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00495"></a>00495 <span class="comment"> * @return true or false</span>
+<a name="l00496"></a>00496 <span class="comment"> */</span>
+<a name="l00497"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g53f1188c168acf7dcfabfa1ac5a08655">00497</a> <span class="preprocessor">#define APR_BUCKET_IS_IMMORTAL(e)    ((e)-&gt;type == &amp;apr_bucket_type_immortal)</span>
+<a name="l00498"></a>00498 <span class="preprocessor"></span><span class="preprocessor">#if APR_HAS_MMAP</span>
+<a name="l00499"></a>00499 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00500"></a>00500 <span class="comment"> * Determine if a bucket is a MMAP bucket</span>
+<a name="l00501"></a>00501 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00502"></a>00502 <span class="comment"> * @return true or false</span>
+<a name="l00503"></a>00503 <span class="comment"> */</span>
+<a name="l00504"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g1693d49aeb0287e3b171c922c6b633d2">00504</a> <span class="preprocessor">#define APR_BUCKET_IS_MMAP(e)        ((e)-&gt;type == &amp;apr_bucket_type_mmap)</span>
+<a name="l00505"></a>00505 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00506"></a>00506 <span class="preprocessor"></span><span class="comment">/**</span>
+<a name="l00507"></a>00507 <span class="comment"> * Determine if a bucket is a POOL bucket</span>
+<a name="l00508"></a>00508 <span class="comment"> * @param e The bucket to inspect</span>
+<a name="l00509"></a>00509 <span class="comment"> * @return true or false</span>
+<a name="l00510"></a>00510 <span class="comment"> */</span>
+<a name="l00511"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gdbe80a9016da6a06ab414ba61d6625d0">00511</a> <span class="preprocessor">#define APR_BUCKET_IS_POOL(e)        ((e)-&gt;type == &amp;apr_bucket_type_pool)</span>
+<a name="l00512"></a>00512 <span class="preprocessor"></span>
+<a name="l00513"></a>00513 <span class="comment">/*</span>
+<a name="l00514"></a>00514 <span class="comment"> * General-purpose reference counting for the various bucket types.</span>
+<a name="l00515"></a>00515 <span class="comment"> *</span>
+<a name="l00516"></a>00516 <span class="comment"> * Any bucket type that keeps track of the resources it uses (i.e.</span>
+<a name="l00517"></a>00517 <span class="comment"> * most of them except for IMMORTAL, TRANSIENT, and EOS) needs to</span>
+<a name="l00518"></a>00518 <span class="comment"> * attach a reference count to the resource so that it can be freed</span>
+<a name="l00519"></a>00519 <span class="comment"> * when the last bucket that uses it goes away. Resource-sharing may</span>
+<a name="l00520"></a>00520 <span class="comment"> * occur because of bucket splits or buckets that refer to globally</span>
+<a name="l00521"></a>00521 <span class="comment"> * cached data. */</span>
+<a name="l00522"></a>00522 <span class="comment"></span>
+<a name="l00523"></a>00523 <span class="comment">/** @see apr_bucket_refcount */</span>
+<a name="l00524"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g785fd3402961b30315975b0c87c87706">00524</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__refcount.html">apr_bucket_refcount</a> <a class="code" href="structapr__bucket__refcount.html">apr_bucket_refcount</a>;<span class="comment"></span>
+<a name="l00525"></a>00525 <span class="comment">/**</span>
+<a name="l00526"></a>00526 <span class="comment"> * The structure used to manage the shared resource must start with an</span>
+<a name="l00527"></a>00527 <span class="comment"> * apr_bucket_refcount which is updated by the general-purpose refcount</span>
+<a name="l00528"></a>00528 <span class="comment"> * code. A pointer to the bucket-type-dependent private data structure</span>
+<a name="l00529"></a>00529 <span class="comment"> * can be cast to a pointer to an apr_bucket_refcount and vice versa.</span>
+<a name="l00530"></a>00530 <span class="comment"> */</span>
+<a name="l00531"></a><a class="code" href="structapr__bucket__refcount.html">00531</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__refcount.html">apr_bucket_refcount</a> {<span class="comment"></span>
+<a name="l00532"></a>00532 <span class="comment">    /** The number of references to this bucket */</span>
+<a name="l00533"></a><a class="code" href="structapr__bucket__refcount.html#75040af03e3ad3c722bccea1048e3dae">00533</a>     <span class="keywordtype">int</span>          refcount;
+<a name="l00534"></a>00534 };
+<a name="l00535"></a>00535 
+<a name="l00536"></a>00536 <span class="comment">/*  *****  Reference-counted bucket types  *****  */</span>
+<a name="l00537"></a>00537 <span class="comment"></span>
+<a name="l00538"></a>00538 <span class="comment">/** @see apr_bucket_heap */</span>
+<a name="l00539"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#gede6e77d621d0f3f7d2685d489d01283">00539</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__heap.html">apr_bucket_heap</a> <a class="code" href="structapr__bucket__heap.html">apr_bucket_heap</a>;<span class="comment"></span>
+<a name="l00540"></a>00540 <span class="comment">/**</span>
+<a name="l00541"></a>00541 <span class="comment"> * A bucket referring to data allocated off the heap.</span>
+<a name="l00542"></a>00542 <span class="comment"> */</span>
+<a name="l00543"></a><a class="code" href="structapr__bucket__heap.html">00543</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__heap.html">apr_bucket_heap</a> {<span class="comment"></span>
+<a name="l00544"></a>00544 <span class="comment">    /** Number of buckets using this memory */</span>
+<a name="l00545"></a><a class="code" href="structapr__bucket__heap.html#b87003dea25caef69aa3b30a1948024e">00545</a>     <a class="code" href="structapr__bucket__refcount.html">apr_bucket_refcount</a>  refcount;<span class="comment"></span>
+<a name="l00546"></a>00546 <span class="comment">    /** The start of the data actually allocated.  This should never be</span>
+<a name="l00547"></a>00547 <span class="comment">     * modified, it is only used to free the bucket.</span>
+<a name="l00548"></a>00548 <span class="comment">     */</span>
+<a name="l00549"></a><a class="code" href="structapr__bucket__heap.html#c6386e2f635c6af19075123749e1fa71">00549</a>     <span class="keywordtype">char</span>    *base;<span class="comment"></span>
+<a name="l00550"></a>00550 <span class="comment">    /** how much memory was allocated */</span>
+<a name="l00551"></a><a class="code" href="structapr__bucket__heap.html#e373dada96f2e005a6aaf80e41c4cf6d">00551</a>     apr_size_t  alloc_len;<span class="comment"></span>
+<a name="l00552"></a>00552 <span class="comment">    /** function to use to delete the data */</span>
+<a name="l00553"></a>00553     void (*free_func)(<span class="keywordtype">void</span> *data);
+<a name="l00554"></a>00554 };
+<a name="l00555"></a>00555 <span class="comment"></span>
+<a name="l00556"></a>00556 <span class="comment">/** @see apr_bucket_pool */</span>
+<a name="l00557"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g211e00d871029de148116cd24b070aed">00557</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__pool.html">apr_bucket_pool</a> <a class="code" href="structapr__bucket__pool.html">apr_bucket_pool</a>;<span class="comment"></span>
+<a name="l00558"></a>00558 <span class="comment">/**</span>
+<a name="l00559"></a>00559 <span class="comment"> * A bucket referring to data allocated from a pool</span>
+<a name="l00560"></a>00560 <span class="comment"> */</span>
+<a name="l00561"></a><a class="code" href="structapr__bucket__pool.html">00561</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__pool.html">apr_bucket_pool</a> {<span class="comment"></span>
+<a name="l00562"></a>00562 <span class="comment">    /** The pool bucket must be able to be easily morphed to a heap</span>
+<a name="l00563"></a>00563 <span class="comment">     * bucket if the pool gets cleaned up before all references are</span>
+<a name="l00564"></a>00564 <span class="comment">     * destroyed.  This apr_bucket_heap structure is populated automatically</span>
+<a name="l00565"></a>00565 <span class="comment">     * when the pool gets cleaned up, and subsequent calls to pool_read()</span>
+<a name="l00566"></a>00566 <span class="comment">     * will result in the apr_bucket in question being morphed into a</span>
+<a name="l00567"></a>00567 <span class="comment">     * regular heap bucket.  (To avoid having to do many extra refcount</span>
+<a name="l00568"></a>00568 <span class="comment">     * manipulations and b-&gt;data manipulations, the apr_bucket_pool</span>
+<a name="l00569"></a>00569 <span class="comment">     * struct actually *contains* the apr_bucket_heap struct that it</span>
+<a name="l00570"></a>00570 <span class="comment">     * will become as its first element; the two share their</span>
+<a name="l00571"></a>00571 <span class="comment">     * apr_bucket_refcount members.)</span>
+<a name="l00572"></a>00572 <span class="comment">     */</span>
+<a name="l00573"></a><a class="code" href="structapr__bucket__pool.html#0fe0b0dedea28fb1ed0a1a0f42338225">00573</a>     <a class="code" href="structapr__bucket__heap.html">apr_bucket_heap</a>  heap;<span class="comment"></span>
+<a name="l00574"></a>00574 <span class="comment">    /** The block of data actually allocated from the pool.</span>
+<a name="l00575"></a>00575 <span class="comment">     * Segments of this block are referenced by adjusting</span>
+<a name="l00576"></a>00576 <span class="comment">     * the start and length of the apr_bucket accordingly.</span>
+<a name="l00577"></a>00577 <span class="comment">     * This will be NULL after the pool gets cleaned up.</span>
+<a name="l00578"></a>00578 <span class="comment">     */</span>
+<a name="l00579"></a><a class="code" href="structapr__bucket__pool.html#9ee5297361ba548a20c3aa626a37c068">00579</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *base;<span class="comment"></span>
+<a name="l00580"></a>00580 <span class="comment">    /** The pool the data was allocated from.  When the pool</span>
+<a name="l00581"></a>00581 <span class="comment">     * is cleaned up, this gets set to NULL as an indicator</span>
+<a name="l00582"></a>00582 <span class="comment">     * to pool_read() that the data is now on the heap and</span>
+<a name="l00583"></a>00583 <span class="comment">     * so it should morph the bucket into a regular heap</span>
+<a name="l00584"></a>00584 <span class="comment">     * bucket before continuing.</span>
+<a name="l00585"></a>00585 <span class="comment">     */</span>
+<a name="l00586"></a><a class="code" href="structapr__bucket__pool.html#f55591a1e7f3b097e7c271683bc80968">00586</a>     <a class="code" href="group__apr__pools.html#gf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *pool;<span class="comment"></span>
+<a name="l00587"></a>00587 <span class="comment">    /** The freelist this structure was allocated from, which is</span>
+<a name="l00588"></a>00588 <span class="comment">     * needed in the cleanup phase in order to allocate space on the heap</span>
+<a name="l00589"></a>00589 <span class="comment">     */</span>
+<a name="l00590"></a><a class="code" href="structapr__bucket__pool.html#651aa0c18658342daf72ff86680bfaca">00590</a>     <a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">apr_bucket_alloc_t</a> *list;
+<a name="l00591"></a>00591 };
+<a name="l00592"></a>00592 
+<a name="l00593"></a>00593 <span class="preprocessor">#if APR_HAS_MMAP</span>
+<a name="l00594"></a>00594 <span class="preprocessor"></span><span class="comment">/** @see apr_bucket_mmap */</span>
+<a name="l00595"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g27ede7c3a29627c7d184dc7cfbc4f767">00595</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__mmap.html">apr_bucket_mmap</a> <a class="code" href="structapr__bucket__mmap.html">apr_bucket_mmap</a>;<span class="comment"></span>
+<a name="l00596"></a>00596 <span class="comment">/**</span>
+<a name="l00597"></a>00597 <span class="comment"> * A bucket referring to an mmap()ed file</span>
+<a name="l00598"></a>00598 <span class="comment"> */</span>
+<a name="l00599"></a><a class="code" href="structapr__bucket__mmap.html">00599</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__mmap.html">apr_bucket_mmap</a> {<span class="comment"></span>
+<a name="l00600"></a>00600 <span class="comment">    /** Number of buckets using this memory */</span>
+<a name="l00601"></a><a class="code" href="structapr__bucket__mmap.html#99f201622002479f4f84ea10598a013c">00601</a>     <a class="code" href="structapr__bucket__refcount.html">apr_bucket_refcount</a>  refcount;<span class="comment"></span>
+<a name="l00602"></a>00602 <span class="comment">    /** The mmap this sub_bucket refers to */</span>
+<a name="l00603"></a><a class="code" href="structapr__bucket__mmap.html#66e9385752aaacb7fef7e96db62f1920">00603</a>     <a class="code" href="structapr__mmap__t.html">apr_mmap_t</a> *mmap;
+<a name="l00604"></a>00604 };
+<a name="l00605"></a>00605 <span class="preprocessor">#endif</span>
+<a name="l00606"></a>00606 <span class="preprocessor"></span><span class="comment"></span>
+<a name="l00607"></a>00607 <span class="comment">/** @see apr_bucket_file */</span>
+<a name="l00608"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g1a786f7edac4d7a2c212f0fe74457b3d">00608</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__bucket__file.html">apr_bucket_file</a> <a class="code" href="structapr__bucket__file.html">apr_bucket_file</a>;<span class="comment"></span>
+<a name="l00609"></a>00609 <span class="comment">/**</span>
+<a name="l00610"></a>00610 <span class="comment"> * A bucket referring to an file</span>
+<a name="l00611"></a>00611 <span class="comment"> */</span>
+<a name="l00612"></a><a class="code" href="structapr__bucket__file.html">00612</a> <span class="keyword">struct </span><a class="code" href="structapr__bucket__file.html">apr_bucket_file</a> {<span class="comment"></span>
+<a name="l00613"></a>00613 <span class="comment">    /** Number of buckets using this memory */</span>
+<a name="l00614"></a><a class="code" href="structapr__bucket__file.html#b0c123f34b85a07b601dc9794f8eed09">00614</a>     <a class="code" href="structapr__bucket__refcount.html">apr_bucket_refcount</a>  refcount;<span class="comment"></span>
+<a name="l00615"></a>00615 <span class="comment">    /** The file this bucket refers to */</span>
+<a name="l00616"></a><a class="code" href="structapr__bucket__file.html#a43154c0bc9d41ba4b0762c906de432f">00616</a>     <a class="code" href="group__apr__file__io.html#ga46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *fd;<span class="comment"></span>
+<a name="l00617"></a>00617 <span class="comment">    /** The pool into which any needed structures should</span>
+<a name="l00618"></a>00618 <span class="comment">     *  be created while reading from this file bucket */</span>
+<a name="l00619"></a><a class="code" href="structapr__bucket__file.html#61b5603482215f6c9ace7b26fa12b884">00619</a>     <a class="code" href="group__apr__pools.html#gf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *readpool;
+<a name="l00620"></a>00620 <span class="preprocessor">#if APR_HAS_MMAP</span>
+<a name="l00621"></a>00621 <span class="preprocessor"></span><span class="comment">    /** Whether this bucket should be memory-mapped if</span>
+<a name="l00622"></a>00622 <span class="comment">     *  a caller tries to read from it */</span>
+<a name="l00623"></a><a class="code" href="structapr__bucket__file.html#7812a8d6e6f10d0095569f04d3423e83">00623</a>     <span class="keywordtype">int</span> can_mmap;
+<a name="l00624"></a>00624 <span class="preprocessor">#endif </span><span class="comment">/* APR_HAS_MMAP */</span>
+<a name="l00625"></a>00625 };
+<a name="l00626"></a>00626 <span class="comment"></span>
+<a name="l00627"></a>00627 <span class="comment">/** @see apr_bucket_structs */</span>
+<a name="l00628"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#g3c0929c971f94de4521fb0fea6fd3209">00628</a> <span class="keyword">typedef</span> <span class="keyword">union </span><a class="code" href="unionapr__bucket__structs.html">apr_bucket_structs</a> <a class="code" href="unionapr__bucket__structs.html">apr_bucket_structs</a>;<span class="comment"></span>
+<a name="l00629"></a>00629 <span class="comment">/**</span>
+<a name="l00630"></a>00630 <span class="comment"> * A union of all bucket structures so we know what</span>
+<a name="l00631"></a>00631 <span class="comment"> * the max size is.</span>
+<a name="l00632"></a>00632 <span class="comment"> */</span>
+<a name="l00633"></a><a class="code" href="unionapr__bucket__structs.html">00633</a> <span class="keyword">union </span><a class="code" href="unionapr__bucket__structs.html">apr_bucket_structs</a> {
+<a name="l00634"></a><a class="code" href="unionapr__bucket__structs.html#840c42a20727de2e4534ca05f1f6c990">00634</a>     <a class="code" href="structapr__bucket.html">apr_bucket</a>      b;      <span class="comment">/**&lt; Bucket */</span>
+<a name="l00635"></a><a class="code" href="unionapr__bucket__structs.html#5335dc82d8250e511a9c55e5fea97141">00635</a>     <a class="code" href="structapr__bucket__heap.html">apr_bucket_heap</a> heap;   <span class="comment">/**&lt; Heap */</span>
+<a name="l00636"></a><a class="code" href="unionapr__bucket__structs.html#b926fe2af7c1780c03bf1669766db4a1">00636</a>     <a class="code" href="structapr__bucket__pool.html">apr_bucket_pool</a> pool;   <span class="comment">/**&lt; Pool */</span>
+<a name="l00637"></a>00637 <span class="preprocessor">#if APR_HAS_MMAP</span>
+<a name="l00638"></a><a class="code" href="unionapr__bucket__structs.html#627c4ca697f06bbf4226c8c2acd93cbc">00638</a> <span class="preprocessor"></span>    <a class="code" href="structapr__bucket__mmap.html">apr_bucket_mmap</a> mmap;   <span class="comment">/**&lt; MMap */</span>
+<a name="l00639"></a>00639 <span class="preprocessor">#endif</span>
+<a name="l00640"></a><a class="code" href="unionapr__bucket__structs.html#b339255acdf750133759a0d67b3f2e30">00640</a> <span class="preprocessor"></span>    <a class="code" href="structapr__bucket__file.html">apr_bucket_file</a> file;   <span class="comment">/**&lt; File */</span>
+<a name="l00641"></a>00641 };
+<a name="l00642"></a>00642 <span class="comment"></span>
+<a name="l00643"></a>00643 <span class="comment">/**</span>
+<a name="l00644"></a>00644 <span class="comment"> * The amount that apr_bucket_alloc() should allocate in the common case.</span>
+<a name="l00645"></a>00645 <span class="comment"> * Note: this is twice as big as apr_bucket_structs to allow breathing</span>
+<a name="l00646"></a>00646 <span class="comment"> * room for third-party bucket types.</span>
+<a name="l00647"></a>00647 <span class="comment"> */</span>
+<a name="l00648"></a><a class="code" href="group___a_p_r___util___bucket___brigades.html#ge3ccf4c383c9e7fea28354cc8e029626">00648</a> <span class="preprocessor">#define APR_BUCKET_ALLOC_SIZE  APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))</span>
+<a name="l00649"></a>00649 <span class="preprocessor"></span>
+<a name="l00650"></a>00650 <span class="comment">/*  *****  Bucket Brigade Functions  *****  */</span><span class="comment"></span>
+<a name="l00651"></a>00651 <span class="comment">/**</span>
+<a name="l00652"></a>00652 <span class="comment"> * Create a new bucket brigade.  The bucket brigade is originally empty.</span>
+<a name="l00653"></a>00653 <span class="comment"> * @param p The pool to associate with the brigade.  Data is not allocated out</span>
+<a name="l00654"></a>00654 <span class="comment"> *          of the pool, but a cleanup is registered.</span>
+<a name="l00655"></a>00655 <span class="comment"> * @param list The bucket allocator to use</span>
+<a name="l00656"></a>00656 <span class="comment"> * @return The empty bucket brigade</span>
+<a name="l00657"></a>00657 <span class="comment"> */</span>
+<a name="l00658"></a>00658 <a class="code" href="group___a_p_r___util___base64.html#gf43a293bb29d7041e6c85e90b967715f">APU_DECLARE</a>(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *) apr_brigade_create(<a class="code" href="group__apr__pools.html#gf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *<a class="code" href="structapr__bucket__brigade.html#8e03b4dd531903709ae3ae8ebe9e46ee">p</a>,
+<a name="l00659"></a>00659                                                      <a class="code" href="group___a_p_r___util___bucket___brigades.html#g9a30babfeb6e290db124d8f9b69e49e4">apr_bucket_alloc_t</a> *list);
+<a name="l00660"></a>00660 <span class="comment"></span>
+<a name="l00661"></a>00661 <span class="comment">/**</span>
+<a name="l00662"></a>00662 <span class="comment"> * destroy an entire bucket brigade.  This includes destroying all of the</span>
+<a name="l00663"></a>00663 <span class="comment"> * buckets within the bucket brigade's bucket list. </span>
+<a name="l00664"></a>00664 <span class="comment"> * @param b The bucket brigade to destroy</span>
+<a name="l00665"></a>00665 <span class="comment"> */</span>
+<a name="l00666"></a>00666 <a class="code" href="group___a_p_r___util___base64.html#gf43a293bb29d7041e6c85e90b967715f">APU_DECLARE</a>(<a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) apr_brigade_destroy(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *b);
+<a name="l00667"></a>00667 <span class="comment"></span>
+<a name="l00668"></a>00668 <span class="comment">/**</span>
+<a name="l00669"></a>00669 <span class="comment"> * empty out an entire bucket brigade.  This includes destroying all of the</span>
+<a name="l00670"></a>00670 <span class="comment"> * buckets within the bucket brigade's bucket list.  This is similar to</span>
+<a name="l00671"></a>00671 <span class="comment"> * apr_brigade_destroy(), except that it does not deregister the brigade's</span>
+<a name="l00672"></a>00672 <span class="comment"> * pool cleanup function.</span>
+<a name="l00673"></a>00673 <span class="comment"> * @param data The bucket brigade to clean up</span>
+<a name="l00674"></a>00674 <span class="comment"> * @remark Generally, you should use apr_brigade_destroy().  This function</span>
+<a name="l00675"></a>00675 <span class="comment"> *         can be useful in situations where you have a single brigade that</span>
+<a name="l00676"></a>00676 <span class="comment"> *         you wish to reuse many times by destroying all of the buckets in</span>
+<a name="l00677"></a>00677 <span class="comment"> *         the brigade and putting new buckets into it later.</span>
+<a name="l00678"></a>00678 <span class="comment"> */</span>
+<a name="l00679"></a>00679 <a class="code" href="group___a_p_r___util___base64.html#gf43a293bb29d7041e6c85e90b967715f">APU_DECLARE</a>(<a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) apr_brigade_cleanup(<span class="keywordtype">void</span> *data);
+<a name="l00680"></a>00680 <span class="comment"></span>
+<a name="l00681"></a>00681 <span class="comment">/**</span>
+<a name="l00682"></a>00682 <span class="comment"> * Move the buckets from the tail end of the existing brigade @param b into</span>
+<a name="l00683"></a>00683 <span class="comment"> * the brigade @param a. If @param a is NULL a new brigade is created. Buckets</span>
+<a name="l00684"></a>00684 <span class="comment"> * from @param e to the last bucket (inclusively) of brigade @param b are moved</span>
+<a name="l00685"></a>00685 <span class="comment"> * from @param b to the returned brigade @param a.</span>
+<a name="l00686"></a>00686 <span class="comment"> * @param b The brigade to split</span>
+<a name="l00687"></a>00687 <span class="comment"> * @param e The first bucket to move</span>
+<a name="l00688"></a>00688 <span class="comment"> * @param a The brigade which should be used for the result or NULL if</span>
+<a name="l00689"></a>00689 <span class="comment"> *          a new brigade should be created.</span>
+<a name="l00690"></a>00690 <span class="comment"> * @return The brigade supplied in @param a or a new one if @param a was NULL.</span>
+<a name="l00691"></a>00691 <span class="comment"> * @warning Note that this function allocates a new brigade if @param a is</span>
+<a name="l00692"></a>00692 <span class="comment"> * NULL so memory consumption should be carefully considered.</span>
+<a name="l00693"></a>00693 <span class="comment"> */</span>
+<a name="l00694"></a>00694 <a class="code" href="group___a_p_r___util___base64.html#gf43a293bb29d7041e6c85e90b967715f">APU_DECLARE</a>(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *) apr_brigade_split_ex(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *b,
+<a name="l00695"></a>00695                                                        <a class="code" href="structapr__bucket.html">apr_bucket</a> *e,
+<a name="l00696"></a>00696                                                        <a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *a);
+<a name="l00697"></a>00697 <span class="comment"></span>
+<a name="l00698"></a>00698 <span class="comment">/**</span>
+<a name="l00699"></a>00699 <span class="comment"> * Create a new bucket brigade and move the buckets from the tail end</span>
+<a name="l00700"></a>00700 <span class="comment"> * of an existing brigade into the new brigade.  Buckets from </span>
+<a name="l00701"></a>00701 <span class="comment"> * @param e to the last bucket (inclusively) of brigade @param b</span>
+<a name="l00702"></a>00702 <span class="comment"> * are moved from @param b to the returned brigade.</span>
+<a name="l00703"></a>00703 <span class="comment"> * @param b The brigade to split </span>
+<a name="l00704"></a>00704 <span class="comment"> * @param e The first bucket to move</span>
+<a name="l00705"></a>00705 <span class="comment"> * @return The new brigade</span>
+<a name="l00706"></a>00706 <span class="comment"> * @warning Note that this function always allocates a new brigade</span>
+<a name="l00707"></a>00707 <span class="comment"> * so memory consumption should be carefully considered.</span>
+<a name="l00708"></a>00708 <span class="comment"> */</span>
+<a name="l00709"></a>00709 <a class="code" href="group___a_p_r___util___base64.html#gf43a293bb29d7041e6c85e90b967715f">APU_DECLARE</a>(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *) apr_brigade_split(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *b,
+<a name="l00710"></a>00710                                                     <a class="code" href="structapr__bucket.html">apr_bucket</a> *e);
+<a name="l00711"></a>00711 <span class="comment"></span>
+<a name="l00712"></a>00712 <span class="comment">/**</span>
+<a name="l00713"></a>00713 <span class="comment"> * Partition a bucket brigade at a given offset (in bytes from the start of</span>
+<a name="l00714"></a>00714 <span class="comment"> * the brigade).  This is useful whenever a filter wants to use known ranges</span>
+<a name="l00715"></a>00715 <span class="comment"> * of bytes from the brigade; the ranges can even overlap.</span>
+<a name="l00716"></a>00716 <span class="comment"> * @param b The brigade to partition</span>
+<a name="l00717"></a>00717 <span class="comment"> * @param point The offset at which to partition the brigade</span>
+<a name="l00718"></a>00718 <span class="comment"> * @param after_point Returns a pointer to the first bucket after the partition</span>
+<a name="l00719"></a>00719 <span class="comment"> * @return APR_SUCCESS on success, APR_INCOMPLETE if the contents of the</span>
+<a name="l00720"></a>00720 <span class="comment"> * brigade were shorter than @a point, or an error code.</span>
+<a name="l00721"></a>00721 <span class="comment"> * @remark if APR_INCOMPLETE is returned, @a after_point will be set to</span>
+<a name="l00722"></a>00722 <span class="comment"> * the brigade sentinel.</span>
+<a name="l00723"></a>00723 <span class="comment"> */</span>
+<a name="l00724"></a>00724 <a class="code" href="group___a_p_r___util___base64.html#gf43a293bb29d7041e6c85e90b967715f">APU_DECLARE</a>(<a class="code" href="group__apr__errno.html#gf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) apr_brigade_partition(<a class="code" href="structapr__bucket__brigade.html">apr_bucket_brigade</a> *b,
+<a name="l00725"></a>00725                                                 apr_off_t point,
+<a name="l00726"></a>00726                                                 <a class="code" href="structapr__bucket.html">apr_bucket</a> **after_point);
+<a name="l00727"></a>00727 <span class="comment"></span>
+<a name="l00728"></a>00728 <span class="comment">/**</span>
+<a name="l00729"></a>00729 <span class="comment"> * Return the total length of the brigade.</span>
+<a name="l00730"></a>00730 <span class="comment"> * @param bb The brigade to compute the length of</span>
+<a name="l00731"></a>00731 <span class="comment"> * @param read_all Read unknown-length buckets to force a size</span>

[... 845 lines stripped ...]


Mime
View raw message