Hash_CreateEntry — C Library Procedures
NAME
Hash_CreateEntry, Hash_FindEntry − keyed search in hash table
SYNOPSIS
#include <hash.h>
Hash_Entry ∗
Hash_CreateEntry(tablePtr, key, newPtr)
Hash_Entry ∗
Hash_FindEntry(tablePtr, key)
ARGUMENTS
Hash_Table ∗tablePtr (in) Table in which to search for entry or create new one.
Address key (in) Key value that identifies entry. Exact nature depends on keyType parameter passed to Hash_InitTable.
Boolean ∗newPtr (in) If non-NULL, then ∗newPtr is filled in with TRUE if a new entry was created, or FALSE if there was already an entry with the given key.
DESCRIPTION
Both Hash_FindEntry and Hash_CreateEntry search the hash table for an entry with the same key as key. If a matching entry is found, both return the address of that entry, which can then be used in Hash_GetValue, Hash_SetValue, and Hash_DeleteEntry calls. If no matching entry is found then Hash_FindEntry returns NULL; in contrast, Hash_CreateEntry will create a new entry with the given key and an initial value of NULL.
KEYWORDS
hash table, key, search
Sprite version 1.0 — March 27, 1992