* plugins callbacks and data
@ 2009-05-12 9:48 Basile STARYNKEVITCH
2009-05-12 11:51 ` Rafael Espindola
0 siblings, 1 reply; 2+ messages in thread
From: Basile STARYNKEVITCH @ 2009-05-12 9:48 UTC (permalink / raw)
To: GCC Mailing List
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?
BTW, tjhe current gcc/doc/plugins.texi don't mention PLUGIN_INFO, unless
I am mistaken. And the enum plugin_event
there is not the same as in gcc-plugins.h
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: plugins callbacks and data
2009-05-12 9:48 plugins callbacks and data Basile STARYNKEVITCH
@ 2009-05-12 11:51 ` Rafael Espindola
0 siblings, 0 replies; 2+ messages in thread
From: Rafael Espindola @ 2009-05-12 11:51 UTC (permalink / raw)
To: Basile STARYNKEVITCH; +Cc: GCC Mailing List, Le-Chun Wu
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-12 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 9:48 plugins callbacks and data Basile STARYNKEVITCH
2009-05-12 11:51 ` Rafael Espindola
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).