Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore Modified Files: Ecore_Data.h ecore_hash.c Log Message: Add a function to get the count of nodes in a hash. =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Ecore_Data.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- Ecore_Data.h 28 Dec 2006 10:19:34 -0000 1.26 +++ Ecore_Data.h 4 Jan 2007 07:45:39 -0000 1.27 @@ -238,6 +238,7 @@ 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); =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_hash.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- ecore_hash.c 5 Nov 2006 16:42:30 -0000 1.30 +++ ecore_hash.c 4 Jan 2007 07:45:40 -0000 1.31 @@ -216,6 +216,20 @@ */ /** + * 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. * @param for_each_func The function that each entry is passed to. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs