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.
Remarks:
apr_hash will use strlen(key) for the length. The NUL terminator is not included in the hash value (why throw a constant in?). Since the hash table merely references the provided key (rather than copying it), apr_hash_this() will return the NUL-term'd key.
Declaration prototype for the iterator callback function of apr_hash_do().
Parameters:
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
Remarks:
Iteration continues while this callback function returns non-zero. To export the callback function for apr_hash_do() it must be declared in the _NONSTD convention.
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
Returns:
The iteration state
Remarks:
There is no restriction on adding or deleting hash entries during an iteration (although the results may be unpredictable unless all you do is delete the current entry) and multiple iterations can be in progress at the same time.
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.
Parameters:
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
Returns:
A new hash table containing all of the data from the two passed in
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.
Parameters:
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
Returns:
A new hash table containing all of the data from the two passed in