Apache HTTP Server Request Library

Module API. More...
Go to the source code of this file.
| Data Structures | |
| struct | apreq_handle_t | 
| struct | apreq_module_t | 
| Vtable describing the necessary module functions.  More... | |
| Macros | |
| #define | APREQ_MODULE(pre, mmn) | 
| #define | apreq_cookie(req, name) apreq_jar_get(req, name) | 
| Typedefs | |
| typedef struct apreq_handle_t | apreq_handle_t | 
| typedef struct apreq_module_t | apreq_module_t | 
| Vtable describing the necessary module functions. | |
| Functions | |
| static APR_INLINE unsigned | apreq_module_status_is_error (apr_status_t s) | 
| static APR_INLINE apr_status_t | apreq_jar (apreq_handle_t *req, const apr_table_t **t) | 
| static APR_INLINE apr_status_t | apreq_args (apreq_handle_t *req, const apr_table_t **t) | 
| static APR_INLINE apr_status_t | apreq_body (apreq_handle_t *req, const apr_table_t **t) | 
| static APR_INLINE apreq_cookie_t * | apreq_jar_get (apreq_handle_t *req, const char *name) | 
| static APR_INLINE apreq_param_t * | apreq_args_get (apreq_handle_t *req, const char *name) | 
| static APR_INLINE apreq_param_t * | apreq_body_get (apreq_handle_t *req, const char *name) | 
| static APR_INLINE apr_status_t | apreq_parser_get (apreq_handle_t *req, const apreq_parser_t **parser) | 
| static APR_INLINE apr_status_t | apreq_parser_set (apreq_handle_t *req, apreq_parser_t *parser) | 
| static APR_INLINE apr_status_t | apreq_hook_add (apreq_handle_t *req, apreq_hook_t *hook) | 
| static APR_INLINE apr_status_t | apreq_brigade_limit_set (apreq_handle_t *req, apr_size_t bytes) | 
| static APR_INLINE apr_status_t | apreq_brigade_limit_get (apreq_handle_t *req, apr_size_t *bytes) | 
| static APR_INLINE apr_status_t | apreq_read_limit_set (apreq_handle_t *req, apr_uint64_t bytes) | 
| static APR_INLINE apr_status_t | apreq_read_limit_get (apreq_handle_t *req, apr_uint64_t *bytes) | 
| static APR_INLINE apr_status_t | apreq_temp_dir_set (apreq_handle_t *req, const char *path) | 
| static APR_INLINE apr_status_t | apreq_temp_dir_get (apreq_handle_t *req, const char **path) | 
| apreq_handle_t * | apreq_handle_cgi (apr_pool_t *pool) | 
| apreq_handle_t * | apreq_handle_custom (apr_pool_t *pool, const char *query_string, const char *cookie, apreq_parser_t *parser, apr_uint64_t read_limit, apr_bucket_brigade *in) | 
| apreq_param_t * | apreq_param (apreq_handle_t *req, const char *key) | 
| apr_table_t * | apreq_params (apreq_handle_t *req, apr_pool_t *p) | 
| apr_table_t * | apreq_cookies (apreq_handle_t *req, apr_pool_t *p) | 
Module API.
| #define apreq_cookie | ( | req, | |
| name | |||
| ) | apreq_jar_get(req, name) | 
Find the first cookie with the specified name. The match is case-insensitive.
| req | request handle. | 
| name | desired cookie name | 
| #define APREQ_MODULE | ( | pre, | |
| mmn | |||
| ) | 
Convenience macro for defining a module by mapping a function prefix to an associated apreq_module_t structure.
| pre | Prefix to define new module. All attributes of the apreq_module_t struct are defined with this as their prefix. The generated struct is named by appending "_module" to the prefix. | 
| mmn | Magic number (i.e. version number) of this module. | 
| typedef struct apreq_handle_t apreq_handle_t | 
An apreq handle associated with a module. The structure may have variable size, because the module may append its own data structures after it.
| 
 | static | 
Expose the parsed "query string" associated to this handle.
| req | The request handle | 
| t | The resulting table, which will either be NULL or a valid table object on return. | 
| 
 | static | 
Fetch the first query string param with the given name.
| req | The request handle | 
| name | Case-insensitive param name. | 
| 
 | static | 
Expose the parsed "request body" associated to this handle.
| req | The request handle | 
| t | The resulting table, which will either be NULL or a valid table object on return. | 
| 
 | static | 
Fetch the first body param with the given name.
| req | The request handle | 
| name | Case-insensitive cookie name. | 
| 
 | static | 
Get the active brigade limit.
| req | The handle. | 
| bytes | Pointer to resulting (current) limit. | 
| 
 | static | 
Set the active brigade limit.
| req | The handle. | 
| bytes | New limit to use. | 
| apr_table_t* apreq_cookies | ( | apreq_handle_t * | req, | 
| apr_pool_t * | p | ||
| ) | 
Returns a table containing all request cookies.
| req | the apreq request handle | 
| p | Allocates the returned table. | 
| apreq_handle_t* apreq_handle_cgi | ( | apr_pool_t * | pool | ) | 
Create an apreq handle which is suitable for a CGI program. It reads input from stdin and writes output to stdout.
| pool | Pool associated to this handle. | 
| apreq_handle_t* apreq_handle_custom | ( | apr_pool_t * | pool, | 
| const char * | query_string, | ||
| const char * | cookie, | ||
| apreq_parser_t * | parser, | ||
| apr_uint64_t | read_limit, | ||
| apr_bucket_brigade * | in | ||
| ) | 
Create a custom apreq handle which knows only some static values. Useful if you want to test the parser code or if you have got data from a custom source (neither Apache 2 nor CGI).
| pool | allocates the parse data, | 
| query_string | parsed into args table | 
| cookie | value of the request "Cookie" header | 
| parser | parses the request body | 
| read_limit | maximum bytes to read from the body | 
| in | brigade containing the request body | 
| 
 | static | 
Add a parser hook for this request.
| req | The request handle | 
| hook | Hook to add. | 
| 
 | static | 
Expose the parsed "cookie" header associated to this handle.
| req | The request handle | 
| t | The resulting table, which will either be NULL or a valid table object on return. | 
| 
 | static | 
Fetch the first cookie with the given name.
| req | The request handle | 
| name | Case-insensitive cookie name. | 
| 
 | static | 
Defines the module-specific status codes which are commonly considered to be non-fatal.
| s | status code returned by an apreq_module_t method. | 
| apreq_param_t* apreq_param | ( | apreq_handle_t * | req, | 
| const char * | key | ||
| ) | 
Find the first query string parameter or body parameter with the specified name. The match is case-insensitive.
| req | request handle. | 
| key | desired parameter name | 
| apr_table_t* apreq_params | ( | apreq_handle_t * | req, | 
| apr_pool_t * | p | ||
| ) | 
Returns a table containing key-value pairs for the full request (args + body).
| req | request handle | 
| p | allocates the returned table. | 
| 
 | static | 
Fetch the active body parser.
| req | The request handle | 
| parser | Points to the active parser on return. | 
| 
 | static | 
Set the body parser for this request.
| req | The request handle | 
| parser | New parser to use. | 
| 
 | static | 
Get the active read limit.
| req | The request handle. | 
| bytes | Pointer to resulting (current) limit. | 
| 
 | static | 
Set the active read limit.
| req | The handle. | 
| bytes | New limit to use. | 
| 
 | static | 
Get the active temp directory.
| req | The handle. | 
| path | Resulting path to temp dir. | 
| 
 | static | 
Set the active temp directory.
| req | The handle. | 
| path | New path to use; may be NULL. |