---
name: "rhash_lookup"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/rhash_lookup"
---

# rhash\_lookup(3)

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)](/rhash/3.md) for details.

[*rhash\_lookup\_next*(3)](/rhash_lookup_next/3.md) uses the *entry* returned from a previous call to [*rhash\_lookup*(3)](/rhash_lookup/3.md) to return the next entry in the hash table matching the same key as used in [*rhash\_lookup*(3)](/rhash_lookup/3.md).

## RETURN VALUE

These functions return a pointer to the entry that was previously inserted into the hash with [*rhash\_insert*(3)](/rhash_insert/3.md).  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)](/rhash_lookup/3.md) will return the last entry inserted with that key.  [*rhash\_lookup\_next*(3)](/rhash_lookup_next/3.md) may be used after using [*rhash\_lookup*(3)](/rhash_lookup/3.md) 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)](/rhash_lookup/3.md) prior to inserting the new entry.

## SEE ALSO

[*rhash*(3)](/rhash/3.md), [*rhash\_entry\_getkey*(3)](/rhash_entry_getkey/3.md),  [*rhash\_entry\_setkey*(3)](/rhash_entry_setkey/3.md), [*rhash\_free*(3)](/rhash_free/3.md),  [*rhash\_insert*(3)](/rhash_insert/3.md), [*rhash\_len*(3)](/rhash_len/3.md),  [*rhash\_lookup\_next*(3)](/rhash_lookup_next/3.md), [*rhash\_new*(3)](/rhash_new/3.md),  [*rhash\_remove*(3)](/rhash_remove/3.md), [*rhash\_remove\_entry*(3)](/rhash_remove_entry/3.md),  [*roy*(3)](/roy/3.md)
