[Geany-Devel] Plugin API design question/change proposal

Matthew Brush mbrush at xxxxx
Tue May 20 11:09:00 UTC 2014

On 14-05-20 03:38 AM, Lex Trotman wrote:
> [snip]
> I know it might be a bit hard to restrict some symbols, like enums
> that C spits gaily into the global namespace, but if functions and
> structs are limited to those intended to be available, then that will
> be a big leap forward.

It should be ok if the enums are declared in private header (unless they 
need to be public), then the plugins are never faced with this namespace 

> None of this actually *prevents* a plugin writer using the Geany
> headers to access everything, but in doing so they are alerted to the
> fact that what they are using may break, or change in subtle and
> incompatible ways.

It doesn't technically prevent them using private functions (on *nix), 
since they can add a forward declaration if they lookup the function's 
signature, but for all other uses they couldn't since the the (private) 
headers would not even be installed on their systems, and for functions 
it's obviously wrong to be forward-declaring private functions and 
calling them anyway :)

>> [snip]
> I'm not sure what percentage of the API this is, but if it has only
> taken a looong boooring day or two to do it, then its not too bad :)

It's one small header (build.h) and two of the biggest ones (document.h 
and editor.h) and it only took a couple hours, including building 
geany-plugins a bunch of times to see if they broke.

Matthew Brush

More information about the Devel mailing list