Re: [xml] [PATCH] DSO/Module Support



On Mon, Dec 20, 2004 at 05:37:14PM -0500, Joel Reed wrote:
The following patch implements a basic API for dynamically loading
shared objects (.so/.dll files).

The API is as follows:

XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename);       
XMLPUBFUN void* XMLCALL xmlModuleSymbol (xmlModulePtr module, const char* name);
XMLPUBFUN int XMLCALL xmlModuleClose(xmlModulePtr module);                
XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module);


  Okay I read the patch, this looks clean I have just a few comments:
     1/ why different close() and free() operations ? Can you call
        free() without calling close() first ? I don't see a way to
        "reopen" a module.
     2/ XML_FROM_MODULE must be moved at the end of the enum list to
        not break ABI compatibility.
     3/ xmllint --version should be extended to display whether module
        support was compiled in.
     4/ I don't see support for "sharing" loaded modules, I wonder how often
        multiple pieces of code will rely on the same extensions and how
        this is best handled. Maybe the system interface take care of that
        maybe not, maybe it would be usefule at the libxml2 layer, maybe not.
        That can probably be added later if deemed needed.

The guts of the patch can be found in the following files:

libxml2/xmlmodule.c
libxml2/xmlmodule-beos.c
libxml2/xmlmodule-dlopen.c
libxml2/xmlmodule-os2.c
libxml2/xmlmodule-shlload.c
libxml2/xmlmodule-win32.c

Thus far, only xmlmodule-dlopen.c has been tested. I plan on testing
xmlmodule-win32.c next. People with access to beos, os2, shlload-based
platforms - please test out the patch & provide improvements.

  Ideally I would like to get one person contact for each remaining
platform who could state that it was tested.

I'm posting this for review, and hope that at some point it can be
included into CVS. I've got a 2nd patch to post which uses libxml2
module support to implement XSLT extensions as modules.

  Tell me when you get it tested on Windows, if needed send a new patch,
then I will commit into CVS,

    looks good,

   thanks !

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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