Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

Request params
[libapreq2]


Data Structures

struct  apreq_param_t
struct  apreq_request_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_status(p)   ((p)->v.status)
#define apreq_param_brigade(p)   ((p)->bb ? apreq_copy_brigade((p)->bb) : NULL)
#define apreq_params_as_string(req, key, pool, mode)   apreq_join(pool, ", ", apreq_params(req,pool,key), mode)

Typedefs

typedef apreq_param_t apreq_param_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 *pool, const apreq_request_t *req)
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_request_config (apreq_request_t *req, const char *attr, apr_size_t alen, const char *val, apr_size_t vlen)

Define Documentation

#define apreq_params_as_string (  req,
key,
pool,
mode   )     apreq_join(pool, ", ", apreq_params(req,pool,key), mode)
 

Returns a ", " -separated string containing all parameters for the requested key, NULL if none found. The key is case-insensitive.

Parameters:
req The current apreq_request_t object.
key Nul-terminated search key. Returns the first table value if NULL.
Remarks:
Also parses the request as necessary.

#define apreq_value_to_param (  ptr   )     apreq_attr_to_type(apreq_param_t, v, ptr)
 

accessor macros


Typedef Documentation

typedef struct apreq_param_t apreq_param_t
 

Common data structure for params and file uploads

typedef struct apreq_request_t apreq_request_t
 

Structure which manages the request data.


Function Documentation

apreq_param_t* apreq_decode_param (  apr_pool_t *  pool,
const char *  word,
const apr_size_t  nlen,
const 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.
Remarks:
Unless vlen == 0, this function assumes there is exactly one character ('=') which separates the pair.

char* apreq_encode_param (  apr_pool_t *  pool,
const apreq_param_t *  param
) 
 

Url-encodes the param into a name-value pair.

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
) 
 

creates a param from name/value information

apreq_param_t* apreq_param (  const apreq_request_t *  req,
const char *  name
) 
 

Returns the first parameter value for the requested key, NULL if none found. The key is case-insensitive.

Parameters:
req The current apreq_request_t object.
key Nul-terminated search key. Returns the first table value if NULL.
Remarks:
Also parses the request as necessary.

apr_table_t* apreq_params (  apr_pool_t *  p,
const apreq_request_t *  req
) 
 

Returns all parameters for the requested key, NULL if none found. The key is case-insensitive.

Parameters:
req The current apreq_request_t object.
key Nul-terminated search key. Returns the first table value if NULL.
Remarks:
Also parses the request as necessary.

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:
pool pool used to allocate the param data.
table table to which the params are added.
qs Query string to url-decode.
Remarks:
This function uses [&;] as the set of tokens to delineate words, and will treat a word w/o '=' as a name-value pair with value-length = 0.

apr_status_t apreq_parse_request (  apreq_request_t *  req,
apr_bucket_brigade *  bb
) 
 

Parse a brigade as incoming POST data.

Parameters:
req Current request.
bb Brigade to parse. See remarks below.
Returns:
APR_INCOMPLETE if the parse is incomplete, APR_SUCCESS if the parser is finished (saw eos), unrecoverable error value otherwise.
Remarks:
Polymorphic buckets (file, pipe, socket, etc.) will generate new buckets during parsing, which may cause problems with the configuration checks. To be on the safe side, the caller should avoid placing such buckets in the passed brigade.

apreq_request_t* apreq_request (  void *  env,
const char *  qs
) 
 

default parser configuration

< limit on POST data size

< limit on brigade size

< maximum number of form fields

< maximum amount of prefetch data

apreq_param_t* apreq_upload (  const apreq_request_t *  req,
const char *  key
) 
 

Returns the first param in req->body which has both param->v.name matching key and param->bb != NULL.

apr_table_t* apreq_uploads (  apr_pool_t *  pool,
const apreq_request_t *  req
) 
 

Returns a table of all params in req->body with non-NULL bucket brigades.

Parameters:
pool Pool which allocates the table struct.
req Current request.


Generated on Sat Nov 15 23:04:50 2003 for libapreq2 by doxygen1.3