Index: expat/Makefile.in =================================================================== RCS file: /cvsroot/tclxml/tclxml/expat/Makefile.in,v retrieving revision 1.8 diff -u -p -u -p -r1.8 Makefile.in --- expat/Makefile.in 9 Oct 2002 21:17:21 -0000 1.8 +++ expat/Makefile.in 3 Jun 2005 23:14:36 -0000 @@ -173,6 +173,7 @@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @TCL_INCLUDES@ \ + -I$(srcdir)/../include \ -I$(srcdir)/xmltok \ -I$(srcdir)/xmlparse \ -I$(srcdir)/xmlwf Index: include/tclxml-libxml2/tclxml-libxml2.h =================================================================== RCS file: /cvsroot/tclxml/tclxml/include/tclxml-libxml2/tclxml-libxml2.h,v retrieving revision 1.2 diff -u -p -u -p -r1.2 tclxml-libxml2.h --- include/tclxml-libxml2/tclxml-libxml2.h 3 Dec 2003 20:06:34 -0000 1.2 +++ include/tclxml-libxml2/tclxml-libxml2.h 3 Jun 2005 23:14:36 -0000 @@ -2,19 +2,13 @@ * * This module provides an interface to libxml2. * - * Copyright (c) 2003 Zveno Pty Ltd + * Copyright (c) 2003-2004 Zveno Pty Ltd * http://www.zveno.com/ * - * Zveno Pty Ltd makes this software and associated documentation - * available free of charge for any purpose. You may make copies - * of the software but you must include all of this notice on any copy. + * See the file "LICENSE" for information on usage and + * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * Zveno Pty Ltd does not warrant that this software is error free - * or fit for any purpose. Zveno Pty Ltd disclaims any liability for - * all claims, expenses, losses, damages and costs any user may incur - * as a result of using, copying or modifying the software. - * - * $Id: tclxml-libxml2.h,v 1.2 2003/12/03 20:06:34 balls Exp $ + * $Id: tcllibxml2.h,v 1.4 2004/07/09 03:09:32 balls Exp $ */ #ifndef TCLXML_LIBXML2_H @@ -84,7 +78,7 @@ EXTERN CONST char * TclXML_libxml2_I */ #define TclXML_libxml2_InitStubs(interp, version, exact) \ - Tcl_PkgRequire(interp, "xml::generic", version, exact) + Tcl_PkgRequire(interp, "xml::libxml2", version, exact) #endif Index: include/tclxml-libxml2/tclxml-libxml2Decls.h =================================================================== RCS file: /cvsroot/tclxml/tclxml/include/tclxml-libxml2/tclxml-libxml2Decls.h,v retrieving revision 1.3 diff -u -p -u -p -r1.3 tclxml-libxml2Decls.h --- include/tclxml-libxml2/tclxml-libxml2Decls.h 9 Jul 2004 03:09:27 -0000 1.3 +++ include/tclxml-libxml2/tclxml-libxml2Decls.h 3 Jun 2005 23:14:36 -0000 @@ -67,9 +67,9 @@ EXTERN void TclXML_libxml2_SetErrorNode Tcl_Interp * interp, TclXML_ErrorNodeHandlerProc * proc)); -typedef struct Tcllibxml2Stubs { +typedef struct Tclxml_libxml2Stubs { int magic; - struct Tcllibxml2StubHooks *hooks; + struct Tclxml_libxml2StubHooks *hooks; int (*tclxml_libxml2_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ void *reserved1; @@ -85,17 +85,17 @@ typedef struct Tcllibxml2Stubs { void (*tclXML_libxml2_ResetError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 11 */ Tcl_Obj * (*tclXML_libxml2_GetErrorObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 12 */ void (*tclXML_libxml2_SetErrorNodeFunc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_ErrorNodeHandlerProc * proc)); /* 13 */ -} Tcllibxml2Stubs; +} Tclxml_libxml2Stubs; #ifdef __cplusplus extern "C" { #endif -extern Tcllibxml2Stubs *tcllibxml2StubsPtr; +extern Tclxml_libxml2Stubs *tclxml_libxml2StubsPtr; #ifdef __cplusplus } #endif -#if defined(USE_TCLLIBXML2_STUBS) && !defined(USE_TCLLIBXML2_STUB_PROCS) +#if defined(USE_TCLXML_LIBXML2_STUBS) && !defined(USE_TCLXML_LIBXML2_STUB_PROCS) /* * Inline function declarations: @@ -103,59 +103,59 @@ extern Tcllibxml2Stubs *tcllibxml2StubsP #ifndef Tclxml_libxml2_Init #define Tclxml_libxml2_Init \ - (tcllibxml2StubsPtr->tclxml_libxml2_Init) /* 0 */ + (tclxml_libxml2StubsPtr->tclxml_libxml2_Init) /* 0 */ #endif /* Slot 1 is reserved */ #ifndef TclXML_libxml2_InitDocObj #define TclXML_libxml2_InitDocObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_InitDocObj) /* 2 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_InitDocObj) /* 2 */ #endif #ifndef TclXML_libxml2_NewDocObj #define TclXML_libxml2_NewDocObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_NewDocObj) /* 3 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_NewDocObj) /* 3 */ #endif #ifndef TclXML_libxml2_CreateObjFromDoc #define TclXML_libxml2_CreateObjFromDoc \ - (tcllibxml2StubsPtr->tclXML_libxml2_CreateObjFromDoc) /* 4 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_CreateObjFromDoc) /* 4 */ #endif #ifndef TclXML_libxml2_GetDocFromObj #define TclXML_libxml2_GetDocFromObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetDocFromObj) /* 5 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_GetDocFromObj) /* 5 */ #endif #ifndef TclXML_libxml2_GetTclDocFromObj #define TclXML_libxml2_GetTclDocFromObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetTclDocFromObj) /* 6 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_GetTclDocFromObj) /* 6 */ #endif #ifndef TclXML_libxml2_GetTclDocFromNode #define TclXML_libxml2_GetTclDocFromNode \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetTclDocFromNode) /* 7 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_GetTclDocFromNode) /* 7 */ #endif #ifndef TclXML_libxml2_DestroyDocument #define TclXML_libxml2_DestroyDocument \ - (tcllibxml2StubsPtr->tclXML_libxml2_DestroyDocument) /* 8 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_DestroyDocument) /* 8 */ #endif #ifndef TclXML_libxml2_DocKeep #define TclXML_libxml2_DocKeep \ - (tcllibxml2StubsPtr->tclXML_libxml2_DocKeep) /* 9 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_DocKeep) /* 9 */ #endif #ifndef TclXML_libxml2_ErrorHandler #define TclXML_libxml2_ErrorHandler \ - (tcllibxml2StubsPtr->tclXML_libxml2_ErrorHandler) /* 10 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_ErrorHandler) /* 10 */ #endif #ifndef TclXML_libxml2_ResetError #define TclXML_libxml2_ResetError \ - (tcllibxml2StubsPtr->tclXML_libxml2_ResetError) /* 11 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_ResetError) /* 11 */ #endif #ifndef TclXML_libxml2_GetErrorObj #define TclXML_libxml2_GetErrorObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetErrorObj) /* 12 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_GetErrorObj) /* 12 */ #endif #ifndef TclXML_libxml2_SetErrorNodeFunc #define TclXML_libxml2_SetErrorNodeFunc \ - (tcllibxml2StubsPtr->tclXML_libxml2_SetErrorNodeFunc) /* 13 */ + (tclxml_libxml2StubsPtr->tclXML_libxml2_SetErrorNodeFunc) /* 13 */ #endif -#endif /* defined(USE_TCLLIBXML2_STUBS) && !defined(USE_TCLLIBXML2_STUB_PROCS) */ +#endif /* defined(USE_TCLXML_LIBXML2_STUBS) && !defined(USE_TCLXML_LIBXML2_STUB_PROCS) */ /* !END!: Do not edit above this line. */ Index: libxml2/Makefile.in =================================================================== RCS file: /cvsroot/tclxml/tclxml/libxml2/Makefile.in,v retrieving revision 1.2 diff -u -p -u -p -r1.2 Makefile.in --- libxml2/Makefile.in 3 Dec 2003 20:06:35 -0000 1.2 +++ libxml2/Makefile.in 3 Jun 2005 23:14:36 -0000 @@ -33,6 +33,8 @@ FILEMAP = @FILEMAP@ TclXML_libxml2_SOURCES = \ tcllibxml2.c \ docObj.c \ + tcllibxml2StubInit.c \ + tcllibxml2StubLib.c \ @EXTRA_SOURCES@ WIN_SOURCES = @@ -52,7 +54,8 @@ UNIX_SOURCES = TclXML_libxml2_OBJECTS = $(TclXML_libxml2_SOURCES:.c=.@OBJEXT@) TclXML_libxml2_LIB_FILE = @TclXML_libxml2_LIB_FILE@ -Tclxml_STUB_LIB_FILE = @Tclxml_STUB_LIB_FILE@ +TclXML_libxml2stub_OBJECTS = tcllibxml2StubLib.$(OBJEXT) +TclXML_libxml2stub_LIB_FILE = @TclXML_libxml2stub_LIB_FILE@ #======================================================================== # RUNTIME_SOURCES identifies Tcl runtime files that are associated with @@ -92,8 +95,7 @@ ICONV_LIBDIR = @ICONV_LIBDIR@ # library that we are building. #======================================================================== -lib_BINARIES = $($(PACKAGE)_LIB_FILE) -## $($(PACKAGE)stub_LIB_FILE) +lib_BINARIES = $($(PACKAGE)_LIB_FILE) $($(PACKAGE)stub_LIB_FILE) BINARIES = $(lib_BINARIES) pkgIndex.tcl-hand SHELL = @SHELL@ @@ -139,6 +141,7 @@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ +RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ @@ -162,6 +165,7 @@ TCL_LIBS = @TCL_LIBS@ EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ LD_LIBRARY_PATH="$(EXTRA_PATH):$(LD_LIBRARY_PATH)" \ + DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ LIBPATH="$(EXTRA_PATH):${LIBPATH}" \ SHLIB_PATH="$(EXTRA_PATH):${SHLIB_PATH}" \ PATH="$(EXTRA_PATH):$(PATH)" \ @@ -173,7 +177,7 @@ SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @TCL_INCLUDES@ \ @TCLXML_INCLUDES@ \ -I$(LIBXML2_INCLUDEDIR) \ - -I../include + -I$(srcdir)/../include EXTRA_CFLAGS = $(MEM_DEBUG_FLAGS) @EXTRA_CFLAGS@ @@ -279,7 +283,7 @@ $($(PACKAGE)_LIB_FILE): $($(PACKAGE)_OBJ $($(PACKAGE)stub_LIB_FILE): $($(PACKAGE)stub_OBJECTS) -rm -f $($(PACKAGE)stub_LIB_FILE) ${MAKE_STUB_LIB} - $(RANLIB) $($(PACKAGE)stub_LIB_FILE) + $(RANLIB_STUB) $($(PACKAGE)stub_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. @@ -296,7 +300,7 @@ $($(PACKAGE)stub_LIB_FILE): $($(PACKAGE) # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== -VPATH = $(srcdir)/.. +VPATH = $(srcdir):$(srcdir)/.. .c.$(OBJEXT): $(COMPILE) -c `@CYGPATH@ $<` -o $@ @@ -413,8 +417,14 @@ install-lib-binaries: if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ @@ -431,6 +441,7 @@ install-lib-binaries: $(INSTALL_DATA) $(srcdir)/library/$$p $(DESTDIR)$(pkglibdir)/$$p; \ fi; \ done + $(INSTALL_DATA) tcllibxml2Config.sh $(DESTDIR)$(libdir)/tclxml_libxml2Config.sh #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) @@ -474,9 +485,15 @@ uninstall-binaries: #======================================================================== genstubs: + cd $(srcdir) && \ + cp -p tcllibxml2StubInit.c tclxml_libxml2StubInit.c && \ + cp -p ../include/tclxml-libxml2/tclxml-libxml2Decls.h tclxml_libxml2Decls.h $(TCLSH_PROG) \ - $(srcdir)/../tools/genStubs.tcl $(srcdir) \ - $(srcdir)/tcllibxml2.decls + $(srcdir)/../tcl/tools/genStubs.tcl $(srcdir) \ + $(TclXML_LIBXML2_DECLS) + cd $(srcdir) && \ + mv -f tclxml_libxml2StubInit.c tcllibxml2StubInit.c && \ + mv -f tclxml_libxml2Decls.h ../include/tclxml-libxml2/tclxml-libxml2Decls.h #======================================================================== # Index: libxml2/configure.in =================================================================== RCS file: /cvsroot/tclxml/tclxml/libxml2/configure.in,v retrieving revision 1.4 diff -u -p -u -p -r1.4 configure.in --- libxml2/configure.in 14 Aug 2004 07:41:11 -0000 1.4 +++ libxml2/configure.in 3 Jun 2005 23:14:36 -0000 @@ -270,6 +270,10 @@ do LIBXML2_LIBDIR="$d" break fi + if test -f "$d/libxml2.a" ; then + LIBXML2_LIBDIR="$d" + break + fi done if test "x$LIBXML2_LIBDIR" = "x"; then AC_MSG_ERROR([not found, please use --with-libxml2-lib]) @@ -347,29 +351,29 @@ TEA_PROG_TCLSH # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) eval pkglibdir="${libdir}/${PACKAGE}${VERSION}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval tcllibxml2_LIB_FLAG="-ltcllibxml2${VERSION}${DBGX}" + eval tclxml_libxml2_LIB_FLAG="-l${PACKAGE}${VERSION}${DBGX}" else - eval tcllibxml2_LIB_FLAG="-ltcllibxml2`echo ${VERSION} | tr -d .`${DBGX}" + eval tclxml_libxml2_LIB_FLAG="-l${PACKAGE}`echo ${VERSION} | tr -d .`${DBGX}" fi -tcllibxml2_BUILD_LIB_SPEC="-L`pwd` ${tcllibxml2_LIB_FLAG}" -tcllibxml2_LIB_SPEC="-L${pkglibdir} ${tcllibxml2_LIB_FLAG}" +tclxml_libxml2_BUILD_LIB_SPEC="-L`pwd` ${tclxml_libxml2_LIB_FLAG}" +tclxml_libxml2_LIB_SPEC="-L${pkglibdir} ${tclxml_libxml2_LIB_FLAG}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval tcllibxml2_STUB_LIB_FLAG="-ltcllibxml2stub${VERSION}${DBGX}" + eval tclxml_libxml2_STUB_LIB_FLAG="-l${PACKAGE}stub${VERSION}${DBGX}" else - eval tcllibxml2_STUB_LIB_FLAG="-ltcllibxml2stub`echo ${VERSION} | tr -d .`${DBGX}" + eval tclxml_libxml2_STUB_LIB_FLAG="-l${PACKAGE}stub`echo ${VERSION} | tr -d .`${DBGX}" fi -tcllibxml2_BUILD_STUB_LIB_SPEC="-L`pwd` ${tcllibxml2_STUB_LIB_FLAG}" -tcllibxml2_STUB_LIB_SPEC="-L${pkglibdir} ${tcllibxml2_STUB_LIB_FLAG}" -tcllibxml2_BUILD_STUB_LIB_PATH="`pwd`/${tcllibxmlstub2_LIB_FILE}" -tcllibxml2_STUB_LIB_PATH="${pkglibdir}/${tcllibxmlstub2_LIB_FILE}" - -AC_SUBST(tcllibxml2_BUILD_LIB_SPEC) -AC_SUBST(tcllibxml2_LIB_SPEC) -AC_SUBST(tcllibxml2_BUILD_STUB_LIB_SPEC) -AC_SUBST(tcllibxml2_STUB_LIB_SPEC) -AC_SUBST(tcllibxml2_BUILD_STUB_LIB_PATH) -AC_SUBST(tcllibxml2_STUB_LIB_PATH) +tclxml_libxml2_BUILD_STUB_LIB_SPEC="-L`pwd` ${tclxml_libxml2_STUB_LIB_FLAG}" +tclxml_libxml2_STUB_LIB_SPEC="-L${pkglibdir} ${tclxml_libxml2_STUB_LIB_FLAG}" +tclxml_libxml2_BUILD_STUB_LIB_PATH="`pwd`/${tcllibxmlstub2_LIB_FILE}" +tclxml_libxml2_STUB_LIB_PATH="${pkglibdir}/${tcllibxmlstub2_LIB_FILE}" + +AC_SUBST(tclxml_libxml2_BUILD_LIB_SPEC) +AC_SUBST(tclxml_libxml2_LIB_SPEC) +AC_SUBST(tclxml_libxml2_BUILD_STUB_LIB_SPEC) +AC_SUBST(tclxml_libxml2_STUB_LIB_SPEC) +AC_SUBST(tclxml_libxml2_BUILD_STUB_LIB_PATH) +AC_SUBST(tclxml_libxml2_STUB_LIB_PATH) AC_SUBST(MAJOR_VERSION) AC_SUBST(MINOR_VERSION) Index: libxml2/tcllibxml2.c =================================================================== RCS file: /cvsroot/tclxml/tclxml/libxml2/tcllibxml2.c,v retrieving revision 1.9 diff -u -p -u -p -r1.9 tcllibxml2.c --- libxml2/tcllibxml2.c 20 May 2005 12:02:18 -0000 1.9 +++ libxml2/tcllibxml2.c 3 Jun 2005 23:14:36 -0000 @@ -189,15 +189,11 @@ Tclxml_libxml2_Init (interp) TclXML_libxml2_InitDocObj(interp); - /* - * TclExpat doesn't attempt to use the stubs API, so follow suit (for now). #if TCL_DOES_STUBS - */ - #if 0 { - extern Tcllibxml2Stubs tcllibxml2Stubs; + extern Tclxml_libxml2Stubs tclxml_libxml2Stubs; if (Tcl_PkgProvideEx(interp, "xml::libxml2", TCLXML_LIBXML2_VERSION, - (ClientData) &tcllibxml2Stubs) != TCL_OK) { + (ClientData) &tclxml_libxml2Stubs) != TCL_OK) { return TCL_ERROR; } } Index: libxml2/tcllibxml2.decls =================================================================== RCS file: /cvsroot/tclxml/tclxml/libxml2/tcllibxml2.decls,v retrieving revision 1.2 diff -u -p -u -p -r1.2 tcllibxml2.decls --- libxml2/tcllibxml2.decls 3 Dec 2003 20:06:35 -0000 1.2 +++ libxml2/tcllibxml2.decls 3 Jun 2005 23:14:36 -0000 @@ -10,11 +10,11 @@ # interface. Note that the an index should never be reused for a # different function in order to preserve backwards compatibility. -library tcllibxml2 +library tclxml_libxml2 # Define the TclXML/libxml2 interface: -interface tcllibxml2 +interface tclxml_libxml2 #hooks {} declare 0 generic { Index: libxml2/tcllibxml2.h =================================================================== RCS file: libxml2/tcllibxml2.h diff -N libxml2/tcllibxml2.h --- libxml2/tcllibxml2.h 9 Jul 2004 03:09:32 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,102 +0,0 @@ -/* tcllibxml2.h -- - * - * This module provides an interface to libxml2. - * - * Copyright (c) 2003-2004 Zveno Pty Ltd - * http://www.zveno.com/ - * - * See the file "LICENSE" for information on usage and - * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id: tcllibxml2.h,v 1.4 2004/07/09 03:09:32 balls Exp $ - */ - -#ifndef TCLXML_LIBXML2_H -#define TCLXML_LIBXML2_H - -#ifdef TCLXML_BUILD_AS_FRAMEWORK -#include -#else -#include -#endif /* TCLXML_BUILD_AS_FRAMEWORK */ -#include -#include "docObj.h" - -/* - * For C++ compilers, use extern "C" - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * These macros are used to control whether functions are being declared for - * import or export in Windows, - * They map to no-op declarations on non-Windows systems. - * Assumes that tcl.h defines DLLEXPORT & DLLIMPORT correctly. - * The default build on windows is for a DLL, which causes the DLLIMPORT - * and DLLEXPORT macros to be nonempty. To build a static library, the - * macro STATIC_BUILD should be defined before the inclusion of tcl.h - * - * If a function is being declared while it is being built - * to be included in a shared library, then it should have the DLLEXPORT - * storage class. If is being declared for use by a module that is going to - * link against the shared library, then it should have the DLLIMPORT storage - * class. If the symbol is beind declared for a static build or for use from a - * stub library, then the storage class should be empty. - * - * The convention is that a macro called BUILD_xxxx, where xxxx is the - * name of a library we are building, is set on the compile line for sources - * that are to be placed in the library. When this macro is set, the - * storage class will be set to DLLEXPORT. At the end of the header file, the - * storage class will be reset to DLLIMPORt. - */ - -#undef TCL_STORAGE_CLASS -#ifdef BUILD_TclXML_libxml2 -# define TCL_STORAGE_CLASS DLLEXPORT -#else -# ifdef USE_TCL_STUBS -# define TCL_STORAGE_CLASS -# else -# define TCL_STORAGE_CLASS DLLIMPORT -# endif -#endif - -/* - * The following function is required to be defined in all stubs aware - * extensions of TclXML/libxml2. The function is actually implemented in the stub - * library, not the main TclXML/libxml2 library, although there is a trivial - * implementation in the main library in case an extension is statically - * linked into an application. - */ - -EXTERN CONST char * TclXML_libxml2_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *version, int exact)); - -#ifndef USE_TCLXML_LIBXML2_STUBS - -/* - * When not using stubs, make it a macro. - */ - -#define TclXML_libxml2_InitStubs(interp, version, exact) \ - Tcl_PkgRequire(interp, "xml::generic", version, exact) - -#endif - -/* - * Accessor functions => Stubs - */ - -#include "tcllibxml2Decls.h" - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#ifdef __cplusplus -} -#endif - -#endif /* TCLXML_LIBXML2_H */ Index: libxml2/tcllibxml2Config.sh.in =================================================================== RCS file: /cvsroot/tclxml/tclxml/libxml2/tcllibxml2Config.sh.in,v retrieving revision 1.2 diff -u -p -u -p -r1.2 tcllibxml2Config.sh.in --- libxml2/tcllibxml2Config.sh.in 3 Dec 2003 20:06:35 -0000 1.2 +++ libxml2/tcllibxml2Config.sh.in 3 Jun 2005 23:14:36 -0000 @@ -18,7 +18,7 @@ tclxml_libxml2_MINOR_VERSION='@MINOR_VER tclxml_libxml2_RELEASE_LEVEL='@PATCHLEVEL@' # The name of the TclXML/libxml2 library (may be either a .a file or a shared library): -tclxml_libxml2_LIB_FILE=@tcldomxml_LIB_FILE@ +tclxml_libxml2_LIB_FILE=@TclXML_libxml2_LIB_FILE@ # String to pass to linker to pick up the tcldomxml library from its # build directory. @@ -29,7 +29,7 @@ tclxml_libxml2_BUILD_LIB_SPEC='@tclxml_l tclxml_libxml2_LIB_SPEC='@tclxml_libxml2_LIB_SPEC@' # The name of the TclXML/libxml2 stub library (a .a file): -tclxml_libxml2_STUB_LIB_FILE=@tclxml_libxml2_stub_LIB_FILE@ +tclxml_libxml2_STUB_LIB_FILE=@TclXML_libxml2stub_LIB_FILE@ # String to pass to linker to pick up the TclXML/libxml2 stub library from its # build directory. Index: libxml2/tcllibxml2Decls.h =================================================================== RCS file: libxml2/tcllibxml2Decls.h diff -N libxml2/tcllibxml2Decls.h --- libxml2/tcllibxml2Decls.h 3 Dec 2003 20:06:35 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,129 +0,0 @@ -/* - * tcllibxml2Decls.h -- - * - * Declarations of functions in the platform independent public TCLXML/libxml2 API. - * - */ - -#ifndef _TCLXMLLIBXML2DECLS -#define _TCLXMLLIBXML2DECLS - -/* - * WARNING: The contents of this file is automatically generated by the - * genStubs.tcl script. Any modifications to the function declarations - * below should be made in the tcllibxml2.decls script. - */ - -#include "docObj.h" - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -/* 0 */ -EXTERN int Tclxml_libxml2_Init _ANSI_ARGS_((Tcl_Interp * interp)); -/* Slot 1 is reserved */ -/* 2 */ -EXTERN int TclXML_libxml2_InitDocObj _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 3 */ -EXTERN Tcl_Obj * TclXML_libxml2_NewDocObj _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 4 */ -EXTERN Tcl_Obj * TclXML_libxml2_CreateObjFromDoc _ANSI_ARGS_(( - xmlDocPtr docPtr)); -/* 5 */ -EXTERN int TclXML_libxml2_GetDocFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - xmlDocPtr * docPtr)); -/* 6 */ -EXTERN int TclXML_libxml2_GetTclDocFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - TclXML_libxml2_Document ** tDocPtrPtr)); -/* 7 */ -EXTERN int TclXML_libxml2_GetTclDocFromNode _ANSI_ARGS_(( - Tcl_Interp * interp, xmlNodePtr nodePtr, - TclXML_libxml2_Document ** tDocPtrPtr)); -/* 8 */ -EXTERN void TclXML_libxml2_DestroyDocument _ANSI_ARGS_(( - TclXML_libxml2_Document * tDocPtr)); -/* 9 */ -EXTERN void TclXML_libxml2_DocKeep _ANSI_ARGS_((Tcl_Obj * objPtr, - TclXML_libxml2_DocumentHandling keep)); - -typedef struct Tcllibxml2Stubs { - int magic; - struct Tcllibxml2StubHooks *hooks; - - int (*tclxml_libxml2_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ - void *reserved1; - int (*tclXML_libxml2_InitDocObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 2 */ - Tcl_Obj * (*tclXML_libxml2_NewDocObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 3 */ - Tcl_Obj * (*tclXML_libxml2_CreateObjFromDoc) _ANSI_ARGS_((xmlDocPtr docPtr)); /* 4 */ - int (*tclXML_libxml2_GetDocFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, xmlDocPtr * docPtr)); /* 5 */ - int (*tclXML_libxml2_GetTclDocFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 6 */ - int (*tclXML_libxml2_GetTclDocFromNode) _ANSI_ARGS_((Tcl_Interp * interp, xmlNodePtr nodePtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 7 */ - void (*tclXML_libxml2_DestroyDocument) _ANSI_ARGS_((TclXML_libxml2_Document * tDocPtr)); /* 8 */ - void (*tclXML_libxml2_DocKeep) _ANSI_ARGS_((Tcl_Obj * objPtr, TclXML_libxml2_DocumentHandling keep)); /* 9 */ -} Tcllibxml2Stubs; - -#ifdef __cplusplus -extern "C" { -#endif -extern Tcllibxml2Stubs *tcllibxml2StubsPtr; -#ifdef __cplusplus -} -#endif - -#if defined(USE_TCLLIBXML2_STUBS) && !defined(USE_TCLLIBXML2_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#ifndef Tclxml_libxml2_Init -#define Tclxml_libxml2_Init \ - (tcllibxml2StubsPtr->tclxml_libxml2_Init) /* 0 */ -#endif -/* Slot 1 is reserved */ -#ifndef TclXML_libxml2_InitDocObj -#define TclXML_libxml2_InitDocObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_InitDocObj) /* 2 */ -#endif -#ifndef TclXML_libxml2_NewDocObj -#define TclXML_libxml2_NewDocObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_NewDocObj) /* 3 */ -#endif -#ifndef TclXML_libxml2_CreateObjFromDoc -#define TclXML_libxml2_CreateObjFromDoc \ - (tcllibxml2StubsPtr->tclXML_libxml2_CreateObjFromDoc) /* 4 */ -#endif -#ifndef TclXML_libxml2_GetDocFromObj -#define TclXML_libxml2_GetDocFromObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetDocFromObj) /* 5 */ -#endif -#ifndef TclXML_libxml2_GetTclDocFromObj -#define TclXML_libxml2_GetTclDocFromObj \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetTclDocFromObj) /* 6 */ -#endif -#ifndef TclXML_libxml2_GetTclDocFromNode -#define TclXML_libxml2_GetTclDocFromNode \ - (tcllibxml2StubsPtr->tclXML_libxml2_GetTclDocFromNode) /* 7 */ -#endif -#ifndef TclXML_libxml2_DestroyDocument -#define TclXML_libxml2_DestroyDocument \ - (tcllibxml2StubsPtr->tclXML_libxml2_DestroyDocument) /* 8 */ -#endif -#ifndef TclXML_libxml2_DocKeep -#define TclXML_libxml2_DocKeep \ - (tcllibxml2StubsPtr->tclXML_libxml2_DocKeep) /* 9 */ -#endif - -#endif /* defined(USE_TCLLIBXML2_STUBS) && !defined(USE_TCLLIBXML2_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _TCLXMLLLIBXML2DECLS */ - Index: libxml2/tcllibxml2StubInit.c =================================================================== RCS file: /cvsroot/tclxml/tclxml/libxml2/tcllibxml2StubInit.c,v retrieving revision 1.2 diff -u -p -u -p -r1.2 tcllibxml2StubInit.c --- libxml2/tcllibxml2StubInit.c 3 Dec 2003 20:06:35 -0000 1.2 +++ libxml2/tcllibxml2StubInit.c 3 Jun 2005 23:14:36 -0000 @@ -17,7 +17,7 @@ /* !BEGIN!: Do not edit below this line. */ -Tcllibxml2Stubs tcllibxml2Stubs = { +Tclxml_libxml2Stubs tclxml_libxml2Stubs = { TCL_STUB_MAGIC, NULL, Tclxml_libxml2_Init, /* 0 */ Index: libxml2/tcllibxml2StubLib.c =================================================================== RCS file: libxml2/tcllibxml2StubLib.c diff -N libxml2/tcllibxml2StubLib.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ libxml2/tcllibxml2StubLib.c 3 Jun 2005 23:14:36 -0000 @@ -0,0 +1,68 @@ +/* + * tcllibxml2StubInit.c -- + * + * Stub object that will be statically linked into extensions that wish + * to access the TCLXML API. + * + * Copyright (c) 1998 Paul Duffin. + * Copyright (c) 1998-1999 by Scriptics Corporation. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: tcllibxml2StubInit.c,v 1.2 2003/12/03 20:18:44 balls Exp $ + */ + +#ifndef USE_TCL_STUBS +#define USE_TCL_STUBS +#endif + +#include + +Tclxml_libxml2Stubs *tclxml_libxml2StubsPtr; + +/* + *---------------------------------------------------------------------- + * + * TclXML_libxml2_InitStubs -- + * + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + +#ifdef TclXML_libxml2_InitStubs +#undef TclXML_libxml2_InitStubs +#endif + +CONST char * +TclXML_libxml2_InitStubs(interp, version, exact) + Tcl_Interp *interp; + CONST char *version; + int exact; +{ + CONST char *result; + + /* HACK: de-CONST 'version' if compiled against 8.3. + * The API has no CONST despite not modifying the argument + * And a debug build with high warning-level on windows + * will abort the compilation. + */ + +#if ((TCL_MAJOR_VERSION < 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 4))) +#define UNCONST (char*) +#else +#define UNCONST +#endif + + result = Tcl_PkgRequireEx(interp, "xml::libxml2", UNCONST version, exact, + (ClientData *) &tclxml_libxml2StubsPtr); + if (!result || !tclxml_libxml2StubsPtr) { + return (char *) NULL; + } + + return result; +} +#undef UNCONST