[lug] Universal Module/Plugin Loader

D. Stimits stimits at idcomm.com
Wed Jun 6 23:02:27 MDT 2001


Alan Robertson wrote:
> 
> Hi,
> 
> I spent some time looking for a "universal module/plugin" loader for 'C'.
> Didn't find what I was looking for.
> 
> What I mean is one that would dynamically load .so files and manage
> registration of plugins, etc.
> 
> The idea is that a larger software system probably has several kinds of
> plugins, and that you need some software which would manage basically an
> arbitrary number of plugin types.
> 
> I have it designed and about 1/3 - 1/2 written at this point, but I thought
> I ought to slow down for a minute and ask if anyone knows of such a thing...
> 
> If not, what I'm designing is pretty cool...  [and I suppose it's only a
> little less cool even if it duplicates something already out there].
> 
> So, does anyone know of such a library?  I need more intesting semantics
> than libtldl or the Glib module loader (AFAIK).

How about GNU libtool? Sort of goes with automake/autoconf set of tools.
Personally I don't like it if the lib will run only on linux, but it has
a lot of cross-platform abilities (more so than most anything else I can
think of). You aren't looking for C++, but has extra shortcomings there,
and I'm mainly interested in C++ these days.

D. Stimits, stimits at idcomm.com

> 
> ------------------------------------------------
> 
> As an FYI, here's what I'm writing...
> 
> Some terminology:
> A module is a dynamically loadable file - on UNIX, a .so file
> A plugin is a set of functions that meet an interface described in a
> structure of function pointers.  Plugins usually live inside of modules.
> It's common to have one plugin per module.
> 
> All modules are treated basically alike.
> 
> All plugins are classed into types.  Every plugin of a given type is treated
> the same.  Each type of plugin in managed by a loadable module of type
> Plugin.
> 
> For example, the Plugin plugin named "auth" manages all plugin registration
> for modules of type "auth".  It is responsible for knowing what it means to
> register a plugin of type "auth".
> 
> The plugin of type Plugin named Plugin (the PluginPlugin) is the only built
> in plug in.  All others are loaded dynamically as requests are made to
> manage plugins of a given type.  So, when a Plugin wants to register itself
> of type "foo", the plugin named "foo" of type "Plugin" is automatically
> loaded to manage things.
> 
> So, it's a pretty universal/generic/general design, and not specifically
> tied to heartbeat or high-availability.
> 
> If anyone knows of something comparable to this that's out there please let
> me know, so I can use it instead of reinventing it.
> 
>         Thanks!
> 
>         -- Alan Robertson
>            alanr at unix.sh
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list