Text of httpd.apache.org › apreq › docs › libapreq2 › apreq__parser_8h_source.html as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

libapreq2-2.17: include/apreq_parser.h Source File

Apache Software Foundation > HTTP Server Project > Request Library Subproject Apache HTTP Server Request Library - 2.17 include apreq_parser.h Go to the documentation of this file. 1 /* 2 ** Licensed to the Apache Software Foundation (ASF) under one or more 3 ** contributor license agreements. See the NOTICE file distributed with 4 ** this work for additional information regarding copyright ownership. 5 ** The ASF licenses this file to You under the Apache License, Version 2.0 6 ** (the "License"); you may not use this file except in compliance with 7 ** the License.

You may obtain a copy of the License at 8 ** 9 ** http://www.apache.org/licenses/LICENSE-2.0 10 ** 11 ** Unless required by applicable law or agreed to in writing, software 12 ** distributed under the License is distributed on an "AS IS" BASIS, 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ** See the License for the specific language governing permissions and 15 ** limitations under the License.

16 */ 17 18 #ifndef APREQ_PARSERS_H 19 #define APREQ_PARSERS_H 20 /* These structs are defined below */ 21 22 #include " apreq_param.h " 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif /* __cplusplus */ 27 39 typedef struct apreq_hook_t apreq_hook_t ; 40 44 typedef struct apreq_parser_t apreq_parser_t ; 45 47 #define APREQ_PARSER_ARGS apreq_parser_t *parser, \ 48 apr_table_t *t, \ 49 apr_bucket_brigade *bb 50 52 #define APREQ_HOOK_ARGS apreq_hook_t *hook, \ 53 apreq_param_t *param, \ 54 apr_bucket_brigade *bb 55 59 typedef apr_status_t (* apreq_parser_function_t )( APREQ_PARSER_ARGS ); 60 64 typedef apr_status_t (* apreq_hook_function_t )( APREQ_HOOK_ARGS ); 65 69 #define APREQ_DECLARE_PARSER(f) APREQ_DECLARE_NONSTD(apr_status_t) \ 70 f (APREQ_PARSER_ARGS) 71 75 #define APREQ_DECLARE_HOOK(f) APREQ_DECLARE_NONSTD(apr_status_t) \ 76 f (APREQ_HOOK_ARGS) 77 83 struct apreq_hook_t { 84 apreq_hook_function_t hook ; 85 apreq_hook_t * next ; 86 apr_pool_t * pool ; 87 void * ctx ; 88 }; 89 93 struct apreq_parser_t { 95 apreq_parser_function_t parser ; 97 const char * content_type ; 99 apr_pool_t * pool ; 101 apr_bucket_alloc_t * bucket_alloc ; 103 apr_size_t brigade_limit ; 105 const char * temp_dir ; 107 apreq_hook_t * hook ; 109 void * ctx ; 110 }; 111 112 123 static APR_INLINE 124 apr_status_t apreq_parser_run ( struct apreq_parser_t *psr, apr_table_t *t, 125 apr_bucket_brigade *bb) 126 { 127 return psr-> parser (psr, t, bb); 128 } 129 137 static APR_INLINE 138 apr_status_t apreq_hook_run ( struct apreq_hook_t *h, apreq_param_t *param, 139 apr_bucket_brigade *bb) 140 { 141 return h-> hook (h, param, bb); 142 } 143 144 150 APREQ_DECLARE_PARSER (apreq_parse_headers); 151 155 APREQ_DECLARE_PARSER (apreq_parse_urlencoded); 156 163 APREQ_DECLARE_PARSER (apreq_parse_multipart); 164 173 APREQ_DECLARE_PARSER (apreq_parse_generic); 174 182 APREQ_DECLARE_HOOK (apreq_hook_apr_xml_parser); 183 197 APREQ_DECLARE ( apreq_parser_t *) apreq_parser_make ( apr_pool_t *pool, 198 apr_bucket_alloc_t *ba, 199 const char *content_type, 200 apreq_parser_function_t pfn, 201 apr_size_t brigade_limit, 202 const char *temp_dir, 203 apreq_hook_t *hook, 204 void *ctx); 205 215 APREQ_DECLARE ( apreq_hook_t *) apreq_hook_make ( apr_pool_t *pool, 216 apreq_hook_function_t hook, 217 apreq_hook_t *next, 218 void *ctx); 219 220 227 APREQ_DECLARE ( apr_status_t ) apreq_parser_add_hook ( apreq_parser_t *p, 228 apreq_hook_t *h); 229 230 237 APREQ_DECLARE ( apreq_parser_function_t ) apreq_parser ( const char *enctype); 238 239 252 APREQ_DECLARE ( apr_status_t ) apreq_register_parser ( const char *enctype, 253 apreq_parser_function_t pfn); 254 255 261 APREQ_DECLARE_HOOK (apreq_hook_disable_uploads); 262 267 APREQ_DECLARE_HOOK (apreq_hook_discard_brigade); 268 272 typedef struct apreq_hook_find_param_ctx_t { 273 const char *name; 274 apreq_param_t *param; 275 apreq_hook_t *prev; 276 } apreq_hook_find_param_ctx_t ; 277 278 293 APREQ_DECLARE_HOOK (apreq_hook_find_param); 294 295 296 #ifdef __cplusplus 297 } 298 299 #endif 300 #endif /* APREQ_PARSERS_H */ APREQ_DECLARE #define APREQ_DECLARE(d) Definition: apreq.h:50 apreq_param.h Request parsing and parameter API. apreq_hook_run static APR_INLINE apr_status_t apreq_hook_run(struct apreq_hook_t *h, apreq_param_t *param, apr_bucket_brigade *bb) Definition: apreq_parser.h:138 apreq_parser_run static APR_INLINE apr_status_t apreq_parser_run(struct apreq_parser_t *psr, apr_table_t *t, apr_bucket_brigade *bb) Definition: apreq_parser.h:124 apreq_hook_make apreq_hook_t * apreq_hook_make(apr_pool_t *pool, apreq_hook_function_t hook, apreq_hook_t *next, void *ctx) apreq_parser_make apreq_parser_t * apreq_parser_make(apr_pool_t *pool, apr_bucket_alloc_t *ba, const char *content_type, apreq_parser_function_t pfn, apr_size_t brigade_limit, const char *temp_dir, apreq_hook_t *hook, void *ctx) apreq_register_parser apr_status_t apreq_register_parser(const char *enctype, apreq_parser_function_t pfn) APREQ_HOOK_ARGS #define APREQ_HOOK_ARGS Definition: apreq_parser.h:52 apreq_hook_function_t apr_status_t(* apreq_hook_function_t)(APREQ_HOOK_ARGS) Definition: apreq_parser.h:64 apreq_parser apreq_parser_function_t apreq_parser(const char *enctype) APREQ_DECLARE_PARSER #define APREQ_DECLARE_PARSER(f) Definition: apreq_parser.h:69 apreq_parser_add_hook apr_status_t apreq_parser_add_hook(apreq_parser_t *p, apreq_hook_t *h) apreq_hook_find_param_ctx_t struct apreq_hook_find_param_ctx_t apreq_hook_find_param_ctx_t APREQ_DECLARE_HOOK #define APREQ_DECLARE_HOOK(f) Definition: apreq_parser.h:75 APREQ_PARSER_ARGS #define APREQ_PARSER_ARGS Definition: apreq_parser.h:47 apreq_parser_function_t apr_status_t(* apreq_parser_function_t)(APREQ_PARSER_ARGS) Definition: apreq_parser.h:59 apr_bucket_alloc_t struct apr_bucket_alloc_t apr_bucket_alloc_t apr_status_t int apr_status_t apr_pool_t struct apr_pool_t apr_pool_t apr_table_t struct apr_table_t apr_table_t apr_bucket_brigade apreq_hook_find_param_ctx_t Definition: apreq_parser.h:272 apreq_hook_t Definition: apreq_parser.h:83 apreq_hook_t::next apreq_hook_t * next Definition: apreq_parser.h:85 apreq_hook_t::pool apr_pool_t * pool Definition: apreq_parser.h:86 apreq_hook_t::ctx void * ctx Definition: apreq_parser.h:87 apreq_hook_t::hook apreq_hook_function_t hook Definition: apreq_parser.h:84 apreq_param_t Definition: apreq_param.h:37 apreq_parser_t Definition: apreq_parser.h:93 apreq_parser_t::brigade_limit apr_size_t brigade_limit Definition: apreq_parser.h:103 apreq_parser_t::content_type const char * content_type Definition: apreq_parser.h:97 apreq_parser_t::pool apr_pool_t * pool Definition: apreq_parser.h:99 apreq_parser_t::temp_dir const char * temp_dir Definition: apreq_parser.h:105 apreq_parser_t::ctx void * ctx Definition: apreq_parser.h:109 apreq_parser_t::parser apreq_parser_function_t parser Definition: apreq_parser.h:95 apreq_parser_t::hook apreq_hook_t * hook Definition: apreq_parser.h:107 apreq_parser_t::bucket_alloc apr_bucket_alloc_t * bucket_alloc Definition: apreq_parser.h:101 Copyright © 2003-2022 The Apache Software Foundation .

See LICENSE . Generated on Sat Sep 3 2022 17:23:06 for libapreq2 by 1.9.1