Re: dlopen() implementaiotn level (Re: Is gnome-dl required ??)



On Tue, 4 Aug 1998, Manish Singh wrote:

> > I don't know... i think it's got a good place in glib.. glib is a nice
> > utility library to make for easier porting of apps and reducton in
> > re-writing basic data structures (lists etc.)...
> 
> I don't think we should be bloating glib unecessarily. What does xdelta
> need with a dl implementation? Conversely, a program that already has an
> established, mature code base but wants dl stuff doesn't need to saddle
> itself with glib.

hm, after spending some thoughts on this, i don't think it is a big
burden on established programs that need a dl-wrapper to require GLib.
since a lot of the glib stuff will be used by the dl-wrapper anyways,
such as assertements and linked lists, i'd rather like to have a subdir
in glib that builds a seperate library which holds the dlwrapper code
and can take advantage of glib's code and configure stuff.

so basically i think we should create a glib/gmodule dir and have an
additional libgmodule.so and gmodule.h installed.
glib-config can be tweaked to recognize an aditional --gmodule flag
and will then put out "-L/usr/local/lib -lgmodule-1.1 -lglib-1.1"
if invoked as `glib-config --libs --gmodule`.

what i currently have for the gmodule.h API is basically:

typedef enum
{
  G_MODULE_BIND_LAZY    = 1 << 0,
  G_MODULE_BIND_MASK    = 0x01
} GModuleBindFlags;

/* return TRUE if dynamic module loading is supported */
gboolean        g_module_supported         (void);

/* open a module `file_name' and return handle, which is NULL on error */
GModule*        g_module_open              (const gchar         *file_name,
                                            GModuleBindFlags     bind_flags);
/* close a previously opened module, if return_val == TRUE, an error occoured */
gboolean        g_module_close             (GModule             *module);
/* query the last module error as a string */
gchar*          g_module_error             (void);
/* retrive a symbol pointer from `module', and return TRUE on failure */
gboolean        g_module_symbol            (GModule             *module,
                                            const gchar         *symbol_name,
                                            gpointer            *symbol);


i don't think the creation of a fully-standalone library with own linked list
implementations, malloc wrappers, assertment handling and similar stuff is
justified for this task, which narrows down to some wrapper code and a
reference count implementation for most platforms.

> 
> -Yosh
> 

---
ciaoTJ



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