diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/Makefile.am | 4 | ||||
-rw-r--r-- | python/Makefile.in | 53 | ||||
-rw-r--r-- | python/TODO | 0 | ||||
-rw-r--r-- | python/libxslt.c | 37 | ||||
-rw-r--r-- | python/tests/Makefile.am | 11 | ||||
-rw-r--r-- | python/tests/Makefile.in | 29 | ||||
-rwxr-xr-x | python/tests/basic.py | 1 | ||||
-rwxr-xr-x | python/tests/exslt.py | 1 | ||||
-rw-r--r-- | python/tests/extelem.py | 1 | ||||
-rwxr-xr-x | python/tests/extfunc.py | 1 | ||||
-rwxr-xr-x | python/tests/pyxsltproc.py | 4 |
11 files changed, 99 insertions, 43 deletions
diff --git a/python/Makefile.am b/python/Makefile.am index fa58b78f..17a0d17c 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -7,7 +7,7 @@ AM_CFLAGS = $(LIBXML_CFLAGS) DOCS_DIR = $(datadir)/doc/libxslt-python-$(LIBXSLT_VERSION) # libxsltclass.txt is generated -DOCS = TODO +DOCS= EXTRA_DIST = \ libxslt.c \ @@ -19,7 +19,7 @@ EXTRA_DIST = \ libxslt-python-api.xml \ $(DOCS) -libxsltmod_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -module -avoid-version +libxsltmod_la_LDFLAGS = -module -avoid-version if WITH_PYTHON mylibs = \ diff --git a/python/Makefile.in b/python/Makefile.in index 58590f73..00c80a05 100644 --- a/python/Makefile.in +++ b/python/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -159,7 +159,10 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libxsltmod_la-libxslt-py.Plo \ + ./$(DEPDIR)/libxsltmod_la-libxslt.Plo \ + ./$(DEPDIR)/libxsltmod_la-types.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -201,7 +204,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -222,7 +225,7 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp TODO +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -278,6 +281,7 @@ EXEEXT = @EXEEXT@ EXSLT_INCLUDEDIR = @EXSLT_INCLUDEDIR@ EXSLT_LIBDIR = @EXSLT_LIBDIR@ EXSLT_LIBS = @EXSLT_LIBS@ +EXSLT_PRIVATE_LIBS = @EXSLT_PRIVATE_LIBS@ EXTRA_LIBS = @EXTRA_LIBS@ FGREP = @FGREP@ GREP = @GREP@ @@ -357,12 +361,11 @@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ VERSION = @VERSION@ VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_CRYPTO = @WITH_CRYPTO@ WITH_DEBUGGER = @WITH_DEBUGGER@ WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ WITH_MODULES = @WITH_MODULES@ +WITH_PROFILER = @WITH_PROFILER@ WITH_TRIO = @WITH_TRIO@ WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@ XMLLINT = @XMLLINT@ @@ -372,6 +375,7 @@ XSLTPROCDV = @XSLTPROCDV@ XSLT_INCLUDEDIR = @XSLT_INCLUDEDIR@ XSLT_LIBDIR = @XSLT_LIBDIR@ XSLT_LIBS = @XSLT_LIBS@ +XSLT_PRIVATE_LIBS = @XSLT_PRIVATE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -432,7 +436,7 @@ SUBDIRS = . tests AM_CFLAGS = $(LIBXML_CFLAGS) DOCS_DIR = $(datadir)/doc/libxslt-python-$(LIBXSLT_VERSION) # libxsltclass.txt is generated -DOCS = TODO +DOCS = EXTRA_DIST = \ libxslt.c \ types.c \ @@ -443,7 +447,7 @@ EXTRA_DIST = \ libxslt-python-api.xml \ $(DOCS) -libxsltmod_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -module -avoid-version +libxsltmod_la_LDFLAGS = -module -avoid-version @WITH_PYTHON_TRUE@mylibs = \ @WITH_PYTHON_TRUE@ $(top_builddir)/libxslt/libxslt.la \ @WITH_PYTHON_TRUE@ $(top_builddir)/libexslt/libexslt.la @@ -488,8 +492,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -545,9 +549,15 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsltmod_la-libxslt-py.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsltmod_la-libxslt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsltmod_la-types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsltmod_la-libxslt-py.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsltmod_la-libxslt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsltmod_la-types.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -696,7 +706,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -799,7 +812,9 @@ clean-am: clean-generic clean-libtool clean-pythonLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libxsltmod_la-libxslt-py.Plo + -rm -f ./$(DEPDIR)/libxsltmod_la-libxslt.Plo + -rm -f ./$(DEPDIR)/libxsltmod_la-types.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -845,7 +860,9 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libxsltmod_la-libxslt-py.Plo + -rm -f ./$(DEPDIR)/libxsltmod_la-libxslt.Plo + -rm -f ./$(DEPDIR)/libxsltmod_la-types.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -867,7 +884,7 @@ uninstall-am: uninstall-local uninstall-pythonLTLIBRARIES .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ - check check-am clean clean-generic clean-libtool \ + am--depfiles check check-am clean clean-generic clean-libtool \ clean-pythonLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ diff --git a/python/TODO b/python/TODO deleted file mode 100644 index e69de29b..00000000 --- a/python/TODO +++ /dev/null diff --git a/python/libxslt.c b/python/libxslt.c index b1fb18de..f8371b7b 100644 --- a/python/libxslt.c +++ b/python/libxslt.c @@ -23,8 +23,29 @@ #include <stdio.h> #include <stddef.h> -#if (defined(_MSC_VER) || defined(__MINGW32__)) && !defined(vsnprintf) -#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) +#ifdef _MSC_VER + +/* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */ +#if _MSC_VER < 1900 + +#include <stdarg.h> + +#define vsnprintf c99_vsnprintf + +__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) +{ + int count = -1; + + if (size != 0) + count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); + if (count == -1) + count = _vscprintf(format, ap); + + return count; +} + +#endif /* _MSC_VER < 1900 */ + #elif defined(XSLT_NEED_TRIO) #include "trio.h" #define vsnprintf trio_vsnprintf @@ -180,7 +201,7 @@ static xmlHashTablePtr libxslt_extModuleElements = NULL; static xmlHashTablePtr libxslt_extModuleElementPreComp = NULL; static void -deallocateCallback(void *payload, xmlChar *name ATTRIBUTE_UNUSED) { +deallocateCallback(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { PyObject *function = (PyObject *) payload; #ifdef DEBUG_EXTENSIONS @@ -191,7 +212,7 @@ deallocateCallback(void *payload, xmlChar *name ATTRIBUTE_UNUSED) { } static void -deallocateClasse(void *payload, xmlChar *name ATTRIBUTE_UNUSED) { +deallocateClasse(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) { PyObject *class = (PyObject *) payload; #ifdef DEBUG_EXTENSIONS @@ -1127,10 +1148,10 @@ libxslt_xsltRegisterExtensionClass(PyObject *self ATTRIBUTE_UNUSED, Py_XINCREF(pyobj_c); ret = xsltRegisterExtModuleFull(ns_uri, - (xsltExtInitFunction) libxslt_xsltPythonExtModuleCtxtInit, - (xsltExtShutdownFunction) libxslt_xsltPythonExtModuleCtxtShutdown, - (xsltStyleExtInitFunction) libxslt_xsltPythonExtModuleStyleInit, - (xsltStyleExtShutdownFunction) libxslt_xsltPythonExtModuleStyleShutdown); + libxslt_xsltPythonExtModuleCtxtInit, + libxslt_xsltPythonExtModuleCtxtShutdown, + libxslt_xsltPythonExtModuleStyleInit, + libxslt_xsltPythonExtModuleStyleShutdown); py_retval = libxml_intWrap((int) ret); if (ret < 0) { Py_XDECREF(pyobj_c); diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index f757774f..cb186745 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -19,10 +19,15 @@ CLEANFILES = *.pyc core if WITH_PYTHON tests: $(TESTSPY) - -@(PYTHONPATH="`pwd`/..:`pwd`/../.libs:$(srcdir)/.."; \ - if test "x$(LIBXML_SRC)" != "x" ; then PYTHONPATH="$$PYTHONPATH:$(LIBXML_SRC)/python:$(LIBXML_SRC)/python/.libs"; fi; \ + @(PYTHONPATH="`pwd`/..:`pwd`/../.libs:$(srcdir)/.."; \ + if test "x$(LIBXML_SRC)" != "x" ; then \ + PYTHONPATH="$$PYTHONPATH:$(LIBXML_SRC)/python:$(LIBXML_SRC)/python/.libs"; \ + fi; \ export PYTHONPATH; \ - for test in $(TESTSPY) ; do echo "-- $$test" ; (cd $(srcdir) && $(PYTHON) $$test ); done) + for test in $(TESTSPY) ; do \ + echo "-- $$test" ; \ + (cd $(srcdir) && $(PYTHON) $$test ) || exit 1; \ + done) else tests: endif diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in index 55e5b523..30d2ea21 100644 --- a/python/tests/Makefile.in +++ b/python/tests/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -148,6 +148,7 @@ EXEEXT = @EXEEXT@ EXSLT_INCLUDEDIR = @EXSLT_INCLUDEDIR@ EXSLT_LIBDIR = @EXSLT_LIBDIR@ EXSLT_LIBS = @EXSLT_LIBS@ +EXSLT_PRIVATE_LIBS = @EXSLT_PRIVATE_LIBS@ EXTRA_LIBS = @EXTRA_LIBS@ FGREP = @FGREP@ GREP = @GREP@ @@ -227,12 +228,11 @@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ VERSION = @VERSION@ VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_CRYPTO = @WITH_CRYPTO@ WITH_DEBUGGER = @WITH_DEBUGGER@ WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ WITH_MODULES = @WITH_MODULES@ +WITH_PROFILER = @WITH_PROFILER@ WITH_TRIO = @WITH_TRIO@ WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@ XMLLINT = @XMLLINT@ @@ -242,6 +242,7 @@ XSLTPROCDV = @XSLTPROCDV@ XSLT_INCLUDEDIR = @XSLT_INCLUDEDIR@ XSLT_LIBDIR = @XSLT_LIBDIR@ XSLT_LIBS = @XSLT_LIBS@ +XSLT_PRIVATE_LIBS = @XSLT_PRIVATE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -331,8 +332,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -356,7 +357,10 @@ ctags CTAGS: cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -506,10 +510,15 @@ uninstall-am: @WITH_PYTHON_TRUE@tests: $(TESTSPY) -@WITH_PYTHON_TRUE@ -@(PYTHONPATH="`pwd`/..:`pwd`/../.libs:$(srcdir)/.."; \ -@WITH_PYTHON_TRUE@ if test "x$(LIBXML_SRC)" != "x" ; then PYTHONPATH="$$PYTHONPATH:$(LIBXML_SRC)/python:$(LIBXML_SRC)/python/.libs"; fi; \ +@WITH_PYTHON_TRUE@ @(PYTHONPATH="`pwd`/..:`pwd`/../.libs:$(srcdir)/.."; \ +@WITH_PYTHON_TRUE@ if test "x$(LIBXML_SRC)" != "x" ; then \ +@WITH_PYTHON_TRUE@ PYTHONPATH="$$PYTHONPATH:$(LIBXML_SRC)/python:$(LIBXML_SRC)/python/.libs"; \ +@WITH_PYTHON_TRUE@ fi; \ @WITH_PYTHON_TRUE@ export PYTHONPATH; \ -@WITH_PYTHON_TRUE@ for test in $(TESTSPY) ; do echo "-- $$test" ; (cd $(srcdir) && $(PYTHON) $$test ); done) +@WITH_PYTHON_TRUE@ for test in $(TESTSPY) ; do \ +@WITH_PYTHON_TRUE@ echo "-- $$test" ; \ +@WITH_PYTHON_TRUE@ (cd $(srcdir) && $(PYTHON) $$test ) || exit 1; \ +@WITH_PYTHON_TRUE@ done) @WITH_PYTHON_FALSE@tests: install-data-local: diff --git a/python/tests/basic.py b/python/tests/basic.py index 89a57ac1..4a60590b 100755 --- a/python/tests/basic.py +++ b/python/tests/basic.py @@ -27,3 +27,4 @@ if libxml2.debugMemory(1) == 0: else: print "Memory leak %d bytes" % (libxml2.debugMemory(1)) libxml2.dumpMemory() + sys.exit(255) diff --git a/python/tests/exslt.py b/python/tests/exslt.py index c64b2e43..c7333efb 100755 --- a/python/tests/exslt.py +++ b/python/tests/exslt.py @@ -54,3 +54,4 @@ if libxml2.debugMemory(1) == 0: else: print "Memory leak %d bytes" % (libxml2.debugMemory(1)) libxml2.dumpMemory() + sys.exit(255) diff --git a/python/tests/extelem.py b/python/tests/extelem.py index 3364d01a..16635174 100644 --- a/python/tests/extelem.py +++ b/python/tests/extelem.py @@ -87,3 +87,4 @@ if libxml2.debugMemory(1) == 0: else: print "Memory leak %d bytes" % (libxml2.debugMemory(1)) libxml2.dumpMemory() + sys.exit(255) diff --git a/python/tests/extfunc.py b/python/tests/extfunc.py index 0a559531..fc6040b3 100755 --- a/python/tests/extfunc.py +++ b/python/tests/extfunc.py @@ -64,3 +64,4 @@ if libxml2.debugMemory(1) == 0: else: print "Memory leak %d bytes" % (libxml2.debugMemory(1)) libxml2.dumpMemory() + sys.exit(255) diff --git a/python/tests/pyxsltproc.py b/python/tests/pyxsltproc.py index 238fa5b4..58434709 100755 --- a/python/tests/pyxsltproc.py +++ b/python/tests/pyxsltproc.py @@ -123,7 +123,7 @@ def usage(name = 'pyxsltproc'): print "\t otherwise XML Catalogs starting from " print "\t file:///etc/xml/catalog are activated by default" print "\t--xinclude : do XInclude processing on document input" - print "\t--profile or --norman : dump profiling informations " + print "\t--profile or --norman : dump profiling information " print "\nProject libxslt home page: http://xmlsoft.org/XSLT/" print "To report bugs and get help: http://xmlsoft.org/XSLT/bugs.html" @@ -166,7 +166,7 @@ def main(args = None): print "TODO: xsltSetGenericDebugFunc() mapping missing" elif args[i] == "-version" or args[i] == "--version" or \ args[i] == "-V": - print "TODO: version informations mapping missing" + print "TODO: version information mapping missing" elif args[i] == "-verbose" or args[i] == "--verbose" or \ args[i] == "-v": if repeat == 0: |