Defines | |
| #define | APR_HASH_KEY_STRING (-1) |
Typedefs | |
| typedef struct apr_hash_t | apr_hash_t |
| typedef struct apr_hash_index_t | apr_hash_index_t |
| typedef unsigned int(* | apr_hashfunc_t )(const char *key, apr_ssize_t *klen) |
| typedef int( | apr_hash_do_callback_fn_t )(void *rec, const void *key, apr_ssize_t klen, const void *value) |
Functions | |
| unsigned int | apr_hashfunc_default (const char *key, apr_ssize_t *klen) |
| apr_hash_t * | apr_hash_make (apr_pool_t *pool) |
| apr_hash_t * | apr_hash_make_custom (apr_pool_t *pool, apr_hashfunc_t hash_func) |
| apr_hash_t * | apr_hash_copy (apr_pool_t *pool, const apr_hash_t *h) |
| void | apr_hash_set (apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val) |
| void * | apr_hash_get (apr_hash_t *ht, const void *key, apr_ssize_t klen) |
| apr_hash_index_t * | apr_hash_first (apr_pool_t *p, apr_hash_t *ht) |
| apr_hash_index_t * | apr_hash_next (apr_hash_index_t *hi) |
| void | apr_hash_this (apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val) |
| unsigned int | apr_hash_count (apr_hash_t *ht) |
| void | apr_hash_clear (apr_hash_t *ht) |
| apr_hash_t * | apr_hash_overlay (apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base) |
| apr_hash_t * | apr_hash_merge (apr_pool_t *p, const apr_hash_t *h1, const apr_hash_t *h2, void *(*merger)(apr_pool_t *p, const void *key, apr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data), const void *data) |
| int | apr_hash_do (apr_hash_do_callback_fn_t *comp, void *rec, const apr_hash_t *ht) |
| apr_pool_t * | apr_hash_pool_get (const apr_hash_t *thehash) |
| #define APR_HASH_KEY_STRING (-1) |
When passing a key to apr_hash_set or apr_hash_get, this value can be passed to indicate a string-valued key, and have apr_hash compute the length automatically.
| typedef int( apr_hash_do_callback_fn_t)(void *rec, const void *key, apr_ssize_t klen, const void *value) |
Declaration prototype for the iterator callback function of apr_hash_do().
| rec | The data passed as the first argument to apr_hash_[v]do()
|
| typedef struct apr_hash_index_t apr_hash_index_t |
Abstract type for scanning hash tables.
| typedef struct apr_hash_t apr_hash_t |
Abstract type for hash tables.
| typedef unsigned int(* apr_hashfunc_t)(const char *key, apr_ssize_t *klen) |
Callback functions for calculating hash values.
| key | The key.
|
| void apr_hash_clear | ( | apr_hash_t * | ht | ) |
Clear any key/value pairs in the hash table.
| ht | The hash table |
| apr_hash_t* apr_hash_copy | ( | apr_pool_t * | pool, | |
| const apr_hash_t * | h | |||
| ) |
Make a copy of a hash table
| pool | The pool from which to allocate the new hash table
|
| unsigned int apr_hash_count | ( | apr_hash_t * | ht | ) |
Get the number of key/value pairs in the hash table.
| ht | The hash table
|
| int apr_hash_do | ( | apr_hash_do_callback_fn_t * | comp, | |
| void * | rec, | |||
| const apr_hash_t * | ht | |||
| ) |
Iterate over a hash table running the provided function once for every element in the hash table. The
| comp | function will be invoked for every element in the hash table. | |||||||
| comp | The function to run
|
| apr_hash_index_t* apr_hash_first | ( | apr_pool_t * | p, | |
| apr_hash_t * | ht | |||
| ) |
Start iterating over the entries in a hash table.
| p | The pool to allocate the apr_hash_index_t iterator. If this pool is NULL, then an internal, non-thread-safe iterator is used.
|
| void* apr_hash_get | ( | apr_hash_t * | ht, | |
| const void * | key, | |||
| apr_ssize_t | klen | |||
| ) |
Look up the value associated with a key in a hash table.
| ht | The hash table
|
| apr_hash_t* apr_hash_make | ( | apr_pool_t * | pool | ) |
Create a hash table.
| pool | The pool to allocate the hash table out of
|
| apr_hash_t* apr_hash_make_custom | ( | apr_pool_t * | pool, | |
| apr_hashfunc_t | hash_func | |||
| ) |
Create a hash table with a custom hash function
| pool | The pool to allocate the hash table out of
|
| apr_hash_t* apr_hash_merge | ( | apr_pool_t * | p, | |
| const apr_hash_t * | h1, | |||
| const apr_hash_t * | h2, | |||
| void *(*)(apr_pool_t *p, const void *key, apr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data) | merger, | |||
| const void * | data | |||
| ) |
Merge two hash tables into one new hash table. If the same key is present in both tables, call the supplied merge function to produce a merged value for the key in the new table. Both hash tables must use the same hash function.
| p | The pool to use for the new hash table
|
| apr_hash_index_t* apr_hash_next | ( | apr_hash_index_t * | hi | ) |
Continue iterating over the entries in a hash table.
| hi | The iteration state
|
| apr_hash_t* apr_hash_overlay | ( | apr_pool_t * | p, | |
| const apr_hash_t * | overlay, | |||
| const apr_hash_t * | base | |||
| ) |
Merge two hash tables into one new hash table. The values of the overlay hash override the values of the base if both have the same key. Both hash tables must use the same hash function.
| p | The pool to use for the new hash table
|
| apr_pool_t* apr_hash_pool_get | ( | const apr_hash_t * | thehash | ) |
Get a pointer to the pool which the hash table was created in
| void apr_hash_set | ( | apr_hash_t * | ht, | |
| const void * | key, | |||
| apr_ssize_t | klen, | |||
| const void * | val | |||
| ) |
Associate a value with a key in a hash table.
| ht | The hash table
|
| void apr_hash_this | ( | apr_hash_index_t * | hi, | |
| const void ** | key, | |||
| apr_ssize_t * | klen, | |||
| void ** | val | |||
| ) |
Get the current entry's details from the iteration state.
| hi | The iteration state
|
| unsigned int apr_hashfunc_default | ( | const char * | key, | |
| apr_ssize_t * | klen | |||
| ) |
The default hash function.
1.6.3