diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-01-09 23:15:42 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-01-19 04:05:53 +0100 |
commit | c1a5ea0d4dceeb9354ff792fc510caa854223463 (patch) | |
tree | eb42b6c2f4021e05823dacad4ae26651771e9149 /include/hash_table.h | |
parent | 5191a25b92f903bcc2142be7ea1bfbe5ea1f5096 (diff) |
Add a user pointer to the hash table implementation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/hash_table.h')
-rw-r--r-- | include/hash_table.h | 9 |
1 files changed, 5 insertions, 4 deletions
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 * |