GME
13
|
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 | |
APR_DECLARE_NONSTD (unsigned int) apr_hashfunc_default(const char *key | |
APR_DECLARE (apr_hash_t *) apr_hash_make(apr_pool_t *pool) | |
APR_DECLARE (void) apr_hash_set(apr_hash_t *ht | |
APR_DECLARE (void *) apr_hash_get(apr_hash_t *ht | |
APR_DECLARE (apr_hash_index_t *) apr_hash_first(apr_pool_t *p | |
APR_DECLARE (unsigned int) apr_hash_count(apr_hash_t *ht) | |
APR_DECLARE (int) apr_hash_do(apr_hash_do_callback_fn_t *comp | |
APR_POOL_DECLARE_ACCESSOR (hash) | |
Variables | |
apr_ssize_t * | klen |
apr_hashfunc_t | hash_func |
const apr_hash_t * | h |
const void * | key |
const void apr_ssize_t const void * | val |
apr_hash_t * | ht |
const apr_hash_t * | overlay |
const apr_hash_t const apr_hash_t * | base |
const apr_hash_t * | h1 |
const apr_hash_t const apr_hash_t * | h2 |
const apr_hash_t const apr_hash_t 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 apr_hash_t const apr_hash_t void *(*) const void | data ) |
void * | rec |
#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.
Definition at line 47 of file apr_hash.h.
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() |
key | The key from this iteration of the hash table |
klen | The key length from this iteration of the hash table |
value | The value from this iteration of the hash table |
Definition at line 231 of file apr_hash.h.
typedef struct apr_hash_index_t apr_hash_index_t |
Abstract type for scanning hash tables.
Definition at line 57 of file apr_hash.h.
typedef struct apr_hash_t apr_hash_t |
Abstract type for hash tables.
Definition at line 52 of file apr_hash.h.
typedef unsigned int(* apr_hashfunc_t)(const char *key, apr_ssize_t *klen) |
Callback functions for calculating hash values.
key | The key. |
klen | The length of the key, or APR_HASH_KEY_STRING to use the string length. If APR_HASH_KEY_STRING then returns the actual key length. |
Definition at line 65 of file apr_hash.h.
APR_DECLARE | ( | apr_hash_t * | ) |
Create a hash table.
pool | The pool to allocate the hash table out of |
Create a hash table with a custom hash function
pool | The pool to allocate the hash table out of |
hash_func | A custom hash function. |
Make a copy of a hash table
pool | The pool from which to allocate the new hash table |
h | The hash table to clone |
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 |
overlay | The table to add to the initial table |
base | The table that represents the initial values of the new table |
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 |
h1 | The first of the tables to merge |
h2 | The second of the tables to merge |
merger | A callback function to merge values, or NULL to make values from h1 override values from h2 (same semantics as apr_hash_overlay()) |
data | Client data to pass to the merger function |
APR_DECLARE | ( | void | ) |
Associate a value with a key in a hash table.
ht | The hash table |
key | Pointer to the key |
klen | Length of the key. Can be APR_HASH_KEY_STRING to use the string length. |
val | Value to associate with the key |
Get the current entry's details from the iteration state.
hi | The iteration state |
key | Return pointer for the pointer to the key. |
klen | Return pointer for the key length. |
val | Return pointer for the associated value. |
Clear any key/value pairs in the hash table.
ht | The hash table |
APR_DECLARE | ( | void * | ) |
Look up the value associated with a key in a hash table.
ht | The hash table |
key | Pointer to the key |
klen | Length of the key. Can be APR_HASH_KEY_STRING to use the string length. |
APR_DECLARE | ( | apr_hash_index_t * | ) |
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. |
ht | The hash table |
int sum_values(apr_pool_t *p, apr_hash_t *ht) { apr_hash_index_t *hi; void *val; int sum = 0; for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi, NULL, NULL, &val); sum += *(int *)val; } return sum; }
Continue iterating over the entries in a hash table.
hi | The iteration state |
APR_DECLARE | ( | unsigned | int | ) |
Get the number of key/value pairs in the hash table.
ht | The hash table |
APR_DECLARE | ( | int | ) |
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 |
rec | The data to pass as the first argument to the function |
ht | The hash table to iterate over |
APR_DECLARE_NONSTD | ( | unsigned | int | ) | const |
The default hash function.
Get a pointer to the pool which the hash table was created in
Definition at line 192 of file apr_hash.h.
const apr_hash_t const apr_hash_t void*(*) const void data) |
Definition at line 218 of file apr_hash.h.
const apr_hash_t* h |
Definition at line 97 of file apr_hash.h.
const apr_hash_t* h1 |
Definition at line 210 of file apr_hash.h.
const apr_hash_t const apr_hash_t* h2 |
Definition at line 210 of file apr_hash.h.
Definition at line 87 of file apr_hash.h.
void const apr_hash_t * ht |
Definition at line 147 of file apr_hash.h.
const void** key |
Definition at line 107 of file apr_hash.h.
const void apr_ssize_t * klen |
Definition at line 71 of file apr_hash.h.
const apr_hash_t const apr_hash_t void*(* merger)(apr_pool_t *p, const void *key, apr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data) |
Definition at line 212 of file apr_hash.h.
const apr_hash_t* overlay |
Definition at line 192 of file apr_hash.h.
void const apr_table_t void * rec |
Definition at line 248 of file apr_hash.h.
const void apr_ssize_t void** val |
Definition at line 107 of file apr_hash.h.