TutHashLookupBucket look up a bucket in a hash table
table
the hash table that should be searched for the bucket
key
key to the bucket
The bucket with a given key if successful, NULL
otherwise.
If TutHashLookupBucket fails, it returns NULL
and sets the global SmartSockets error number to one of:
TutHashLookupBucket returns the hash bucket that matches a given key. If it cannot find the appropriate bucket, it returns NULL
. This function may be used to speed up replacement of values in the table.
None
TutHashLookup, TutHashInsert, TutHashBucketSetValue
This example gets the hash bucket for a key:
T_HASH_TABLE table; T_HASH_BUCKET bucket; table = TutHashCreateStr(20); TutHashInsert(table, "EAST", (T_PTR)1);/* look up the bucket that contains the entry for "EAST" */
bucket = TutHashLookupBucket(table, "EAST");/* replace the value in the bucket */
TutHashBucketSetValue(bucket, (T_PTR)2);
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |