TutHashBucketSetValue


Name

TutHashBucketSetValue — set the value in a hash bucket

Synopsis

T_PTR TutHashBucketSetValue(bucket, new_value) 
T_HASH_BUCKET bucket; 
T_PTR new_value; 

Arguments

bucket — the hash bucket to set value for

new_value — value to be stored in the bucket

Return Values

The old value that was stored in the bucket.

Diagnostics

None

Description

TutHashBucketSetValue replaces the value stored in bucket with new_value. Before calling this function, obtain bucket by calling TutHashLookupBucket. If the value is successfully replaced, TutHashBucketSetValue returns the old value that was stored in the bucket.

Caution

None

See Also

TutHashBucketGetValue, TutHashLookupBucket, TutHashReplace

Examples

This example sets the hash bucket value:

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