#include "apr.h"
#include "apr_pools.h"
#include "apr_tables.h"
Go to the source code of this file.
Macros | |
#define | PAA_UTIL_GLOBAL |
#define | APR_PAA_ERROR_START (APR_OS_START_USERERR + 4000) |
#define | APR_PAA_MODULE_START (APR_PAA_ERROR_START + 0) |
#define | APR_PAA_CACHE_START (APR_PAA_ERROR_START + 50) |
#define | APR_PAA_HTTP_START (APR_PAA_ERROR_START + 100) |
Functions | |
apr_status_t | paa_util_parse_header_value (const char *header_value, apr_pool_t *pool, apr_array_header_t **output) |
apr_status_t | paa_util_parse_header_space_values (const char *header_value, apr_pool_t *pool, apr_array_header_t **output) |
apr_status_t | paa_util_parse_header_map (const char *header_value, apr_pool_t *pool, apr_table_t **output) |
apr_status_t | paa_util_parse_header (const char *header, size_t len, apr_pool_t *pool, char **name, char **value) |
char * | paa_util_trim_whitespace (char *input) |
void | paa_util_secure_erase (void *buffer, size_t buflen) |
const char * | paa_util_apr_table_getm (apr_pool_t *p, const apr_table_t *t, const char *key, char delim) |
int | paa_util_getpid () |
Header for SDK util functions.
Also, for the convenience of SDK consumers, common HTTP methods and header names are exposed.
#define APR_PAA_CACHE_START (APR_PAA_ERROR_START + 50) |
Start of error codes for the paa_cache interface
#define APR_PAA_ERROR_START (APR_OS_START_USERERR + 4000) |
Extensions to APR's error codes for the PAA SDK
#define APR_PAA_HTTP_START (APR_PAA_ERROR_START + 100) |
Start of error codes for the paa_http_client interface
#define APR_PAA_MODULE_START (APR_PAA_ERROR_START + 0) |
Start of error codes for the functions in paa.h
#define PAA_UTIL_GLOBAL |
Macros for exporting/importing global constants appropriately when building with MSVC
const char* paa_util_apr_table_getm | ( | apr_pool_t * | p, |
const apr_table_t * | t, | ||
const char * | key, | ||
char | delim | ||
) |
Combines multiple values with the same key from the specified table into a single string separated by the delimiter
Note: This is a local version of apr_table_getm to allow use with versions of APR that do not contain this function.
p | the pool in which to allocate data if necessary |
t | the table |
key | the key for the values |
delim | the delimiter for the values |
int paa_util_getpid | ( | ) |
Get the current process id in a cross-platform way
apr_status_t paa_util_parse_header | ( | const char * | header, |
size_t | len, | ||
apr_pool_t * | pool, | ||
char ** | name, | ||
char ** | value | ||
) |
Parses a header into its key and value.
header | the header (need not be null-terminated) |
len | the length of the string |
pool | the pool in which to allocate the strings |
name | the header name, allocated in the specified pool |
value | the header value, allocated in the specified pool |
apr_status_t paa_util_parse_header_map | ( | const char * | header_value, |
apr_pool_t * | pool, | ||
apr_table_t ** | output | ||
) |
Parse the header value into a map, where entries are separated by semicolons (;) and key-value pairs are separated by equal signs (=).
This function assumes the specified header value doesn't contain any subvalues
header_value | the header value to parse |
pool | the pool in which to allocate the strings |
output | the table of strings |
apr_status_t paa_util_parse_header_space_values | ( | const char * | header_value, |
apr_pool_t * | pool, | ||
apr_array_header_t ** | output | ||
) |
Parses a header value into distinct subvalues that are separated by spaces.
This function assumes the specified header value doesn't contain any subvalues
header_value | the header value to parse |
pool | the pool in which to allocate the strings |
output | the table of strings |
apr_status_t paa_util_parse_header_value | ( | const char * | header_value, |
apr_pool_t * | pool, | ||
apr_array_header_t ** | output | ||
) |
Parse a header value into distinct subvalues that are separated by commas, according to the HTTP spec.
header_value | the header value to parse |
pool | the pool in which to allocate the strings |
output | an array of strings |
void paa_util_secure_erase | ( | void * | buffer, |
size_t | buflen | ||
) |
Securely erase memory and avoid compiler optimizations
buffer | the buffer to erase |
buflen | the buffer length |
char* paa_util_trim_whitespace | ( | char * | input | ) |
Trims the whitespace for a string. This function assumes that the input has been allocated in a pool and therefore, the output can be returned and assigned to the input without a memory leak.
input | the input string |