Logo Search packages:      
Sourcecode: likewise-open version File versions  Download package

CENTERROR CTStableHashTableNew ( PSHASH_TABLE tab,
LWGHashFunc  hash_func,
LWGEqualFunc  equal_func,
LWGDestroyNotify  key_free,
LWGDestroyNotify  value_free 
)

Allocate and initialize a table.

Allocates and initializes a stable hash table with the specified parameters.

Parameters:
tab a pointer where the address of the new table will be stored
hash_func the key hash function
equal_func the key comparison function
key_free a function that will be called to free keys evicted from the table
value_free a function that will be called to free values evicted from the table

Definition at line 90 of file cthash.c.

References CTStableHashTableInit().

{
    CENTERROR ceError = CENTERROR_SUCCESS;
    
    ceError = CTAllocateMemory(sizeof(SHASH_TABLE), (PVOID*) tab);
    BAIL_ON_CENTERIS_ERROR(ceError);
    
    ceError = CTStableHashTableInit(*tab, hash_func, equal_func, key_free, value_free);
    BAIL_ON_CENTERIS_ERROR(ceError);
    
    (*tab)->dynamic = TRUE;
    
error:
    return ceError;
}


Generated by  Doxygen 1.6.0   Back to index