[Geany-Devel] New plugin loader mechanisms

Thomas Martitz kugel at xxxxx
Wed Mar 18 20:51:24 UTC 2015

Am 18.03.2015 um 21:23 schrieb Dimitar Zhekov:
> On 18.3.2015 г. 18:42, Thomas Martitz wrote:
>> - Global symbols. Plugins binaries have to export a number of global
>> symbols (geany_{functions,data,plugin}, plugin_{init,...,cleanup}). This
>> kind of sucks, because they pollute the global namespace (in theory).
>> Luckily on unix or win32 systems this is not a problem because they can
>> restrict the symbol visibility of shared libraries. It's still bad
>> practice. Ideally plugins should have zero global symbols, everything
>> being static or hidden to the plugin binary.
> Scope contains 20 source files and 22 headers. Using static is not an 
> option, and marking everything global as hidden will be cumbersome, 
> ugly, and easy to miss (inexperienced plugin developers are sure to 
> miss symbols).
> The only practical option seems to be compiling with hidden 
> visibility, and geany_load_module() should be pre-defined as exported.

That's okay. I didn't mean to forbid global symbols. I put it poorly, 
what I meant was that the current loader requires plugins to export lots 
of global symbols. If plugins do it on their own it's their business.

>> [...]
>> void (*init) (GeanyPlugin *plugin, gpointer pdata);
> Please make this gboolean. A plugin may have the correct API and ABI, 
> but be unable to startup / initialize for some reason. For example, 
> Scope requires scope.glade in the plugin data directory).

Hmm, noted. However I didn't want to digress too far from the existing 
functions (semantically). And Geany obviously cannot handle failing init 
yet. But in this should be trivial to add.

Do you generally like or support my proposal?

Best regards.

More information about the Devel mailing list