Add a function to get the count of nodes in a hash.
SVN revision: 27786
This commit is contained in:
parent
28685bd55e
commit
91a0e23656
|
@ -238,6 +238,7 @@ extern "C" {
|
|||
EAPI int ecore_hash_set_free_value(Ecore_Hash *hash, Ecore_Free_Cb function);
|
||||
EAPI void ecore_hash_destroy(Ecore_Hash *hash);
|
||||
|
||||
EAPI int ecore_hash_count(Ecore_Hash *hash);
|
||||
EAPI int ecore_hash_for_each_node(Ecore_Hash *hash, Ecore_For_Each for_each_func,
|
||||
void *user_data);
|
||||
EAPI Ecore_List *ecore_hash_keys(Ecore_Hash *hash);
|
||||
|
|
|
@ -215,6 +215,20 @@ ecore_hash_destroy(Ecore_Hash *hash)
|
|||
* Functions that iterate through hash tables.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Counts the number of nodes in a hash table.
|
||||
* @param hash The hash table to count current nodes.
|
||||
* @return The number of nodes in the hash.
|
||||
* @ingroup Ecore_Data_Hash_ADT_Destruction_Group
|
||||
*/
|
||||
EAPI int
|
||||
ecore_hash_count(Ecore_Hash *hash)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("hash", hash, 0);
|
||||
|
||||
return hash->nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the @p for_each_func function on each entry in the given hash.
|
||||
* @param hash The given hash.
|
||||
|
|
Loading…
Reference in New Issue