2009/5/12 Basile STARYNKEVITCH <bas...@starynkevitch.net>: > Hello All > > In the current plugin API, the function register_callback is used to > register callback routines (eg PLUGIN_FINISH_UNIT) in which case the > callback is expected to be a routine. But this same function > register_callback is used also to register some data to plugins, without any > call back functions, eg for PLUGIN_PASS_MANAGER_SETUP. > > Perhaps we could have two different functions: > > 1. register_callback like before for true callbacks > > and > > 2. register_data for registering data, like for PLUGIN_PASS_MANAGER_SETUP > or PLUGIN_INFO, declared as > void register_data (const char *plugin_name, > enum plugin_event event,, > void* user_data); > ? > > What do you think?
No strong preference one way or the other. One small advantage of the current model is that we have only switch statement over all "enum plugin_event" values. The function already existed when I joined, maybe Le-Chu has some opinion about your proposal. > > Regards. Cheers, -- Rafael Avila de Espindola Google | Gordon House | Barrow Street | Dublin 4 | Ireland Registered in Dublin, Ireland | Registration Number: 368047