Apache2
|
Request parsing and parameter API. More...
Go to the source code of this file.
Data Structures | |
struct | apreq_param_t |
Typedefs | |
typedef struct apreq_param_t | apreq_param_t |
Functions | |
apreq_param_t * | apreq_param_make (apr_pool_t *p, const char *name, const apr_size_t nlen, const char *val, const apr_size_t vlen) |
apr_status_t | apreq_param_decode (apreq_param_t **param, apr_pool_t *pool, const char *word, apr_size_t nlen, apr_size_t vlen) |
char * | apreq_param_encode (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_array_header_t * | apreq_params_as_array (apr_pool_t *p, const apr_table_t *t, const char *key) |
const char * | apreq_params_as_string (apr_pool_t *p, const apr_table_t *t, const char *key, apreq_join_t mode) |
const apr_table_t * | apreq_uploads (const apr_table_t *body, apr_pool_t *pool) |
const apreq_param_t * | apreq_upload (const apr_table_t *body, const char *name) |
Request parsing and parameter API.
typedef struct apreq_param_t apreq_param_t |
Common data structure for params and file uploads
apr_status_t apreq_param_decode | ( | apreq_param_t ** | param, |
apr_pool_t * | pool, | ||
const char * | word, | ||
apr_size_t | nlen, | ||
apr_size_t | vlen | ||
) |
Url-decodes a name=value pair into a param.
param | points to the decoded parameter on success |
pool | Pool from which the param is allocated. |
word | Start of the name=value pair. |
nlen | Length of urlencoded name. |
vlen | Length of urlencoded value. |
char* apreq_param_encode | ( | apr_pool_t * | pool, |
const apreq_param_t * | param | ||
) |
Url-encodes the param into a name-value pair.
pool | Pool which allocates the returned string. |
param | Param to encode. |
apreq_param_t* apreq_param_make | ( | apr_pool_t * | p, |
const char * | name, | ||
const apr_size_t | nlen, | ||
const char * | val, | ||
const apr_size_t | vlen | ||
) |
creates a param from name/value information
apr_array_header_t* apreq_params_as_array | ( | apr_pool_t * | p, |
const apr_table_t * | t, | ||
const char * | key | ||
) |
Returns an array of parameters (apreq_param_t *) matching the given key. The key is case-insensitive.
p | Allocates the returned array. |
t | the parameter table returned by apreq_args(), apreq_body() or apreq_params() |
key | Null-terminated search key, case insensitive. key==NULL fetches all parameters. |
const char* apreq_params_as_string | ( | apr_pool_t * | p, |
const apr_table_t * | t, | ||
const char * | key, | ||
apreq_join_t | mode | ||
) |
Returns a ", " -joined string containing all parameters for the requested key, an empty string if none are found. The key is case-insensitive.
p | Allocates the return string. |
t | the parameter table returned by apreq_args(), apreq_body() or apreq_params() |
key | Null-terminated parameter name, case insensitive. key==NULL fetches all values. |
mode | Join type- see apreq_join(). |
apr_status_t apreq_parse_query_string | ( | apr_pool_t * | pool, |
apr_table_t * | t, | ||
const char * | qs | ||
) |
Parse a url-encoded string into a param table.
pool | pool used to allocate the param data. |
t | table to which the params are added. |
qs | Query string to url-decode. |
const apreq_param_t* apreq_upload | ( | const apr_table_t * | body, |
const char * | name | ||
) |
Returns the first param in req->body which has both param->v.name matching key (case insensitive) and param->upload != NULL.
body | parameter table returned by apreq_body() or apreq_params() |
name | Parameter name. key == NULL returns first upload. |
const apr_table_t* apreq_uploads | ( | const apr_table_t * | body, |
apr_pool_t * | pool | ||
) |
Returns a table of all params in req->body with non-NULL upload brigades.
body | parameter table returned by apreq_body() or apreq_params() |
pool | Pool which allocates the table struct. |