gmodule high-level interface?
- From: Bibek Sahu <scorpio dodds net>
- To: gtk-devel-list gnome org
- Subject: gmodule high-level interface?
- Date: Sun, 15 Apr 2001 14:27:24 -0500 (CDT)
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)
* 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).
The two above I consider relevant portability concerns. They're
also very easy to correct -- provide a way to retrieve the library prefix
and suffix, and/or provide a way to get a list of available modules.
I would also like to see some convenience functions to make modules
easier to use. It would be very nice to be able to provide a list of
directories to search, then say g_module_request( "plugin_a" );. This is
actually very simple to implement, and in my opinion would make the API a
lot more pleasant to use.
I recently wrote a C++ wrapper for gmodule (called, surprise,
'gmodule--'; project gmodulemm at sourceforge :-). It provides a thin
wrapper over gmodule loading & so forth. However, it also has a separate
class to simplify loading modules (and a third class to simplify creating
C++ plugins; useful, thanks to symbol-mangling). If there is interest, I
can pull some of the basic load and search routines back to C. The
low-level stuff is mostly in C anyway, so it should be quite simple.
So... opinions? :-)
Thanks,
Bibek
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]