On Tue, Jun 28, 2011 at 12:05 PM, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
> ecore/fd_handler - Fix prepare_callback_set and improve its doc.
>
>  Now they can be set even if the list is empty (sorry discomfitor,
>  removing your optimization and making it O(n) again, back from O(0)).
>
>  Also notice that due to the already existing check, if a prepare
>  callback was already set to a fd handler, it can't be changed, so I
>  added that to the docs.
>
>
>
> Author:       antognolli
> Date:         2011-06-28 08:05:09 -0700 (Tue, 28 Jun 2011)
> New Revision: 60765
> Trac:         http://trac.enlightenment.org/e/changeset/60765
>
> Modified:
>  trunk/ecore/src/lib/ecore/ecore_main.c
>
> Modified: trunk/ecore/src/lib/ecore/ecore_main.c
> ===================================================================
> --- trunk/ecore/src/lib/ecore/ecore_main.c      2011-06-28 15:03:58 UTC (rev 
> 60764)
> +++ trunk/ecore/src/lib/ecore/ecore_main.c      2011-06-28 15:05:09 UTC (rev 
> 60765)
> @@ -937,10 +937,21 @@
>
>  /**
>  * @brief Set the prepare callback with data for a given #Ecore_Fd_Handler
> + *
>  * @param fd_handler The fd handler
>  * @param func The prep function
>  * @param data The data to pass to the prep function
> - * This function will be called prior to the the fd handler's callback 
> function.
> + *
> + * This function will be called prior to any fd handler's callback function
> + * (even the other fd handlers), before entering the main loop select 
> function.
> + *
> + * @note Once a prepare callback is set for a fd handler, it cannot be 
> changed.
> + * You need to delete the fd handler and create a new one, to set another
> + * callback.
> + * @note You probably don't need this function. It is only necessary for very
> + * uncommon cases that need special behavior.
> + *
> + * @ingroup Ecore_FD_Handler_Group
>  */
>  EAPI void
>  ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, 
> Ecore_Fd_Prep_Cb func, const void *data)
> @@ -953,7 +964,8 @@
>      }
>    fd_handler->prep_func = func;
>    fd_handler->prep_data = (void *)data;
> -   if (fd_handlers_with_prep && (!eina_list_data_find(fd_handlers_with_prep, 
> fd_handler)))
> +   if ((!fd_handlers_with_prep) ||
> +      (fd_handlers_with_prep && (!eina_list_data_find(fd_handlers_with_prep, 
> fd_handler))))
>      /* FIXME: THIS WILL NOT SCALE WITH LOTS OF PREP FUNCTIONS!!! */
>      fd_handlers_with_prep = eina_list_append(fd_handlers_with_prep, 
> fd_handler);
>  }

Is there anybody using this? Is it necessary anywhere? Since it wasn't
working at all before this commit, I believe that its use is not
necessary... A simple grep in E svn and I couldn't find it being used
on any code.

So, can we deprecate this API?

-- 
Rafael Antognolli
ProFUSION embedded systems
http://profusion.mobi

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to