Re: gmodule high-level interface?



On Sun, 15 Apr 2001, Bibek Sahu wrote:

> 
> Hello all,
> 
> 	I'm new to the list, so please correct me if this has already been
> tackled.  However, I looked in the list archives and saw nothing of direct
> relevance there.
> 
> 	I was wondering if there was any interest in a higher-level
> interface to gmodule.  I consider gmodule to be very good at handling
> modules in a cross-platform manner, but using it to handle 'plugins' is
> still a bit of a chore.
> 
> 	I noticed that gmodule has been updated at the low-level to handle
> libtool archives and other such enhancements.  This is wonderful, and
> makes it that much better, but it doesn't really make it much easier to
> use (in a cross-platform manner).
> 
> 	Specifically, I consider the following problems relevant:
> 
> 	* no way to get a list of available modules (possibly looking only
> 	  in certain directories)

This sounds like a pretty app specific task.  What is wrong with
opendir/readdir?  It sounds like the sort of thing that various apps do
slightly differently, so an API for this probably won't satisfy everyone.

> 
> 	* no way to find the prefix and suffix used by g_module_build_path,
> 	  making it almost impossible for developers to search for plugins
> 	  in a fully cross-platform manner.  In Linux, I can name a library
> 	  anything I want and have it load correctly, but will this
> 	  necessarily apply for all OS's on which gmodule is available? 
> 	  Even when I can use any name, using g_module_build_path (in order
> 	  to stick to standard library names) precludes being able to search
> 	  for plugins residing somewhere on the filesystem (because doing so
> 	  necessitates knowing a prefix and suffix).

Why do you need this?  If you only search for .la files in your plugin
directories, things should work correctly.  If you build the plugin with
the -module switch, it should be loadable.  Libtool will make sure the
actual library gets a valid name, and gmodule will be able to find that
name in the .la file.  This simplifies things a lot.

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






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