summaryrefslogtreecommitdiffstats
path: root/common/dhash/dhash_test.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-12-08 14:05:22 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-12-08 23:35:25 -0500
commite041252f788d80c53d91696b5bfc37cb47ccda54 (patch)
tree43454b7a700a76ea21b215d51cbe0b0842aae0ac /common/dhash/dhash_test.c
parent2b6b5bca3d55fc07eb22af3af3f77a3f17a6d7a0 (diff)
downloadsssd-e041252f788d80c53d91696b5bfc37cb47ccda54.tar.gz
sssd-e041252f788d80c53d91696b5bfc37cb47ccda54.tar.xz
sssd-e041252f788d80c53d91696b5bfc37cb47ccda54.zip
dhash: Add private pointer for delete callback
Also pass a flag to the delete callback to tell it if this is a normal entry removal or we are cleaning up the tbale definitively.
Diffstat (limited to 'common/dhash/dhash_test.c')
-rw-r--r--common/dhash/dhash_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/dhash/dhash_test.c b/common/dhash/dhash_test.c
index fedfa66a2..27eb88d52 100644
--- a/common/dhash/dhash_test.c
+++ b/common/dhash/dhash_test.c
@@ -98,7 +98,7 @@ bool callback(hash_entry_t *item, void *user_data)
return true;
}
-void delete_callback(hash_entry_t *item)
+void delete_callback(hash_entry_t *item, hash_destroy_enum type, void *pvt)
{
if (item->value.type == HASH_VALUE_PTR) free(item->value.ptr);
}
@@ -188,7 +188,8 @@ int main(int argc, char **argv)
if ((status = hash_create_ex(1, &table,
directory_bits, segment_bits,
min_load_factor, max_load_factor,
- NULL, NULL, NULL, delete_callback)) != HASH_SUCCESS) {
+ NULL, NULL, NULL,
+ delete_callback, NULL)) != HASH_SUCCESS) {
fprintf(stderr, "table creation failed at line %d (%s)\n", __LINE__, error_string(status));
exit(1);
}