[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: [RFC 2/6] Plugin system



On Friday 16 January 2009, Peter TB Brett wrote:
> On Friday 16 January 2009 23:21:19 DJ Delorie wrote:
> > Better would be to have the plugin itself have some
> > well-known function that registers itself, like pcb's
> > plugins do.  Thus, all you really have to do is dl_open()
> > any .so's you find, and call their well-known function.
>
> Having been stung by this in the past, I would prefer the
> majority of plugins to be "opt-in" than "opt-out" (i.e.
> loaded only when the current project needs to use them).
>
> You can quite easily envisage loading different plugins for,
> say, gnucap simulation design and PCB design.

I was thinking of recommending a gnucap-like plugin system, but 
DJ sort of already did that.

In gnucap, which is written in C++, static constructors are 
automatically called when a plugin is loaded, and they take 
care of whatever else is needed.  Mostly, a static object is 
created and registered with a dispatcher, so you can add 
models, commands, and other things.  Plugins are "opt-in".  
Otherwise, why would you bother?

It is my impression that the PCB plugin system is almost the 
same, except that the "well-known function" is used instead of 
static constructors.

Gnucap has the capability of also static linking plugins.  Just 
add it to the Makefile when you build.  I guess this would 
be "opt-out", and not really plugins any more, but the code is 
the same.  The reason for doing this is to make a basic version 
that runs on anything and has some functionality without 
plugins.

Aside from using the same general idea, I don't see much 
opportunity to share between projects.  I do see one, to read 
and write files with different formats.  Gnucap uses plugins to 
directly read and write a variety of file formats.  That is 
something that IS worth sharing, because it open up the 
possibility of the different applications using the same files 
directly.


Should plugins use the ".so" extension, (or is that ".dll) which 
is system dependent, or should they use another extension that 
is application specific but consistent across systems?


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user