man rhash_lookup (Fonctions bibliothèques) - look up an entry in an RHash. rhash_lookup_next - look up more records with the same key.
NAME
rhash_lookup - look up an entry in an RHash. rhash_lookup_next - look up more records with the same key.
SYNOPSIS
#include <roy.h>
void * rhash_lookup (RHash *hash, void *key); void * rhash_lookup_next (RHash *hash, void *key, void *prev_entry);
DESCRIPTION
Look up an entry in an RHash. key is of the type as defined by the compare and hash functions provied at RHash creation time. See rhash(3) for details.
rhash_lookup_next(3) uses the entry returned from a previous call to rhash_lookup(3) to return the next entry in the hash table matching the same key as used in rhash_lookup(3).
RETURN VALUE
These functions return a pointer to the entry that was previously inserted into the hash with rhash_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 rhash_lookup(3) will return the last entry inserted with that key. rhash_lookup_next(3) may be used after using rhash_lookup(3) to return the previously 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 rhash_lookup(3) prior to inserting the new entry.
SEE ALSO
rhash(3), rhash_entry_getkey(3), rhash_entry_setkey(3), rhash_free(3), rhash_insert(3), rhash_len(3), rhash_lookup_next(3), rhash_new(3), rhash_remove(3), rhash_remove_entry(3), roy(3)