Hash Table Functions (TutHash*)


The TutHash* functions are used to work with hash tables.

TutHashBucketGetValue — determine the value in a hash bucket

T_PTR TutHashBucketGetValue(bucket) 
T_HASH_BUCKET bucket; 

TutHashBucketSetValue — set the value in a hash bucket

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

TutHashCreate — create a hash table

T_HASH_TABLE TutHashCreate(init_size, hash_func, test_func) 
T_INT4 init_size; 
T_HASH_CALC_FUNC hash_func; 
T_HASH_TEST_FUNC test_func; 

TutHashCreateInt — create a hash table with integer keys

T_HASH_TABLE TutHashCreateInt(init_size) 
T_INT4 init_size; 

TutHashCreatePtr — create a hash table with pointer keys

T_HASH_TABLE TutHashCreatePtr(init_size) 
T_INT4 init_size; 

TutHashCreateStr — create a hash table with case-sensitive string keys

T_HASH_TABLE TutHashCreateStr(init_size) 
T_INT4 init_size; 

TutHashCreateStri — create a hash table with string keys that are not case sensitive

T_HASH_TABLE TutHashCreateStri(init_size) 
T_INT4 init_size; 

TutHashDelete — delete a hash table entry by key

T_PTR TutHashDelete(table, key) 
T_HASH_TABLE table; 
T_PTR key; 

TutHashDestroy — deallocate the memory used by a hash table and destroy the table

void TutHashDestroy(table, destroy_func, destroy_arg) 
T_HASH_TABLE table; 
T_HASH_DESTROY_FUNC destroy_func; 
T_PTR destroy_arg; 

TutHashDump — dump the information about a hash table

void TutHashDump(table, output_func) 
T_HASH_TABLE table; 
T_OUT_FUNC output_func;  

TutHashGetSize — return the number of entries in the hash table

T_INT4 TutHashGetSize(table) 
T_HASH_TABLE table; 

TutHashInsert — insert an entry into the hash table

void TutHashInsert(table, key, value) 
T_HASH_TABLE table; 
T_PTR key; 
T_PTR value; 

TutHashLookup — find an entry in the hash table

T_PTR TutHashLookup(table, key) 
T_HASH_TABLE table; 
T_PTR key; 

TutHashLookupBucket — look up a bucket in a hash table

T_HASH_BUCKET TutHashLookupBucket(table, key) 
T_HASH_TABLE table; 
T_PTR key; 

TutHashReplace — replace a value stored in the hash table

T_PTR TutHashReplace(table, key, new_value) 
T_HASH_TABLE table; 
T_PTR key; 
T_PTR new_value; 

TutHashSort — return an array of sorted entries from a hash table

T_PTR TutHashSort(table, array_size_return, cmp_func, select_func) 
T_HASH_TABLE table; 
T_INT4 *array_size_return; 
T_HASH_SORT_CMP_FUNC cmp_func; 
T_HASH_SORT_SELECT_FUNC select_func; 

TutHashTraverse — traverse all entries in a hash table

T_PTR TutHashTraverse(table, traverse_func, traverse_arg) 
T_HASH_TABLE table; 
T_HASH_TRAV_FUNC traverse_func; 
T_PTR traverse_arg; 

TIBCO SmartSockets™ API Quick Reference
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com