summaryrefslogtreecommitdiffstats
path: root/src/util/util.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-12-15 17:46:23 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-12-20 09:39:55 -0500
commitb770be929d9c786b1ac671cca59dfd3314e65fdd (patch)
tree57b43997687c386f0c4c74e74bf4d48eb8f56923 /src/util/util.c
parentcc1e7b31fdb64025aa9c29a1426651df0b332769 (diff)
downloadsssd-b770be929d9c786b1ac671cca59dfd3314e65fdd.tar.gz
sssd-b770be929d9c786b1ac671cca59dfd3314e65fdd.tar.xz
sssd-b770be929d9c786b1ac671cca59dfd3314e65fdd.zip
Introduce sss_hash_create_ex()
Diffstat (limited to 'src/util/util.c')
-rw-r--r--src/util/util.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/util/util.c b/src/util/util.c
index 67f9880dc..39275ef8f 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -473,9 +473,15 @@ static void hash_talloc_free(void *ptr, void *pvt)
talloc_free(ptr);
}
-errno_t sss_hash_create(TALLOC_CTX *mem_ctx,
- unsigned long count,
- hash_table_t **tbl)
+errno_t sss_hash_create_ex(TALLOC_CTX *mem_ctx,
+ unsigned long count,
+ hash_table_t **tbl,
+ unsigned int directory_bits,
+ unsigned int segment_bits,
+ unsigned long min_load_factor,
+ unsigned long max_load_factor,
+ hash_delete_callback *delete_callback,
+ void *delete_private_data)
{
errno_t ret;
hash_table_t *table;
@@ -487,9 +493,10 @@ errno_t sss_hash_create(TALLOC_CTX *mem_ctx,
return ENOMEM;
}
- hret = hash_create_ex(count, &table, 0, 0, 0, 0,
- hash_talloc, hash_talloc_free,
- internal_ctx, NULL, NULL);
+ hret = hash_create_ex(count, &table, directory_bits, segment_bits,
+ min_load_factor, max_load_factor,
+ hash_talloc, hash_talloc_free, internal_ctx,
+ delete_callback, delete_private_data);
switch (hret) {
case HASH_SUCCESS:
/* Steal the table pointer onto the mem_ctx,
@@ -517,6 +524,12 @@ errno_t sss_hash_create(TALLOC_CTX *mem_ctx,
return ret;
}
+errno_t sss_hash_create(TALLOC_CTX *mem_ctx, unsigned long count,
+ hash_table_t **tbl)
+{
+ return sss_hash_create_ex(mem_ctx, count, tbl, 0, 0, 0, 0, NULL, NULL);
+}
+
errno_t sss_filter_sanitize(TALLOC_CTX *mem_ctx,
const char *input,
char **sanitized)