hash map: Fix a wrongly named parameter and enhance the docs (#1540)

This commit is contained in:
Jämes Ménétrey 2022-09-29 21:02:22 +02:00 committed by GitHub
parent 5b10d4e630
commit 4489c3da2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,12 +25,12 @@ typedef uint32 (*HashFunc)(const void *key);
typedef bool (*KeyEqualFunc)(void *key1, void *key2); typedef bool (*KeyEqualFunc)(void *key1, void *key2);
/* Key destroy function: to destroy the key, auto called /* Key destroy function: to destroy the key, auto called
when an hash element is removed. */ for each key when the hash map is destroyed. */
typedef void (*KeyDestroyFunc)(void *key); typedef void (*KeyDestroyFunc)(void *key);
/* Value destroy function: to destroy the value, auto called /* Value destroy function: to destroy the value, auto called
when an hash element is removed. */ for each value when the hash map is destroyed. */
typedef void (*ValueDestroyFunc)(void *key); typedef void (*ValueDestroyFunc)(void *value);
/* traverse callback function: /* traverse callback function:
auto called when traverse every hash element */ auto called when traverse every hash element */
@ -44,10 +44,10 @@ typedef void (*TraverseCallbackFunc)(void *key, void *value, void *user_data);
* @param hash_func hash function of the key, must be specified * @param hash_func hash function of the key, must be specified
* @param key_equal_func key equal function, check whether two keys * @param key_equal_func key equal function, check whether two keys
* are equal, must be specified * are equal, must be specified
* @param key_destroy_func key destroy function, called when an hash element * @param key_destroy_func key destroy function, called for each key if not NULL
* is removed if it is not NULL * when the hash map is destroyed
* @param value_destroy_func value destroy function, called when an hash * @param value_destroy_func value destroy function, called for each value if
* element is removed if it is not NULL * not NULL when the hash map is destroyed
* *
* @return the hash map created, NULL if failed * @return the hash map created, NULL if failed
*/ */