[Geany-devel] geany-plugins depends on GIO

Lex Trotman elextr at xxxxx
Wed Nov 17 22:28:11 UTC 2010


On 18 November 2010 04:49, Frank Lanitz <frank at frank.uvena.de> wrote:
> On Wed, 17 Nov 2010 19:52:40 +1100
> Lex Trotman <elextr at gmail.com> wrote:
>
>> >
>> > This is not existing in a general view. Also I'm not 100% sure where
>> > this would make sense as you should always you up to date API.
>> > Maybe you can bring a litle light into darkness with an example.
>> >
>>
>> Frank,
>>
>> As Geany is getting more and more functionality in plugins there needs
>> to be more thought in general about the need to lock Geany versions
>> and plugin versions.
>>
>> If they are locked together then users can't upgrade Geany until their
>> plugins support the new version and can't upgrade plugins without
>> upgrading Geany.
>>
>> As I said in another post, as Geany is used for more than C
>> development it is becoming less acceptable to assume that all users
>> can re-compile Geany or plugins so any system needs to work at runtime
>> as well as at compile time.
>>
>> So there needs to be thought about how to allow any version of Geany
>> and any version of a plugin to continue to work as long as the
>> functions that they *use* have not been changed.  This means that a
>> single API/ABI number for the whole interface is not enough, it needs
>> to be per function.  Then smart plugin developers can make their
>> plugins adapt themselves at runtime to the features available from
>> Geany.
>
> Well, sounds reasonable. Is this possible with C?
>

Sure, Geany basically already has all the mechanisms except the
version per function and data structure since everything is made
available to plugins through pointers.

The structures containing the pointers need two version numbers for
the structure.

These two numbers indicate the newest and oldest compatible versions.
If additions are only made to the end of the structures then the
oldest compatible is not changed when new things are added but the
newest version is.  Function/data pointers would only be removed
occasionally as the structures got too big or messy, that would of
course be a breaking change and would change the oldest compatible
version to current.

Then we need a structure with a version number for each function/data.
 This version number needs to be changed anytime that the
function/data is changed in a manner that is not compatible.  Plugins
need to check that they have the right version number and a non-null
pointer to use the function/data.

It would be possible to create a simple tool to assist plugins with
checking everything they use.

Cheers
Lex

> Cheers,
> Frank
> --
> http://frank.uvena.de/en/
>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>



More information about the Devel mailing list