#include "ktypes.h"
#include "KList.h"
#include "KCList.h"
Defines | |
| #define | KHash_new(cmp_func, hash_func) _KHash_new (cmp_func, hash_func, __K_FILE__, __K_LINE__) |
| Creates an empty hash table. | |
| #define | KHash_print_si(hash) KHash_print (hash, KHash_kstring_print, KHash_kint_print) |
| Function that displays the hash table on the standard output (the keys are strings and the values are integral numbers). | |
| #define | KHash_print_ss(hash) KHash_print (hash, KHash_kstring_print, KHash_kstring_print) |
| Function that displays the hash table on the standard output (the keys are strings and the values are strings too). | |
| #define | KHash_print_s(hash, printvalue_func) KHash_print (hash, KHash_kstring_print, printvalue_func) |
| Function that displays the hash table on the standard output (the keys are strings). | |
Typedefs | |
| typedef _KHash | KHash |
| Hash table. | |
| typedef KUInt( | KHash_hash_func )(KCPtr) |
| Hash table functions. | |
| typedef void( | KHash_printkey_func )(KCPtr) |
| Print functions of a key. | |
| typedef void( | KHash_printvalue_func )(KCPtr) |
| Print functions of a value. | |
| typedef KBool( | KHash_foreach_func )(KCPtr key, KPtr values, KPtr datas) |
| Print function of values from a hash table. | |
Functions | |
| KTL_API KHash * | _KHash_new (KFunc_cmp *cmp_func, KHash_hash_func *hash_func, KString sFile, KInt32 iLine) |
| Creates an empty hash table. | |
| KTL_API void | KHash_delete (KHash **khash) |
| Deletes a hash table. | |
| KTL_API KBool | KHash_insert (KHash *khash, KCPtr key, KPtr value) |
| Inserts an element in a hash table. | |
| KTL_API KBool | KHash_is_key (KHash *khash, KPtr key) |
| Searches of a key from a hash table. | |
| KTL_API KPtr | KHash_get_value (KHash *khash, KCPtr key) |
| Gets the value corresponding to a key in a hash table. | |
| KTL_API KList * | KHash_get_all_values (KHash *hash) |
| Gets all the values from a hash table. | |
| KTL_API KBool | KHash_remove_key (KHash *khash, KCPtr key) |
| Removes a key and its value from a hash table. | |
| KTL_API KBool | KHash_remove_all_values (KHash *khash, KPtr value) |
| Removes all the keys of a same value from a hash table. | |
| KTL_API KBool | KHash_remove_all_keys (KHash *hash) |
| Removes all keys from a hash table. | |
| KTL_API KUInt32 | KHash_size (KHash *khash) |
| Returns the number of elements of a hash table. | |
| KTL_API KUInt | KHash_kstring_hash (KCPtr v) |
| Hash function for strings. | |
| KTL_API KUInt | KHash_kint_hash (KCPtr v) |
| Hash function for integral numbers. | |
| KTL_API KInt | KHash_kstring_cmp (KCPtr p1, KCPtr p2) |
| Comparison function for strings. | |
| KTL_API KUInt | KHash_kint64_hash (KCPtr v) |
| Hash function for 64 bits integral numbers. | |
| KTL_API KInt | KHash_kint64_cmp (KCPtr p1, KCPtr p2) |
| Comparison function for 64 bits integral numbers. | |
| KTL_API KUInt | KHash_kuint32_hash (KCPtr v) |
| Hash function for 32 bits integral numbers. | |
| KTL_API KInt | KHash_kuint32_cmp (KCPtr p1, KCPtr p2) |
| Comparison function for 32 bits integral numbers. | |
| KTL_API KInt | KHash_kint_cmp (KCPtr p1, KCPtr p2) |
| Comparison function for integral numbers. | |
| KTL_API void | KHash_kint_print (KCPtr p) |
| Function that displays an integral number on the standard output. | |
| KTL_API void | KHash_kstring_print (KCPtr p) |
| Function that displays a string on the standard output. | |
| KTL_API void | KHash_print (KHash *hash, KHash_printkey_func *printkey_func, KHash_printvalue_func *printvalue_func) |
| Function that displays the hash table on the standard output. | |
| KTL_API KBool | KHash_checkup (KHash *hash, KPtr *keys, KPtr *values, const KInt64 n) |
| Verifies the correctness of a hash table. | |
| KTL_API KBool | KHash_foreach (KHash *hash, KHash_foreach_func *foreach_func, KPtr datas) |
| Applies the same function to all couples key-value of a hash table. | |
| KTL_API KCList * | KHash_getAllKeys (KHash *hash) |
| Returns all the keys from a hash table. | |
| KTL_API KCPtr | KHash_iter_begin (KHash *hash) |
| Returns the first key from a hash table. | |
| KTL_API KCPtr | KHash_iter_next (KHash *hash) |
| Returns the next key from a hash table. | |
|
|
Creates an empty hash table.
|
|
|
Function that displays the hash table on the standard output (the keys are strings).
|
|
|
Function that displays the hash table on the standard output (the keys are strings and the values are integral numbers).
|
|
|
Function that displays the hash table on the standard output (the keys are strings and the values are strings too).
|
|
||||||||||||||||||||
|
Creates an empty hash table.
|
|
||||||||||||||||||||
|
Verifies the correctness of a hash table.
|
|
|
Deletes a hash table.
|
|
||||||||||||||||
|
Applies the same function to all couples key-value of a hash table.
|
|
|
Gets all the values from a hash table.
|
|
||||||||||||
|
Gets the value corresponding to a key in a hash table.
|
|
|
Returns all the keys from a hash table.
|
|
||||||||||||||||
|
Inserts an element in a hash table.
|
|
||||||||||||
|
Searches of a key from a hash table.
|
|
|
Returns the first key from a hash table.
|
|
|
Returns the next key from a hash table.
|
|
||||||||||||
|
Comparison function for 64 bits integral numbers.
|
|
|
Hash function for 64 bits integral numbers.
|
|
||||||||||||
|
Comparison function for integral numbers.
|
|
|
Hash function for integral numbers.
|
|
|
Function that displays an integral number on the standard output.
|
|
||||||||||||
|
Comparison function for strings.
|
|
|
Hash function for strings.
|
|
|
Function that displays a string on the standard output.
|
|
||||||||||||
|
Comparison function for 32 bits integral numbers.
|
|
|
Hash function for 32 bits integral numbers.
|
|
||||||||||||||||
|
Function that displays the hash table on the standard output.
|
|
|
Removes all keys from a hash table.
|
|
||||||||||||
|
Removes all the keys of a same value from a hash table.
|
|
||||||||||||
|
Removes a key and its value from a hash table.
|
|
|
Returns the number of elements of a hash table.
|
1.3.8