@@ -25,12 +25,12 @@ typedef uint32 (*HashFunc)(const void *key);
2525typedef bool (* KeyEqualFunc )(void * key1 , void * key2 );
2626
2727/* Key destroy function: to destroy the key, auto called
28- when an hash element is removed . */
28+ for each key when the hash map is destroyed . */
2929typedef void (* KeyDestroyFunc )(void * key );
3030
3131/* Value destroy function: to destroy the value, auto called
32- when an hash element is removed . */
33- typedef void (* ValueDestroyFunc )(void * key );
32+ for each value when the hash map is destroyed . */
33+ typedef void (* ValueDestroyFunc )(void * value );
3434
3535/* traverse callback function:
3636 auto called when traverse every hash element */
@@ -44,10 +44,10 @@ typedef void (*TraverseCallbackFunc)(void *key, void *value, void *user_data);
4444 * @param hash_func hash function of the key, must be specified
4545 * @param key_equal_func key equal function, check whether two keys
4646 * are equal, must be specified
47- * @param key_destroy_func key destroy function, called when an hash element
48- * is removed if it is not NULL
49- * @param value_destroy_func value destroy function, called when an hash
50- * element is removed if it is not NULL
47+ * @param key_destroy_func key destroy function, called for each key if not NULL
48+ * when the hash map is destroyed
49+ * @param value_destroy_func value destroy function, called for each value if
50+ * not NULL when the hash map is destroyed
5151 *
5252 * @return the hash map created, NULL if failed
5353 */
0 commit comments