rbhash_lookup3
Look up an entry in an rbhash.
Usage
#include <roy.h>
void * rbhash_lookup (RBHash *hash, RBuf *key);
Overview
Look up an entry in an RBHash. key is a regular RBuf. See rbhash(3) for details.
rbhash_lookup_next(3) uses the entry returned from a previous call to rbhash_lookup(3) to return the next entry in the hash table matching the same key as used in rbhash_lookup(3).
Return value
These functions return a pointer to the entry that was previously inserted into the hash with rbhash_insert(3). If no entry exists with this key, NULL is returned.
Duplicate entries
If an entry is inserted into the hash table with a key of an entry that already exists in the hash table, they will both be added and no error condition will exist. Any calls thereafter to rbhash_lookup(3) will return the last entry inserted with that key. rbhash_lookup_next(3) may be used after using rbhash_lookup(3) to return the previous entries with the same key in the hash table.
If you do not wish to have multiple entries with the same key, you must do a rbhash_lookup(3) prior to inserting the new entry.
Releases
2 releases since Debian 3.0 (Woody); the text changed 1 time.