TutHashLookup find an entry in the hash table
table
table where the entry should be looked for
key
the key to use to find the entry
The entry if it was located, NULL
otherwise.
If TutHashLookup fails, it returns NULL
and sets the global SmartSockets error number to one of:
TutHashLookup returns the entry that was previously stored in table
. key
is used to locate the entry. If the entry is not found, a null pointer is returned. The type of key
should be consistent with the key type specified when the hash table was created.
None
TutHashCreate, TutHashInsert, TutHashTraverse
This example looks up an entry in the hash table:
T_HASH_TABLE table; table = TutHashCreateStr(20);/* this will print 0 because look up will fail */
TutOut("look up of EAST is %d\n", (T_INT4)TutHashLookup(table, "EAST"));/* insert a value */
TutHashInsert(table, "EAST", (T_PTR)1);/* this will print 1 *
TutOut("look up of EAST is %d\n", (T_INT4)TutHashLookup(table, "EAST"));
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |