apreq_param.h(3)
| include/apreq_param.h(3) | libapreq2 | include/apreq_param.h(3) |
NAME
include/apreq_param.h - Request parsing and parameter API.
SYNOPSIS
#include 'apreq.h'
#include 'apr_buckets.h'
Data Structures
struct apreq_param_t
Typedefs
typedef struct apreq_param_t apreq_param_t
Functions
static APR_INLINE unsigned apreq_param_is_tainted (const
apreq_param_t *p)
static APR_INLINE void apreq_param_tainted_on (apreq_param_t *p)
static APR_INLINE void apreq_param_tainted_off (apreq_param_t
*p)
static APR_INLINE apreq_charset_t apreq_param_charset_set
(apreq_param_t *p, apreq_charset_t c)
static APR_INLINE apreq_charset_t apreq_param_charset_get
(apreq_param_t *p)
static APR_INLINE apreq_param_t * apreq_value_to_param (const
char *val)
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)
Detailed Description
Request parsing and parameter API.
Typedef Documentation
typedef struct apreq_param_t apreq_param_t
Common data structure for params and file uploads
Function Documentation
static APR_INLINE apreq_charset_t apreq_param_charset_get (apreq_param_t * p) [static]
Gets the character encoding for this parameter.
static APR_INLINE apreq_charset_t apreq_param_charset_set (apreq_param_t * p, apreq_charset_t c) [static]
Sets the character encoding for this parameter.
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.
Parameters
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.
Returns
APREQ_ERROR_BADSEQ or APREQ_ERROR_BADCHAR on malformed input.
Remarks
char* apreq_param_encode (apr_pool_t * pool, const apreq_param_t * param)
Url-encodes the param into a name-value pair.
Parameters
param Param to encode.
Returns
static APR_INLINE unsigned apreq_param_is_tainted (const apreq_param_t * p) [static]
Returns
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
static APR_INLINE void apreq_param_tainted_off (apreq_param_t * p) [static]
Turns off the taint flag.
static APR_INLINE void apreq_param_tainted_on (apreq_param_t * p) [static]
Sets the tainted flag.
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.
Parameters
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.
Returns
Remarks
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.
Parameters
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().
Returns
Remarks
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.
Parameters
t table to which the params are added.
qs Query string to url-decode.
Returns
Remarks
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.
Parameters
name Parameter name. key == NULL returns first upload.
Returns
Remarks
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.
Parameters
pool Pool which allocates the table struct.
Returns
Remarks
static APR_INLINE apreq_param_t* apreq_value_to_param (const char * val) [static]
Upgrades args and body table values to apreq_param_t structs.
Author
Generated automatically by Doxygen for libapreq2 from the source code.
| Wed Mar 10 2021 | Version 2.16 |
