From c1a5ea0d4dceeb9354ff792fc510caa854223463 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 9 Jan 2021 23:15:42 +0100 Subject: Add a user pointer to the hash table implementation Signed-off-by: David Oberhollenzer --- include/hash_table.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/hash_table.h') diff --git a/include/hash_table.h b/include/hash_table.h index 6f377c9..813e059 100644 --- a/include/hash_table.h +++ b/include/hash_table.h @@ -42,9 +42,10 @@ struct hash_entry { struct hash_table { struct hash_entry *table; - sqfs_u32 (*key_hash_function)(const void *key); - bool (*key_equals_function)(const void *a, const void *b); + sqfs_u32 (*key_hash_function)(void *user, const void *key); + bool (*key_equals_function)(void *user, const void *a, const void *b); const void *deleted_key; + void *user; sqfs_u32 size; sqfs_u32 rehash; sqfs_u64 size_magic; @@ -56,8 +57,8 @@ struct hash_table { }; SQFS_INTERNAL struct hash_table * -hash_table_create(sqfs_u32 (*key_hash_function)(const void *key), - bool (*key_equals_function)(const void *a, +hash_table_create(sqfs_u32 (*key_hash_function)(void *user, const void *key), + bool (*key_equals_function)(void *user, const void *a, const void *b)); SQFS_INTERNAL struct hash_table * -- cgit v1.2.3