1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
<html>
<head>
<link rel="stylesheet" type="text/css" href="dox.css" />
<title>libapreq2-2.04-dev: libapreq2: src/apreq_params.h Source File</title>
</head>
<body>
<div id="page-header">
<p class="menu">
<a href="http://www.apache.org/">Apache Software Foundation</a> > <a href="http://httpd.apache.org">HTTP Server Project</a> >
<a href="http://httpd.apache.org/apreq/">Request Library Subproject</a></p>
<p class="apache">Apache HTTP Server Request Library</p>
<img alt="" src="feather.gif" /></div>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>src/apreq_params.h</h1><a href="apreq__params_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/*</span>
00002 <span class="comment">** Copyright 2003-2004 The Apache Software Foundation</span>
00003 <span class="comment">**</span>
00004 <span class="comment">** Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment">** you may not use this file except in compliance with the License.</span>
00006 <span class="comment">** You may obtain a copy of the License at</span>
00007 <span class="comment">**</span>
00008 <span class="comment">** http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment">**</span>
00010 <span class="comment">** Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment">** distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment">** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment">** See the License for the specific language governing permissions and</span>
00014 <span class="comment">** limitations under the License.</span>
00015 <span class="comment">*/</span>
00016
00017 <span class="preprocessor">#ifndef APREQ_PARAMS_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APREQ_PARAMS_H</span>
00019 <span class="preprocessor"></span>
00020 <span class="preprocessor">#include "<a class="code" href="apreq_8h.html">apreq.h</a>"</span>
00021
00022 <span class="preprocessor">#ifdef __cplusplus</span>
00023 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00024 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
00025
00026
<a name="l00034"></a><a class="code" href="structapreq__param__t.html">00034</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapreq__param__t.html">apreq_param_t</a> {
<a name="l00035"></a><a class="code" href="structapreq__param__t.html#o0">00035</a> <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *<a class="code" href="structapreq__param__t.html#o0">info</a>;
<a name="l00036"></a><a class="code" href="structapreq__param__t.html#o1">00036</a> <a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *<a class="code" href="structapreq__param__t.html#o1">bb</a>;
<a name="l00037"></a><a class="code" href="structapreq__param__t.html#o2">00037</a> <a class="code" href="structapreq__value__t.html">apreq_value_t</a> <a class="code" href="structapreq__param__t.html#o2">v</a>;
00038 } <a class="code" href="structapreq__param__t.html">apreq_param_t</a>;
00039
00040 <span class="comment">/* These structs are defined below */</span>
00041 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapreq__hook__t.html">apreq_hook_t</a> apreq_hook_t;
00042 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapreq__parser__t.html">apreq_parser_t</a> apreq_parser_t;
00043
<a name="l00045"></a><a class="code" href="apreq__params_8h.html#a0">00045</a> <span class="preprocessor">#define apreq_value_to_param(ptr) apreq_attr_to_type(apreq_param_t, v, ptr)</span>
00046 <span class="preprocessor"></span><span class="preprocessor">#define apreq_param_name(p) ((p)->v.name)</span>
00047 <span class="preprocessor"></span><span class="preprocessor">#define apreq_param_value(p) ((p)->v.data)</span>
00048 <span class="preprocessor"></span><span class="preprocessor">#define apreq_param_info(p) ((p)->info)</span>
00049 <span class="preprocessor"></span><span class="preprocessor">#define apreq_param_brigade(p) ((p)->bb ? apreq_copy_brigade((p)->bb) : NULL)</span>
00050 <span class="preprocessor"></span>
00052 APREQ_DECLARE(<a class="code" href="structapreq__param__t.html">apreq_param_t</a> *) apreq_make_param(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *p,
00053 const <span class="keywordtype">char</span> *name,
00054 const <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> nlen,
00055 const <span class="keywordtype">char</span> *val,
00056 const <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> vlen);
00057
<a name="l00059"></a><a class="code" href="structapreq__request__t.html">00059</a> typedef struct <a class="code" href="structapreq__request__t.html">apreq_request_t</a> {
<a name="l00060"></a><a class="code" href="structapreq__request__t.html#o0">00060</a> <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *args;
<a name="l00061"></a><a class="code" href="structapreq__request__t.html#o1">00061</a> <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *body;
<a name="l00062"></a><a class="code" href="structapreq__request__t.html#o2">00062</a> apreq_parser_t *parser;
<a name="l00063"></a><a class="code" href="structapreq__request__t.html#o3">00063</a> <span class="keywordtype">void</span> *env;
<a name="l00064"></a><a class="code" href="structapreq__request__t.html#o4">00064</a> <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a> args_status;
<a name="l00065"></a><a class="code" href="structapreq__request__t.html#o5">00065</a> <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a> body_status;
00066 } <a class="code" href="structapreq__request__t.html">apreq_request_t</a>;
00067
00068
00085 APREQ_DECLARE(<a class="code" href="structapreq__request__t.html">apreq_request_t</a> *)apreq_request(<span class="keywordtype">void</span> *env, const <span class="keywordtype">char</span> *qs);
00086
00087
00097 APREQ_DECLARE(<a class="code" href="structapreq__param__t.html">apreq_param_t</a> *) apreq_param(const <a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req,
00098 const <span class="keywordtype">char</span> *name);
00099
00100
00108 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *) apreq_params(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *p,
00109 const <a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req);
00110
00111
00112
00121 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/structapr__array__header__t.html">apr_array_header_t</a> *) apreq_params_as_array(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *p,
00122 <a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req,
00123 const <span class="keywordtype">char</span> *key);
00124
00136 APREQ_DECLARE(const <span class="keywordtype">char</span> *) apreq_params_as_string(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *p,
00137 <a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req,
00138 const <span class="keywordtype">char</span> *key,
00139 apreq_join_t mode);
00140
00141
00153 APREQ_DECLARE(<a class="code" href="structapreq__param__t.html">apreq_param_t</a> *) apreq_decode_param(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool,
00154 const <span class="keywordtype">char</span> *word,
00155 const <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> nlen,
00156 const <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> vlen);
00164 APREQ_DECLARE(<span class="keywordtype">char</span> *) apreq_encode_param(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool,
00165 const <a class="code" href="structapreq__param__t.html">apreq_param_t</a> *param);
00166
00179 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) apreq_parse_query_string(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool,
00180 <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *t,
00181 const <span class="keywordtype">char</span> *qs);
00182
00194 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>)apreq_parse_request(<a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req,
00195 <a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb);
00204 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *) apreq_uploads(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool,
00205 const <a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req);
00206
00216 APREQ_DECLARE(<a class="code" href="structapreq__param__t.html">apreq_param_t</a> *) apreq_upload(const <a class="code" href="structapreq__request__t.html">apreq_request_t</a> *req,
00217 const <span class="keywordtype">char</span> *key);
00218 #include "apreq.h"
00219
<a name="l00221"></a><a class="code" href="apreq__params_8h.html#a5">00221</a> #define APREQ_PARSER_ARGS apreq_parser_t *parser, \
00222 <span class="keywordtype">void</span> *env, \
00223 <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a> *t, \
00224 <a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb
00225
<a name="l00227"></a><a class="code" href="apreq__params_8h.html#a6">00227</a> #define APREQ_HOOK_ARGS apreq_hook_t *hook, \
00228 <span class="keywordtype">void</span> *env, \
00229 <a class="code" href="structapreq__param__t.html">apreq_param_t</a> *param, \
00230 <a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb
00231
00235 #ifndef WIN32
<a name="l00236"></a><a class="code" href="apreq__params_8h.html#a7">00236</a> #define APREQ_DECLARE_PARSER(f) APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) \
00237 (f) (APREQ_PARSER_ARGS)
00238 #else
00239 #define APREQ_DECLARE_PARSER(f) APREQ_DECLARE_NONSTD(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) \
00240 (f) (APREQ_PARSER_ARGS)
00241 #endif
00242
00246 #ifndef WIN32
<a name="l00247"></a><a class="code" href="apreq__params_8h.html#a8">00247</a> #define APREQ_DECLARE_HOOK(f) APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) \
00248 (f) (APREQ_HOOK_ARGS)
00249 #else
00250 #define APREQ_DECLARE_HOOK(f) APREQ_DECLARE_NONSTD(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) \
00251 (f) (APREQ_HOOK_ARGS)
00252 #endif
00253
<a name="l00258"></a><a class="code" href="structapreq__hook__t.html">00258</a> struct apreq_hook_t {
00259 <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> (*hook) (<a class="code" href="apreq__params_8h.html#a6">APREQ_HOOK_ARGS</a>);
00260 apreq_hook_t *next;
00261 <span class="keywordtype">void</span> *ctx;
00262 };
00263
<a name="l00268"></a><a class="code" href="structapreq__parser__t.html">00268</a> <span class="keyword">struct </span>apreq_parser_t {
00269 <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> (*parser) (<a class="code" href="apreq__params_8h.html#a5">APREQ_PARSER_ARGS</a>);
00270 <span class="keyword">const</span> <span class="keywordtype">char</span> *enctype;
00271 apreq_hook_t *hook;
00272 <span class="keywordtype">void</span> *ctx;
00273 };
00274
00275
<a name="l00286"></a><a class="code" href="apreq__params_8h.html#a9">00286</a> <span class="preprocessor">#define APREQ_RUN_PARSER(psr,env,t,bb) (psr)->parser(psr,env,t,bb)</span>
00287 <span class="preprocessor"></span>
<a name="l00294"></a><a class="code" href="apreq__params_8h.html#a10">00294</a> <span class="preprocessor">#define APREQ_RUN_HOOK(h,env,param,bb) (h)->hook(h,env,param,bb)</span>
00295 <span class="preprocessor"></span>
00305 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) apreq_brigade_concat(<span class="keywordtype">void</span> *env,
00306 <a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *out,
00307 <a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *in);
00308
00309
00315 APREQ_DECLARE_PARSER(apreq_parse_headers);
00316
00320 APREQ_DECLARE_PARSER(apreq_parse_urlencoded);
00321
00328 APREQ_DECLARE_PARSER(apreq_parse_multipart);
00329
00340 APREQ_DECLARE(apreq_parser_t *)
00341 apreq_make_parser(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool,
00342 const <span class="keywordtype">char</span> *enctype,
00343 <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a> (*parser) (APREQ_PARSER_ARGS),
00344 apreq_hook_t *hook,
00345 <span class="keywordtype">void</span> *ctx);
00346
00356 APREQ_DECLARE(apreq_hook_t *)
00357 apreq_make_hook(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool,
00358 <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a> (*hook) (APREQ_HOOK_ARGS),
00359 apreq_hook_t *next,
00360 <span class="keywordtype">void</span> *ctx);
00361
00362
00369 APREQ_DECLARE(<span class="keywordtype">void</span>) apreq_add_hook(apreq_parser_t *p,
00370 apreq_hook_t *h);
00371
00386 APREQ_DECLARE(apreq_parser_t *)apreq_parser(<span class="keywordtype">void</span> *env,
00387 apreq_hook_t *hook);
00388
00394 APREQ_DECLARE_HOOK(apreq_hook_disable_uploads);
00395
00396 #ifdef __cplusplus
00397 }
00398
00399 #endif
00400 #endif <span class="comment">/* APREQ_PARAMS_H */</span>
00401
00402
00403
</div></pre><div id="footer">
<p class="apache">
Copyright © 2003-2004 <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
See <a href="LICENSE.html">LICENSE</a>.</p>
<p class="menu">
<span style="color:#aaa">page generated by <a href="http://www.doxygen.org/"><code>doxygen</code></a>
version 1.3.8 on 30 Aug 2004</span>
</p>
</div>
</body>
</html>
|