[Geany-Devel] Adding a plugin

Lex Trotman elextr at xxxxx
Sun Jun 9 14:18:33 UTC 2013


But if I'm going to *improve* the docs, I *still* have an outstanding (in a
manner of speaking) question:

> Why does the function plugin_init() accept the one parameter GeanyData*?
> The reason that is a question is that the three global variables
> GeanyPlugin         *geany_plugin;
> GeanyData           *geany_data;
> GeanyFunctions      *geany_functions;
> are available to a plugin and you will notice that one of those global
> variables is geany_data which is suspiciously similar to the parameter to
> plugin_init().

Yes it is the same.

> So either there is no reason to pass the parameter to plugin_init() or
> there is a good reason to pass the parameter to plugin_init().

Since it is generally acknowledged that globals are bad, possibly someone
started the process of removing the globals by switching to passing as
parameters, but did not get time to finish the process or ran into other
problems, but there is no indication I can find of why its that way.

> [...]


> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130610/f1609472/attachment.html>

More information about the Devel mailing list