This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: plugins callbacks and data


2009/5/12 Basile STARYNKEVITCH <basile@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]