On Wed, Jun 15, 2011 at 5:53 PM, Mike Blumenkrantz <m...@zentific.com> wrote: > On Wed, 15 Jun 2011 08:46:11 -0700 > "Enlightenment SVN" <no-re...@enlightenment.org> wrote: > >> Log: >> eina: +eina_hash_free_set. >> >> >> Author: cedric >> Date: 2011-06-15 08:46:10 -0700 (Wed, 15 Jun 2011) >> New Revision: 60354 >> Trac: http://trac.enlightenment.org/e/changeset/60354 >> >> Modified: >> trunk/eina/ChangeLog trunk/eina/src/include/eina_hash.h >> trunk/eina/src/lib/eina_hash.c >> >> Modified: trunk/eina/ChangeLog >> =================================================================== >> --- trunk/eina/ChangeLog 2011-06-15 14:57:38 UTC (rev 60353) >> +++ trunk/eina/ChangeLog 2011-06-15 15:46:10 UTC (rev 60354) >> @@ -102,7 +102,12 @@ >> >> * Fix eina_hash_set to handle data == NULL like eina_hash_del. >> >> -2011-06-3 Vincent Torri >> +2011-06-03 Vincent Torri >> >> * Fix static linking with eina (iconv could potentially not be >> passed to the linker) >> + >> +2011-06-15 Cedric Bail >> + >> + * Add eina_hash_free_set to change the free callback during the >> + life of an Eina_Hash. >> >> Modified: trunk/eina/src/include/eina_hash.h >> =================================================================== >> --- trunk/eina/src/include/eina_hash.h 2011-06-15 14:57:38 UTC (rev >> 60353) +++ trunk/eina/src/include/eina_hash.h 2011-06-15 15:46:10 UTC >> (rev 60354) @@ -264,6 +264,15 @@ >> int buckets_power_size) >> EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2, 3); >> /** >> + * @brief Redefine the callback that clean the data of a hash >> + * >> + * @param hash The given hash table >> + * @param data_free_cb The function called on each value when the hash >> + * table is freed. @c NULL can be passed as callback. >> + */ >> +EAPI void eina_hash_free_set(Eina_Hash *hash, Eina_Free_Cb data_free_cb) >> EINA_ARG_NONNULL(1); + >> +/** >> * @brief Create a new hash table using the djb2 algorithm. >> * >> * @param data_free_cb The function called on each value when the hash table >> >> Modified: trunk/eina/src/lib/eina_hash.c >> =================================================================== >> --- trunk/eina/src/lib/eina_hash.c 2011-06-15 14:57:38 UTC (rev 60353) >> +++ trunk/eina/src/lib/eina_hash.c 2011-06-15 15:46:10 UTC (rev 60354) >> @@ -713,6 +713,15 @@ >> * >> API * >> *============================================================================*/ >> +EAPI void >> +eina_hash_free_set(Eina_Hash *hash, Eina_Free_Cb data_free_cb) >> +{ >> + EINA_MAGIC_CHECK_HASH(hash); >> + EINA_SAFETY_ON_NULL_RETURN(hash); >> + >> + hash->data_free_cb = data_free_cb; >> +} >> + >> EAPI Eina_Hash * >> eina_hash_new(Eina_Key_Length key_length_cb, >> Eina_Key_Cmp key_cmp_cb, >> >> >> ------------------------------------------------------------------------------ >> EditLive Enterprise is the world's most technically advanced content >> authoring tool. Experience the power of Track Changes, Inline Image >> Editing and ensure content is compliant with Accessibility Checking. >> http://p.sf.net/sfu/ephox-dev2dev >> _______________________________________________ >> enlightenment-svn mailing list >> enlightenment-...@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
> I feel like this name is somewhat misleading... I didn't like it either, if you have a better proposal... -- Cedric BAIL ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel