Apache HTTP Server Request Library
#include "apreq.h"
Go to the source code of this file.
Data Structures | |
struct | apreq_param_t |
struct | apreq_request_t |
struct | apreq_hook_t |
struct | apreq_parser_t |
Defines | |
#define | apreq_value_to_param(ptr) apreq_attr_to_type(apreq_param_t, v, ptr) |
#define | apreq_param_name(p) ((p)->v.name) |
#define | apreq_param_value(p) ((p)->v.data) |
#define | apreq_param_info(p) ((p)->info) |
#define | apreq_param_brigade(p) ((p)->bb ? apreq_copy_brigade((p)->bb) : NULL) |
#define | APREQ_PARSER_ARGS |
#define | APREQ_HOOK_ARGS |
#define | APREQ_DECLARE_PARSER(f) |
#define | APREQ_DECLARE_HOOK(f) |
#define | APREQ_RUN_PARSER(psr, env, t, bb) (psr)->parser(psr,env,t,bb) |
#define | APREQ_RUN_HOOK(h, env, param, bb) (h)->hook(h,env,param,bb) |
Typedefs | |
typedef apreq_param_t | apreq_param_t |
typedef apreq_hook_t | apreq_hook_t |
typedef apreq_parser_t | apreq_parser_t |
typedef apreq_request_t | apreq_request_t |
Functions | |
apreq_param_t * | apreq_make_param (apr_pool_t *p, const char *name, const apr_size_t nlen, const char *val, const apr_size_t vlen) |
apreq_request_t * | apreq_request (void *env, const char *qs) |
apreq_param_t * | apreq_param (const apreq_request_t *req, const char *name) |
apr_table_t * | apreq_params (apr_pool_t *p, const apreq_request_t *req) |
apr_array_header_t * | apreq_params_as_array (apr_pool_t *p, apreq_request_t *req, const char *key) |
const char * | apreq_params_as_string (apr_pool_t *p, apreq_request_t *req, const char *key, apreq_join_t mode) |
apreq_param_t * | apreq_decode_param (apr_pool_t *pool, const char *word, const apr_size_t nlen, const apr_size_t vlen) |
char * | apreq_encode_param (apr_pool_t *pool, const apreq_param_t *param) |
apr_status_t | apreq_parse_query_string (apr_pool_t *pool, apr_table_t *t, const char *qs) |
apr_status_t | apreq_parse_request (apreq_request_t *req, apr_bucket_brigade *bb) |
apr_table_t * | apreq_uploads (apr_pool_t *pool, const apreq_request_t *req) |
apreq_param_t * | apreq_upload (const apreq_request_t *req, const char *key) |
apr_status_t | apreq_brigade_concat (void *env, apr_bucket_brigade *out, apr_bucket_brigade *in) |
APREQ_DECLARE_PARSER (apreq_parse_headers) | |
APREQ_DECLARE_PARSER (apreq_parse_urlencoded) | |
APREQ_DECLARE_PARSER (apreq_parse_multipart) | |
apreq_parser_t * | apreq_make_parser (apr_pool_t *pool, const char *enctype, apr_status_t(*parser)(APREQ_PARSER_ARGS), apreq_hook_t *hook, void *ctx) |
apreq_hook_t * | apreq_make_hook (apr_pool_t *pool, apr_status_t(*hook)(APREQ_HOOK_ARGS), apreq_hook_t *next, void *ctx) |
void | apreq_add_hook (apreq_parser_t *p, apreq_hook_t *h) |
apreq_parser_t * | apreq_parser (void *env, apreq_hook_t *hook) |
APREQ_DECLARE_HOOK (apreq_hook_disable_uploads) |
|
Value: Declares an API hook. |
|
Value: Declares a API parser. |
|
Value: Hook arguments |
|
Value: Parser arguments. |
|
Run the hook with the current parameter and the incoming bucket brigade. The hook may modify the brigade if necessary. Once all hooks have completed, the contents of the brigade will be added to the parameter's bb attribute. |
|
Parse the incoming brigade into a table. Parsers normally consume all the buckets of the brigade during parsing. However parsers may leave "rejected" data in the brigade, even during a successful parse, so callers may need to clean up the brigade themselves (in particular, rejected buckets should not be passed back to the parser again).
|
|
accessor macros |
|
Common data structure for params and file uploads |
|
Structure which manages the request data. |
|
Add a new hook to the end of the parser's hook list.
|
|
Concatenates the brigades, spooling large brigades into a tempfile bucket according to the environment's max_brigade setting- see apreq_env_max_brigade().
|
|
Returns APR_EGENERAL. Effectively disables mfd parser if a file-upload field is present. |
|
Rfc2388 multipart/form-data parser. It will reject any buckets representing preamble and postamble text (this is normal behavior, not an error condition). See APREQ_RUN_PARSER for more info on rejected data. |
|
Rfc2396 application/x-www-form-urlencoded parser. |
|
Rfc822 Header parser. It will reject all data after the first CRLF CRLF sequence (an empty line). See APREQ_RUN_PARSER for more info on rejected data. |
|
Url-decodes a name=value pair into a param.
|
|
Url-encodes the param into a name-value pair.
|
|
Construct a hook.
|
|
creates a param from name/value information |
|
Construct a parser.
|
|
Returns the first parameter value with the desired name, NULL if none found. The name is case-insensitive.
|
|
Returns a table containing key-value pairs for the full request (args + body).
|
|
Returns an array of parameters (apreq_param_t *) matching the given key. The key is case-insensitive.
|
|
Returns a ", " -separated string containing all parameters for the requested key, NULL if none are found. The key is case-insensitive.
|
|
Parse a url-encoded string into a param table.
|
|
Parse a brigade as incoming POST data.
|
|
Create the default parser associated with the current request's Content-Type (if possible).
|
|
Creates an apreq_request_t object.
|
|
Returns the first param in req->body which has both param->v.name matching key and param->bb != NULL.
|
|
Returns a table of all params in req->body with non-NULL bucket brigades.
|