diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/Makefile.am libxml2/Makefile.am --- libxml2-orig/Makefile.am 2004-12-20 13:23:07.000000000 -0500 +++ libxml2/Makefile.am 2004-12-20 13:48:53.000000000 -0500 @@ -8,7 +8,7 @@ INCLUDES = -I$(top_builddir)/include -I@ noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ testThreads testC14N testAutomata testRegexp \ - testReader testapi + testReader testapi testModule bin_PROGRAMS = xmllint xmlcatalog @@ -17,7 +17,7 @@ bin_SCRIPTS=xml2-config lib_LTLIBRARIES = libxml2.la libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@ -libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -version-info @LIBXML_VERSION_INFO@ +libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -version-info @LIBXML_VERSION_INFO@ @MODULE_PLATFORM_LIBS@ if WITH_TRIO_SOURCES libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ @@ -27,7 +27,7 @@ libxml2_la_SOURCES = SAX.c entities.c en catalog.c globals.c threads.c c14n.c xmlstring.c \ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c + xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c xmlmodule.c else libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ @@ -36,7 +36,16 @@ libxml2_la_SOURCES = SAX.c entities.c en catalog.c globals.c threads.c c14n.c xmlstring.c \ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c + xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ + xmlmodule.c +endif + +# add in platform specific module loading code +if MODULE_DLOPEN +libxml2_la_SOURCES += xmlmodule-dlopen.c +endif +if MODULE_SHLLOAD +libxml2_la_SOURCES += xmlmodule-shlload.c endif DEPS = $(top_builddir)/libxml2.la @@ -113,6 +122,15 @@ testReader_LDFLAGS = testReader_DEPENDENCIES = $(DEPS) testReader_LDADD= $(LDADDS) +testModule_SOURCES=testModule.c +testModule_LDFLAGS = +testModule_DEPENDENCIES = $(DEPS) +testModule_LDADD= $(LDADDS) + +noinst_LTLIBRARIES = testdso.la +testdso_la_SOURCES = testdso.c +testdso_la_LDFLAGS = -module -rpath $(libdir) + testapi.c: gentest.py doc/libxml2-api.xml -@(if [ "$(PYTHON)" != "" ] ; then $(PYTHON) $(srcdir)/gentest.py ; fi ) @@ -130,7 +148,7 @@ check-local: all tests testall : tests SVGtests SAXtests -tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ +tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@ @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ $(MAKE) MAKEFLAGS+=--silent tests ; fi) @(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests) @@ -984,6 +1002,10 @@ SchemasPythonTests: fi) @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi) +ModuleTests: testModule$(EXEEXT) testdso.la + @echo "## Module tests" + @(./testModule$(EXEEXT)) + cleanup: -@(find . -name .\#\* -exec rm {} \;) @@ -1029,7 +1051,7 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh. triop.h triodef.h libxml.h elfgcchack.h \ testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ dbgen.pl dbgenattr.pl regressions.py regressions.xml \ - $(CVS_EXTRA_DIST) + $(CVS_EXTRA_DIST) xmlmodule-win32.c xmlmodule-os2.c xmlmodule-beos.c pkgconfigdir = $(libdir)/pkgconfig diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/configure.in libxml2/configure.in --- libxml2-orig/configure.in 2004-12-20 13:23:07.000000000 -0500 +++ libxml2/configure.in 2004-12-20 13:41:27.000000000 -0500 @@ -430,6 +430,35 @@ fi AC_SUBST(pythondir) AC_SUBST(PYTHON_SUBDIR) +dnl check for dso support +WITH_MODULES=0 +MODULE_PLATFORM_IMPL= +MODULE_EXTENSION=".so" +TEST_MODULES= + +AC_CHECK_LIB(dld, shl_load, [ + WITH_MODULES=1 + MODULE_PLATFORM_LIBS="-ldld" + USE_SHLLOAD=1 +]) +AM_CONDITIONAL(MODULE_SHLLOAD, test "${USE_SHLLOAD}" = "1") + +AC_CHECK_LIB(dl, dlopen, [ + WITH_MODULES=1 + MODULE_PLATFORM_LIBS="-ldl" + USE_DLOPEN=1 +]) +AM_CONDITIONAL(MODULE_DLOPEN, test "${USE_DLOPEN}" = "1") + +if test "${WITH_MODULES}" = "1"; then + TEST_MODULES="ModuleTests" +fi + +AC_SUBST(WITH_MODULES) +AC_SUBST(MODULE_PLATFORM_LIBS) +AC_SUBST(MODULE_EXTENSION) +AC_SUBST(TEST_MODULES) + dnl dnl Tester makes use of readline if present dnl diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/error.c libxml2/error.c --- libxml2-orig/error.c 2004-12-20 13:23:07.000000000 -0500 +++ libxml2/error.c 2004-10-27 21:08:17.000000000 -0400 @@ -330,6 +330,9 @@ xmlReportError(xmlErrorPtr err, xmlParse case XML_FROM_REGEXP: channel(data, "regexp "); break; + case XML_FROM_MODULE: + channel(data, "module "); + break; case XML_FROM_SCHEMASV: channel(data, "Schemas validity "); break; diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/include/libxml/Makefile.am libxml2/include/libxml/Makefile.am --- libxml2-orig/include/libxml/Makefile.am 2004-12-20 13:23:09.000000000 -0500 +++ libxml2/include/libxml/Makefile.am 2004-10-16 22:37:28.000000000 -0400 @@ -34,6 +34,8 @@ xmlinc_HEADERS = \ c14n.h \ xmlautomata.h \ xmlregexp.h \ + xmlmodule.h \ + xmlmoduleInternals.h \ xmlschemas.h \ schemasInternals.h \ xmlschemastypes.h \ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/include/libxml/xmlerror.h libxml2/include/libxml/xmlerror.h --- libxml2-orig/include/libxml/xmlerror.h 2004-12-20 13:23:09.000000000 -0500 +++ libxml2/include/libxml/xmlerror.h 2004-12-20 06:47:00.000000000 -0500 @@ -49,6 +49,7 @@ typedef enum { XML_FROM_XPATH, /* The XPath module */ XML_FROM_XPOINTER, /* The XPointer module */ XML_FROM_REGEXP, /* The regular expressions module */ + XML_FROM_MODULE, /* The dynamically loaded module module*/ XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */ XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */ XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */ @@ -746,6 +747,8 @@ typedef enum { XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */ XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */ XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */ + XML_MODULE_OPEN, /* 3080 */ + XML_MODULE_CLOSE, /* 3081 */ XML_CHECK_FOUND_ELEMENT = 5000, XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */ XML_CHECK_FOUND_TEXT, /* 5002 */ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/include/libxml/xmlmodule.h libxml2/include/libxml/xmlmodule.h --- libxml2-orig/include/libxml/xmlmodule.h 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/include/libxml/xmlmodule.h 2004-11-09 22:26:25.000000000 -0500 @@ -0,0 +1,48 @@ +/* + * Summary: dynamic module loading + * Description: basic API for dynamic module loading, used by + * libexslt + * + * Copy: See Copyright for the status of this software. + * + * Author: Joel W. Reed + */ + +#ifndef __XML_MODULE_H__ +#define __XML_MODULE_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlModulePtr: + * + * A handle to a dynamically loaded module + */ +typedef struct _xmlModule xmlModule; +typedef xmlModule *xmlModulePtr; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +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); + +#ifdef __cplusplus +} +#endif + +#endif /*__XML_MODULE_H__ */ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/include/libxml/xmlmoduleInternals.h libxml2/include/libxml/xmlmoduleInternals.h --- libxml2-orig/include/libxml/xmlmoduleInternals.h 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/include/libxml/xmlmoduleInternals.h 2004-10-16 15:43:20.000000000 -0400 @@ -0,0 +1,28 @@ +/* + * Summary: dynamic module loading internal functions + * Description: basic API for platform-specific dynamic module + * loading functions + * + * Copy: See Copyright for the status of this software. + * + * Author: Joel W. Reed + */ + +#ifndef __XML_MODULEINTERNALS_H__ +#define __XML_MODULEINTERNALS_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void* xmlModulePlatformOpen(const char* name); +int xmlModulePlatformClose(void* handle); +void* xmlModulePlatformSymbol(void* handle, const char* name); + +#ifdef __cplusplus +} +#endif + +#endif /*__XML_MODULEINTERNALS_H__ */ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/include/libxml/xmlversion.h.in libxml2/include/libxml/xmlversion.h.in --- libxml2-orig/include/libxml/xmlversion.h.in 2004-12-20 13:23:09.000000000 -0500 +++ libxml2/include/libxml/xmlversion.h.in 2004-10-23 20:24:37.000000000 -0400 @@ -340,6 +340,16 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i #endif /** + * LIBXML_MODULES_ENABLED: + * + * Whether the module interfaces are compiled in + */ +#if @WITH_MODULES@ +#define LIBXML_MODULES_ENABLED +#define LIBXML_MODULE_EXTENSION "@MODULE_EXTENSION@" +#endif + +/** * ATTRIBUTE_UNUSED: * * Macro used to signal to GCC unused function parameters diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/include/libxml/xmlwin32version.h.in libxml2/include/libxml/xmlwin32version.h.in --- libxml2-orig/include/libxml/xmlwin32version.h.in 2004-12-20 13:23:09.000000000 -0500 +++ libxml2/include/libxml/xmlwin32version.h.in 2004-10-18 22:06:10.000000000 -0400 @@ -261,6 +261,18 @@ extern void xmlCheckVersion(int version) #endif #endif +/* + * #pragma comment(lib, "kernel32.lib") + * + * pragma understood my MS compiler which enables a conditional link with + * kernel32. + */ +#ifdef _MSC_VER +#if defined LIBXML_MODULES_ENABLED +#pragma comment(lib, "kernel32.lib") +#endif +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/libxml-2.0.pc.in libxml2/libxml-2.0.pc.in --- libxml2-orig/libxml-2.0.pc.in 2004-12-20 13:23:07.000000000 -0500 +++ libxml2/libxml-2.0.pc.in 2004-11-05 20:59:13.000000000 -0500 @@ -2,7 +2,7 @@ prefix= prefix@ exec_prefix= exec_prefix@ libdir= libdir@ includedir= includedir@ - +modules= WITH_MODULES@ Name: libXML Version: @VERSION@ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/testdso.c libxml2/testdso.c --- libxml2-orig/testdso.c 2004-12-20 12:32:11.000000000 -0500 +++ libxml2/testdso.c 2004-12-20 13:42:37.000000000 -0500 @@ -2,6 +2,6 @@ int hello_world() { - printf("Hello World!\n"); + printf("Success!\n"); return 0; } diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/win32/Makefile.bcb libxml2/win32/Makefile.bcb --- libxml2-orig/win32/Makefile.bcb 2004-12-20 13:23:13.000000000 -0500 +++ libxml2/win32/Makefile.bcb 2004-10-20 20:58:57.000000000 -0400 @@ -95,6 +95,10 @@ LIBS = $(LIBS) zlibomf.lib !if "$(WITH_THREADS)" == "posix" LIBS = $(LIBS) pthreadVC.lib !endif +!if "$(WITH_MODULES)" == "1" +CFLAGS = $(CFLAGS) -DLIBXML_MODULE_EXTENSION=".dll" +LIBS = $(LIBS) kernel32.lib +!endif # The archiver and its options. AR = tlib.exe @@ -143,6 +147,8 @@ XML_OBJS = $(XML_INTDIR)\c14n.obj\ $(XML_INTDIR)\xmlmemory.obj\ $(XML_INTDIR)\xmlreader.obj\ $(XML_INTDIR)\xmlregexp.obj\ + $(XML_INTDIR)\xmlmodule.obj\ + $(XML_INTDIR)\xmlmodule-win32.obj\ $(XML_INTDIR)\xmlsave.obj\ $(XML_INTDIR)\xmlschemas.obj\ $(XML_INTDIR)\xmlschemastypes.obj\ @@ -186,6 +192,8 @@ XML_OBJS_A = $(XML_INTDIR_A)\c14n.obj\ $(XML_INTDIR_A)\xmlmemory.obj\ $(XML_INTDIR_A)\xmlreader.obj\ $(XML_INTDIR_A)\xmlregexp.obj\ + $(XML_INTDIR_A)\xmlmodule.obj\ + $(XML_INTDIR_A)\xmlmodule-win32.obj\ $(XML_INTDIR_A)\xmlsave.obj\ $(XML_INTDIR_A)\xmlschemas.obj\ $(XML_INTDIR_A)\xmlschemastypes.obj\ @@ -205,6 +213,7 @@ UTILS = $(BINDIR)\xmllint.exe\ $(BINDIR)\testReader.exe\ $(BINDIR)\testRelax.exe\ $(BINDIR)\testRegexp.exe\ + $(BINDIR)\testModule.exe\ $(BINDIR)\testSAX.exe\ $(BINDIR)\testSchemas.exe\ $(BINDIR)\testURI.exe\ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/win32/Makefile.mingw libxml2/win32/Makefile.mingw --- libxml2-orig/win32/Makefile.mingw 2004-12-20 13:23:13.000000000 -0500 +++ libxml2/win32/Makefile.mingw 2004-10-20 20:58:37.000000000 -0400 @@ -84,6 +84,10 @@ endif ifeq ($(WITH_THREADS),posix) LIBS += -lpthreadGC endif +ifeq ($(WITH_MODULES),1) +CFLAGS += -DLIBXML_MODULE_EXTENSION=".dll" +LIBS += -lkernel32 +endif # The archiver and its options. AR = ar.exe @@ -133,6 +137,8 @@ XML_OBJS = $(XML_INTDIR)/c14n.o\ $(XML_INTDIR)/xmlmemory.o\ $(XML_INTDIR)/xmlreader.o\ $(XML_INTDIR)/xmlregexp.o\ + $(XML_INTDIR)\xmlmodule.o\ + $(XML_INTDIR)\xmlmodule-win32.o\ $(XML_INTDIR)/xmlsave.o\ $(XML_INTDIR)/xmlschemas.o\ $(XML_INTDIR)/xmlschemastypes.o\ @@ -178,6 +184,8 @@ XML_OBJS_A = $(XML_INTDIR_A)/c14n.o\ $(XML_INTDIR_A)/xmlmemory.o\ $(XML_INTDIR_A)/xmlreader.o\ $(XML_INTDIR_A)/xmlregexp.o\ + $(XML_INTDIR_A)\xmlmodule.o\ + $(XML_INTDIR_A)\xmlmodule-win32.o\ $(XML_INTDIR_A)/xmlsave.o\ $(XML_INTDIR_A)/xmlschemas.o\ $(XML_INTDIR_A)/xmlschemastypes.o\ @@ -198,6 +206,7 @@ UTILS = $(BINDIR)/xmllint.exe\ $(BINDIR)/testHTML.exe\ $(BINDIR)/testReader.exe\ $(BINDIR)/testRegexp.exe\ + $(BINDIR)/testModule.exe\ $(BINDIR)/testRelax.exe\ $(BINDIR)/testSAX.exe\ $(BINDIR)/testSchemas.exe\ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/win32/Makefile.msvc libxml2/win32/Makefile.msvc --- libxml2-orig/win32/Makefile.msvc 2004-12-20 13:23:13.000000000 -0500 +++ libxml2/win32/Makefile.msvc 2004-10-20 20:58:08.000000000 -0400 @@ -74,6 +74,10 @@ LIBS = $(LIBS) zdll.lib !if "$(WITH_THREADS)" == "posix" LIBS = $(LIBS) pthreadVC.lib !endif +!if "$(WITH_MODULES)" == "1" +CFLAGS = $(CFLAGS) /D "LIBXML_MODULE_EXTENSION=\".dll\"" +LIBS = $(LIBS) kernel32.lib +!endif # The archiver and its options. AR = lib.exe @@ -122,6 +126,8 @@ XML_OBJS = $(XML_INTDIR)\c14n.obj\ $(XML_INTDIR)\xmlmemory.obj\ $(XML_INTDIR)\xmlreader.obj\ $(XML_INTDIR)\xmlregexp.obj\ + $(XML_INTDIR)\xmlmodule.obj\ + $(XML_INTDIR)\xmlmodule-win32.obj\ $(XML_INTDIR)\xmlsave.obj\ $(XML_INTDIR)\xmlschemas.obj\ $(XML_INTDIR)\xmlschemastypes.obj\ @@ -165,6 +171,8 @@ XML_OBJS_A = $(XML_INTDIR_A)\c14n.obj\ $(XML_INTDIR_A)\xmlmemory.obj\ $(XML_INTDIR_A)\xmlreader.obj\ $(XML_INTDIR_A)\xmlregexp.obj\ + $(XML_INTDIR_A)\xmlmodule.obj\ + $(XML_INTDIR_A)\xmlmodule-win32.obj\ $(XML_INTDIR_A)\xmlsave.obj\ $(XML_INTDIR_A)\xmlschemas.obj\ $(XML_INTDIR_A)\xmlschemastypes.obj\ @@ -184,6 +192,7 @@ UTILS = $(BINDIR)\xmllint.exe\ $(BINDIR)\testReader.exe\ $(BINDIR)\testRelax.exe\ $(BINDIR)\testRegexp.exe\ + $(BINDIR)\testModule.exe\ $(BINDIR)\testSAX.exe\ $(BINDIR)\testSchemas.exe\ $(BINDIR)\testURI.exe\ diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/win32/configure.js libxml2/win32/configure.js --- libxml2-orig/win32/configure.js 2004-12-20 13:23:13.000000000 -0500 +++ libxml2/win32/configure.js 2004-10-16 21:28:20.000000000 -0400 @@ -46,6 +46,7 @@ var withDebug = true; var withMemDebug = false; var withSchemas = true; var withRegExps = true; +var withModules = true; var withTree = true; var withReader = true; var withWriter = true; @@ -125,6 +126,7 @@ function usage() txt += " xml_debug: Enable XML debbugging module (" + (withDebug? "yes" : "no") + ")\n"; txt += " mem_debug: Enable memory debugger (" + (withMemDebug? "yes" : "no") + ")\n"; txt += " regexps: Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n"; + txt += " regexps: Enable module support (" + (withModules? "yes" : "no") + ")\n"; txt += " tree: Enable tree api (" + (withTree? "yes" : "no") + ")\n"; txt += " reader: Enable xmlReader api (" + (withReader? "yes" : "no") + ")\n"; txt += " writer: Enable xmlWriter api (" + (withWriter? "yes" : "no") + ")\n"; @@ -230,6 +232,7 @@ function discoverVersion() vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0")); vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0")); vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0")); + vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); vf.WriteLine("WITH_TREE=" + (withTree? "1" : "0")); vf.WriteLine("WITH_READER=" + (withReader? "1" : "0")); vf.WriteLine("WITH_WRITER=" + (withWriter? "1" : "0")); @@ -318,6 +321,8 @@ function configureLibxml() of.WriteLine(s.replace(/\ WITH_SCHEMAS\@/, withSchemas? "1" : "0")); } else if (s.search(/\ WITH_REGEXPS\@/) != -1) { of.WriteLine(s.replace(/\ WITH_REGEXPS\@/, withRegExps? "1" : "0")); + } else if (s.search(/\ WITH_MODULES\@/) != -1) { + of.WriteLine(s.replace(/\ WITH_MODULES\@/, withModules? "1" : "0")); } else if (s.search(/\ WITH_TREE\@/) != -1) { of.WriteLine(s.replace(/\ WITH_TREE\@/, withTree? "1" : "0")); } else if (s.search(/\ WITH_READER\@/) != -1) { @@ -610,6 +615,7 @@ txtOut += " zlib support: " + boolT txtOut += " Debugging module: " + boolToStr(withDebug) + "\n"; txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n"; txtOut += " Regexp support: " + boolToStr(withRegExps) + "\n"; +txtOut += " Module support: " + boolToStr(withModules) + "\n"; txtOut += " Tree support: " + boolToStr(withTree) + "\n"; txtOut += " Reader support: " + boolToStr(withReader) + "\n"; txtOut += " Writer support: " + boolToStr(withWriter) + "\n"; diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xml2-config.in libxml2/xml2-config.in --- libxml2-orig/xml2-config.in 2004-12-20 13:23:07.000000000 -0500 +++ libxml2/xml2-config.in 2004-11-05 20:58:41.000000000 -0500 @@ -17,6 +17,7 @@ Known values for OPTION are: --libs print library linking information --libtool-libs print linking information for use with libtool --cflags print pre-processor and compiler flags + --modules module support enabled --help display this help and exit --version output version information EOF @@ -74,6 +75,10 @@ while test $# -gt 0; do echo ${libdir}/@XML_LIBTOOLLIBS@ ;; + --modules) + echo @WITH_MODULES@ + ;; + --libs) if [ "`uname`" = "Linux" ] then diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xmlmodule-beos.c libxml2/xmlmodule-beos.c --- libxml2-orig/xmlmodule-beos.c 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/xmlmodule-beos.c 2004-10-19 22:20:06.000000000 -0400 @@ -0,0 +1,59 @@ +/* + * xmlmodule.c : + * + * See Copyright for the status of this software. + * + * joelwreed comcast net + */ + +#define IN_LIBXML +#include "libxml.h" + +#include +#include +#include + +/* + * xmlModulePlatformOpen: + * beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html + * returns a handle on success, and zero on error. + */ + +void* xmlModulePlatformOpen(const char* name) +{ + void* handle; + handle = (void*)load_add_on(name); + return (handle); +} + +/* + * xmlModulePlatformClose: + * beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html + * returns 0 on success, and non-zero on error. + */ + +int xmlModulePlatformClose(void* handle) +{ + status_t rc; + rc = unload_add_on((image_id)handle); + + if (rc == B_OK) return 0; + else return -1; +} + +/* + * xmlModulePlatformSymbol: + * beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html + * returns loaded symbol on success, and zero on error. + */ + +void* xmlModulePlatformSymbol(void* handle, const char* name) +{ + void* sym; + status_t rc; + + rc = get_image_symbol((image_id)handle, name, B_SYMBOL_TYPE_ANY, &sym); + + if (rc == B_OK) return sym; + else return 0; +} diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xmlmodule-dlopen.c libxml2/xmlmodule-dlopen.c --- libxml2-orig/xmlmodule-dlopen.c 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/xmlmodule-dlopen.c 2004-10-16 15:43:14.000000000 -0400 @@ -0,0 +1,50 @@ +/* + * xmlmodule.c : + * + * See Copyright for the status of this software. + * + * joelwreed comcast net + */ + +#define IN_LIBXML +#include "libxml.h" + +#include +#include +#include + +/* + * xmlModulePlatformOpen: + * returns a handle on success, and zero on error. + */ + +void* xmlModulePlatformOpen(const char* name) +{ + void* handle; + handle = dlopen(name, RTLD_GLOBAL|RTLD_NOW); + return (handle); +} + +/* + * xmlModulePlatformClose: + * returns 0 on success, and non-zero on error. + */ + +int xmlModulePlatformClose(void* handle) +{ + int rc; + rc = dlclose(handle); + return (rc); +} + +/* + * xmlModulePlatformSymbol: + * returns loaded symbol on success, and zero on error. + */ + +void* xmlModulePlatformSymbol(void* handle, const char* name) +{ + void* sym; + sym = dlsym(handle, name); + return (sym); +} diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xmlmodule-os2.c libxml2/xmlmodule-os2.c --- libxml2-orig/xmlmodule-os2.c 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/xmlmodule-os2.c 2004-10-19 21:50:58.000000000 -0400 @@ -0,0 +1,61 @@ +/* + * xmlmodule.c : + * + * See Copyright for the status of this software. + * + * joelwreed comcast net + */ + +#define IN_LIBXML +#include "libxml.h" + +#include +#include +#include + +/* + * xmlModulePlatformOpen: + * os2 api info: http://www.edm2.com/os2api/Dos/DosLoadModule.html + * returns a handle on success, and zero on error. + */ + +void* xmlModulePlatformOpen(const char* name) +{ + char errbuf[255]; + void* handle; + int rc; + + rc = DosLoadModule(errbuf, sizeof(errbuf), name, &handle); + + if (rc) return 0; + else return (handle); +} + +/* + * xmlModulePlatformClose: + * os2 api info: http://www.edm2.com/os2api/Dos/DosFreeModule.html + * returns 0 on success, and non-zero on error. + */ + +int xmlModulePlatformClose(void* handle) +{ + int rc; + rc = DosFreeModule(handle); + return (rc); +} + +/* + * xmlModulePlatformSymbol: + * os2 api info: http://www.edm2.com/os2api/Dos/DosQueryProcAddr.html + * returns loaded symbol on success, and zero on error. + */ + +void* xmlModulePlatformSymbol(void* handle, const char* name) +{ + void* sym; + int rc; + rc = DosQueryProcAddr(handle, 0, name, &sym); + + if (rc) return 0; + else return (sym); +} diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xmlmodule-shlload.c libxml2/xmlmodule-shlload.c --- libxml2-orig/xmlmodule-shlload.c 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/xmlmodule-shlload.c 2004-10-16 20:45:47.000000000 -0400 @@ -0,0 +1,55 @@ +/* + * xmlmodule.c : + * + * See Copyright for the status of this software. + * + * joelwreed comcast net + */ + +#define IN_LIBXML +#include "libxml.h" + +#include +#include + +/* + * xmlModulePlatformOpen: + * returns a handle on success, and zero on error. + */ + +void* xmlModulePlatformOpen(const char* name) +{ + void* handle; + handle = shl_load(name, BIND_IMMEDIATE, 0L); + return (handle); +} + +/* + * xmlModulePlatformClose: + * returns 0 on success, and non-zero on error. + */ + +int xmlModulePlatformClose(void* handle) +{ + int rc; + rc = shl_unload(handle); + return (rc); +} + +/* + * xmlModulePlatformSymbol: + * returns loaded symbol on success, and zero on error. + */ + +void* xmlModulePlatformSymbol(void* handle, const char* name) +{ + void* sym; + int rc; + + errno = 0; + rc = shl_findsym(handle, name, TYPE_PROCEDURE, &sym); + if (-1 == rc && 0 == errno) { + rc = shl_findsym(handle, sym, TYPE_DATA, &sym); + } + return (sym); +} diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xmlmodule-win32.c libxml2/xmlmodule-win32.c --- libxml2-orig/xmlmodule-win32.c 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/xmlmodule-win32.c 2004-10-19 21:51:38.000000000 -0400 @@ -0,0 +1,50 @@ +/* + * xmlmodule.c : + * + * See Copyright for the status of this software. + * + * joelwreed comcast net + */ + +#define IN_LIBXML +#include "libxml.h" + +#include +#include +#include + +/* + * xmlModulePlatformOpen: + * returns a handle on success, and zero on error. + */ + +void* xmlModulePlatformOpen(const char* name) +{ + void* handle; + handle = LoadLibrary(name); + return (handle); +} + +/* + * xmlModulePlatformClose: + * returns 0 on success, and non-zero on error. + */ + +int xmlModulePlatformClose(void* handle) +{ + int rc; + rc = FreeLibrary(handle); + return (rc); +} + +/* + * xmlModulePlatformSymbol: + * returns loaded symbol on success, and zero on error. + */ + +void* xmlModulePlatformSymbol(void* handle, const char* name) +{ + void* sym; + sym = GetProcAddress(handle, name); + return (sym); +} diff -up -X /home/jreed/src/lm-4.0/lm/do-not-diff -urNwbB libxml2-orig/xmlmodule.c libxml2/xmlmodule.c --- libxml2-orig/xmlmodule.c 1969-12-31 19:00:00.000000000 -0500 +++ libxml2/xmlmodule.c 2004-11-09 22:33:50.000000000 -0500 @@ -0,0 +1,142 @@ +/* + * xmlmodule.c : + * + * See Copyright for the status of this software. + * + * joelwreed comcast net + */ + +#define IN_LIBXML +#include "libxml.h" + +#include +#include +#include +#include +#include +#include + +struct _xmlModule { + unsigned char* name; + void* handle; +}; + +/************************************************************************ + * * + * module memory error handler * + * * + ************************************************************************/ +/** + * xmlModuleErrMemory: + * @extra: extra information + * + * Handle an out of memory condition + */ +static void +xmlModuleErrMemory(xmlModulePtr module, const char *extra) +{ + const char *name = NULL; + if (module != NULL) { + name = (const char *) module->name; + } + + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, extra, + name, NULL, 0, 0, + "Memory allocation failed : %s\n", extra); +} + +xmlModulePtr xmlModuleOpen(const char* name) +{ + xmlModulePtr module; + + module = (xmlModulePtr) xmlMalloc(sizeof(xmlModule)); + if (module == NULL) { + xmlModuleErrMemory(NULL, "creating module"); + return(NULL); + } + + memset(module, 0, sizeof(xmlModule)); + + module->handle = xmlModulePlatformOpen(name); + + if (module->handle == NULL) { + xmlFree(module); + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + name, NULL, 0, 0, + "failed to open %s\n", name); + return 0; + } + + module->name = xmlStrdup((const xmlChar*)name); + return (module); +} + +void* xmlModuleSymbol(xmlModulePtr module, const char* name) +{ + void* symbol; + + if (NULL == module) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + NULL, NULL, 0, 0, + "null module pointer\n", 0); + return 0; + } + + symbol = xmlModulePlatformSymbol(module->handle, name); + + if (symbol == 0) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + symbol, NULL, 0, 0, + "failed to find symbol: %s\n", 0); + return 0; + } + + return (symbol); +} + +int xmlModuleClose(xmlModulePtr module) +{ + int rc; + + if (NULL == module) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + NULL, NULL, 0, 0, + "null module pointer\n", 0); + return -1; + } + + rc = xmlModulePlatformClose(module->handle); + + if (rc != 0) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + (const char*)module->name, NULL, 0, 0, + "failed to close: %s\n", 0); + return -2; + } + + rc = xmlModuleFree(module); + return (rc); +} + +int xmlModuleFree(xmlModulePtr module) +{ + if (NULL == module) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + NULL, NULL, 0, 0, + "null module pointer\n", 0); + return -1; + } + + xmlFree(module->name); + xmlFree(module); + + return (0); +} +