libxml2-32.13

This commit is contained in:
Ariel Abreu 2020-07-01 10:58:33 -04:00
parent b33af038d4
commit 9ea73296ce
No known key found for this signature in database
GPG Key ID: F4D43CC7053EA2B3
4770 changed files with 60952 additions and 1984 deletions

View File

@ -0,0 +1,68 @@
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_CONFIG_H _REENTRANT;
// GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LINKER_DISPLAYS_MANGLED_NAMES = YES;
PREBINDING = NO;
// WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings;
WARNING_CFLAGS = -Wformat=2 -Wformat-security -Wmissing-format-attribute;
STRIP_INSTALLED_PRODUCT = YES;
HEADER_SEARCH_PATHS = $(LIBXML2_HEADER_PATH);
LIBXML2_HEADER_PATH = $(LIBXML2_HEADER_PATH_$(DEPLOYMENT_LOCATION));
LIBXML2_HEADER_PATH_NO = $(SYMROOT)/$(CONFIGURATION)/usr/include/libxml2;
LIBXML2_HEADER_PATH_YES = $(DSTROOT)/usr/include/libxml2;
DEBUG_DEFINES = $(DEBUG_DEFINES_$(CONFIGURATION));
DEBUG_DEFINES_Debug = ;
DEBUG_DEFINES_Release = NDEBUG;
DEBUG_DEFINES_Production = $(DEBUG_DEFINES_Release);
GCC_OPTIMIZATION_LEVEL = $(GCC_OPTIMIZATION_LEVEL_$(CONFIGURATION));
GCC_OPTIMIZATION_LEVEL_Debug = 0;
GCC_OPTIMIZATION_LEVEL_Release = s;
GCC_OPTIMIZATION_LEVEL_Production = $(GCC_OPTIMIZATION_LEVEL_Release);
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = $(DEAD_CODE_STRIPPING_$(CONFIGURATION));
DEAD_CODE_STRIPPING_Release = YES;
DEAD_CODE_STRIPPING_Production = $(DEAD_CODE_STRIPPING_Release);
SDKROOT = macosx.internal;
ALWAYS_SEARCH_USER_PATHS = NO;
SUPPORTED_PLATFORMS = appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator;

View File

@ -0,0 +1,7 @@
#include "Base.xcconfig"
ONLY_ACTIVE_ARCH = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
ENABLE_TESTABILITY = YES;

View File

@ -0,0 +1,2 @@
PRODUCT_NAME = $(TARGET_NAME);
INSTALL_PATH = /usr/bin;

View File

@ -0,0 +1,17 @@
PRODUCT_NAME = $(TARGET_NAME);
INSTALL_PATH = /usr/local/libexec/libxml2;
DEAD_CODE_STRIPPING = NO;
PRODUCTION_ROOT[sdk=iphone*] = $(SDKROOT);
PRODUCTION_ROOT[sdk=macosx*] = $(NEXT_ROOT);
// Please override LIBFUZZER_STATIC_LIBRARY when buliding until this is fixed:
// <rdar://problem/30923642> Make libFuzzer available within Xcode internal toolchains
LIBFUZZER_STATIC_LIBRARY = $(TOOLCHAIN_DIR)/usr/local/lib/libFuzzer.a;
LIBXML2_STATIC_LIBRARY = $(LIBXML2_STATIC_LIBRARY_$(CONFIGURATION));
LIBXML2_STATIC_LIBRARY_Debug = $(BUILT_PRODUCTS_DIR)/libxml2.a;
LIBXML2_STATIC_LIBRARY_Release = $(BUILT_PRODUCTS_DIR)/libxml2.a;
LIBXML2_STATIC_LIBRARY_Production = $(PRODUCTION_ROOT)/usr/local/lib/libxml2/libxml2.a;
OTHER_LDFLAGS = $(inherited) $(LIBXML2_STATIC_LIBRARY) $(LIBFUZZER_STATIC_LIBRARY) -licucore -lz;

View File

@ -0,0 +1,18 @@
INFOPLIST_FILE = Libxml2XCTests/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.libxml2.Libxml2XCTests;
PRODUCT_NAME = $(TARGET_NAME);
WRAPPER_EXTENSION = xctest;
ENABLE_NS_ASSERTIONS = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";

View File

@ -0,0 +1,9 @@
PRODUCT_NAME = $(TARGET_NAME);
INSTALL_PATH = /usr/local/libexec/libxml2;
// Override HEADER_SEARCH_PATHS from Base.xcconfig for test tool executables.
HEADER_SEARCH_PATHS = "$(SRCROOT)/Pregenerated Files/include" $(SRCROOT)/libxml2/include;
// Export 'main' for Libxml2XCTests.xctest.
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
OTHER_LDFLAGS = $(inherited) -Xlinker -exported_symbol -Xlinker _main;

View File

@ -0,0 +1,9 @@
PRODUCT_NAME = $(TARGET_NAME);
INSTALL_PATH = /usr/local/libexec/libxml2;
EXECUTABLE_PREFIX = lib;
// Override HEADER_SEARCH_PATHS from Base.xcconfig for test tool libraries.
HEADER_SEARCH_PATHS = "$(SRCROOT)/Pregenerated Files/include" $(SRCROOT)/libxml2/include;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;

View File

@ -0,0 +1,11 @@
PRODUCT_NAME = xml2;
INSTALL_PATH = /usr/local/lib/libxml2;
EXECUTABLE_PREFIX = lib;
PUBLIC_HEADERS_FOLDER_PATH = /usr/include/libxml2/libxml;
// Override HEADER_SEARCH_PATHS from Base.xcconfig for libxml2.a.
HEADER_SEARCH_PATHS = "$(SRCROOT)/Pregenerated Files/include" $(SRCROOT)/libxml2/include;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
STRIP_INSTALLED_PRODUCT = NO;

View File

@ -0,0 +1,17 @@
PRODUCT_NAME = libxml2.2;
INSTALL_PATH = /usr/lib;
DYLIB_COMPATIBILITY_VERSION = 10.0.0;
DYLIB_CURRENT_VERSION = 10.9.0;
OTHER_LDFLAGS = $(inherited) -Wl,-force_load,"$(BUILT_PRODUCTS_DIR)/libxml2.a";
EXPORTED_SYMBOLS_FILE = $(SRCROOT)/Pregenerated Files/libxml2.exp;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/libxml2.order;
IS_ZIPPERED = YES;
SUPPORTS_TEXT_BASED_API = YES;
TAPI_VERIFY_MODE = Pedantic;
OTHER_TAPI_FLAGS = -extra-public-header $(LIBXML2_HEADER_PATH) -extra-private-header $(SRCROOT)/"Pregenerated Files"/globalsCompat.h;

View File

@ -0,0 +1,8 @@
PRODUCT_NAME = libxml2_test;
INSTALL_PATH = /usr/local/lib;
OTHER_LDFLAGS = $(inherited) -Wl,-force_load,"$(BUILT_PRODUCTS_DIR)/libxml2.a";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/libxml2.order;

22
Libxml2XCTests/Info.plist Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,110 @@
//
// Libxml2XCTests.m
// Libxml2XCTests
//
// Created by David Kilzer on 2017/01/09.
//
#import <dlfcn.h>
#import <Foundation/Foundation.h>
#import <XCTest/XCTest.h>
typedef int (MainFunction)(int, char**);
@interface Libxml2XCTests : XCTestCase
@property (readonly) NSBundle *bundle;
- (int)_invokeMainForTestCommand:(NSString *)command;
- (void)_printOutputFile:(NSString *)file;
@end
@implementation Libxml2XCTests
- (NSBundle *)bundle
{
static NSBundle *bundle = nil;
if (!bundle) {
bundle = [NSBundle bundleForClass:[self class]];
XCTAssertNotNil(bundle, @"bundle should not be nil for class %@", [self class]);
}
return bundle;
}
- (int)_invokeMainForTestCommand:(NSString *)command
{
// Get path to binary from NSBundle.
NSString *resourceName = [NSString stringWithFormat:@"libxml2_%@.dylib", command];
NSString *binaryPath = [self.bundle pathForResource:resourceName ofType:nil];
XCTAssertNotNil(binaryPath, @"binaryPath should not be nil for %@", resourceName);
// Use dyld to load 'main' symbol from binary.
void* binary = dlopen([binaryPath UTF8String], RTLD_LAZY|RTLD_LOCAL);
XCTAssertTrue(!!binary, @"binary should not be NULL loading path (%s): %s", [binaryPath UTF8String], dlerror());
MainFunction *binaryMain = (MainFunction *)dlsym(binary, "main");
XCTAssertTrue(!!binaryMain, @"binaryMain should not be NULL: %s", dlerror());
// Change current directory so that the binary can find its test files.
NSString *binaryDirectory = [binaryPath stringByDeletingLastPathComponent];
BOOL success = [[NSFileManager defaultManager] changeCurrentDirectoryPath:binaryDirectory];
XCTAssertTrue(success, @"Could not change directory to: %@", binaryDirectory);
// Call 'main' to run the test.
char* argv[] = { (char*)[command UTF8String] };
return binaryMain(1, argv);
}
- (void)_printOutputFile:(NSString *)file
{
NSString *path = [[self.bundle resourcePath] stringByAppendingPathComponent:file];
fprintf(stderr, "\n------- Begin %s\n", [file UTF8String]);
NSError *error;
fprintf(stderr, "%s", [[NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error] UTF8String]);
fprintf(stderr, "------- End %s\n\n", [file UTF8String]);
if (error)
fprintf(stderr, "\n------- Error loading %s: %s\n\n", [path UTF8String], [[error description] UTF8String]);
}
- (void)test_runtest
{
NSString *command = @"runtest";
int result = [self _invokeMainForTestCommand:command];
XCTAssertTrue(result == 0, @"%@`main() returned no errors", command);
}
- (void)test_runxmlconf
{
NSString *command = @"runxmlconf";
int result = [self _invokeMainForTestCommand:command];
XCTAssertTrue(result == 0, @"%@`main() returned no errors", command);
[self _printOutputFile:@"runxmlconf.log"];
}
- (void)test_testapi
{
NSString *command = @"testapi";
int result = [self _invokeMainForTestCommand:command];
XCTAssertTrue(result == 0, @"%@`main() returned no errors", command);
[self _printOutputFile:@"test.out"];
}
- (void)test_testchar
{
NSString *command = @"testchar";
int result = [self _invokeMainForTestCommand:command];
XCTAssertTrue(result == 0, @"%@`main() returned no errors", command);
}
- (void)test_testdict
{
NSString *command = @"testdict";
int result = [self _invokeMainForTestCommand:command];
XCTAssertTrue(result == 0, @"%@`main() returned no errors", command);
}
- (void)test_testrecurse
{
NSString *command = @"testrecurse";
int result = [self _invokeMainForTestCommand:command];
XCTAssertTrue(result == 0, @"%@`main() returned no errors", command);
}
@end

27
NMakefileArch Normal file
View File

@ -0,0 +1,27 @@
# This relies on the sources being prepared on a Mac OS X machine via 'make COPY_SOURCES=YES install_source'
install:
# ========== libxml2 ==========
set PATH=$(PATH);$(PROGRAMFILESAAS)
C:\Perl\bin\perl.exe "$(SRCROOT)\AppleInternal\tools\scripts\auto-version.pl" "$(OBJROOT)\libxml\obj"
cd "$(SRCROOT)\libxml2\win32"
cscript //nologo configure.js cruntime=/MD prefix="$(OBJROOT)\libxml" rinclude="$(OBJROOT)\libxml\obj\include" include="$(SRCROOT)\AppleInternal\include" lib="$(SRCROOT)\AppleInternal\lib$(ARCH)" iconv=no icu=yes
nmake /f Makefile.msvc
nmake /f Makefile.msvc install
xcopy "$(OBJROOT)\libxml\bin\libxml2.*" "$(DSTROOT)\$(PROGRAMFILESAAS)" /e/v/i/h/y
xcopy "$(OBJROOT)\libxml\lib\*.dll" "$(DSTROOT)\$(PROGRAMFILESAAS)" /e/v/i/h/y
xcopy "$(OBJROOT)\libxml\lib\*.lib" "$(DSTROOT)\AppleInternal\lib$(ARCH)" /e/v/i/h/y
xcopy "$(OBJROOT)\libxml\include\libxml2\libxml" "$(DSTROOT)\AppleInternal\include\libxml" /e/v/i/h/y
install_DEBUG:
# ========== libxml2 ==========
set PATH=$(PATH);$(PROGRAMFILESAAS)
C:\Perl\bin\perl.exe "$(SRCROOT)\AppleInternal\tools\scripts\auto-version.pl" "$(OBJROOT)\libxml\obj"
cd "$(SRCROOT)\libxml2\win32"
cscript //nologo configure.js debug=1 cruntime=/MDd prefix="$(OBJROOT)\libxml" rinclude="$(OBJROOT)\libxml\obj\include" include="$(SRCROOT)\AppleInternal\include" lib="$(SRCROOT)\AppleInternal\lib$(ARCH)" iconv=no icu=yes
nmake /f Makefile.msvc
nmake /f Makefile.msvc install
xcopy "$(OBJROOT)\libxml\bin\libxml*" "$(DSTROOT)\$(PROGRAMFILESAAS)" /e/v/i/h/y
xcopy "$(OBJROOT)\libxml\lib\*.dll" "$(DSTROOT)\$(PROGRAMFILESAAS)" /e/v/i/h/y
xcopy "$(OBJROOT)\libxml\lib\*.lib" "$(DSTROOT)\AppleInternal\lib$(ARCH)" /e/v/i/h/y
xcopy "$(OBJROOT)\libxml\include\libxml2\libxml" "$(DSTROOT)\AppleInternal\include\libxml" /e/v/i/h/y

View File

@ -0,0 +1,66 @@
The files in this directory are generated programatically as part of the regular automake-based libxml2
build process. The manner in which they are generated is sufficiently complicated that for now we'll
stick with checking in the generated files and updating them by hand when needed.
include/config.h and include/libxml/xmlversion.h: Taken directly from a regular automake-based build of libxml2.
xml2-config: Hand-modified based on generated xml2-config to include the SDKROOT in paths.
Steps to rebuild files:
1. Install Homebrew. <http://brew.sh/>
2. Install autoconf, automake, libtool, pkg-config from Homebrew.
3. In the libxml2.git source directory (assuming /usr/local/bin is in your path):
cd libxml2
glibtoolize --force
cp /usr/local/Cellar/pkg-config/0.28/share/aclocal/pkg.m4 ./m4/
aclocal -I m4
autoheader
automake --add-missing --force-missing
autoconf
./configure --prefix=/usr --without-iconv --with-icu --without-lzma --without-python --with-zlib
4. Edit xml2-config.
a. Fix prefix value:
-prefix=/usr
+prefix=$(xcrun -show-sdk-path)/usr
b. Remove unnecessary "-L/usr/lib" switches from --libs output:
if [ "`uname`" = "Darwin" -a "-L${libdir}" = "-L/usr/lib" ]
then
- echo -lxml2 -L/usr/lib -lz -lpthread -licucore -lm
+ echo -lxml2 -lz -lpthread -licucore -lm
else
- echo -L${libdir} -lxml2 -L/usr/lib -lz -lpthread -licucore -lm
+ echo -L${libdir} -lxml2 -lz -lpthread -licucore -lm
fi
fi
5. [Optional] Run tests (compare output prior to patch as there is some spew):
make -j $(sysctl -n hw.ncpu)
make check
To run tests with AddressSanitizer enabled, re-run configure with this environment variable:
CC="xcrun -sdk macosx.internal cc -fsanitize=address"
6. Copy replacement files into place:
cp -p config.h "../Pregenerated Files/include/"
cp -p include/libxml/xmlversion.h "../Pregenerated Files/include/libxml/"
cp -p xml2-config "../Pregenerated Files/"
7. Apply patch to "./Pregenerated Files/include/libxml/"
diff --git a/Pregenerated Files/include/libxml/xmlversion.h b/Pregenerated Files/include/libxml/xmlversion.h
index c4bf45a0..c7992c7a 100644
--- a/Pregenerated Files/include/libxml/xmlversion.h
+++ b/Pregenerated Files/include/libxml/xmlversion.h
@@ -91,11 +91,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Whether the thread support is configured in
*/
#if 1
-#if defined(_REENTRANT) || defined(__MT__) || \
- (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
#define LIBXML_THREAD_ENABLED
-#endif
#endif
/**
8. Run git-add on changed files (including those in libxml2), and check them in.
cd ..
git add "Pregenerated Files/include/config.h" "Pregenerated Files/include/libxml/xmlversion.h" "Pregenerated Files/xml2-config"
9. Update libxml2.plist with libxml2 version, md5 hash, radars to upstream as needed.
10. Run git-commit to commit the updated files.
11. Clean up the files generated from Step 3.
git status --ignored
git clean --force -d -x

View File

@ -0,0 +1,84 @@
/* Prevent <libxml/globals.h> from being included. */
#define __XML_GLOBALS_H
#include <libxml/parser.h>
/* Typedefs from <libxml/globals.h>. */
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
#ifdef __cplusplus
extern "C" {
#endif
#ifdef LIBXML_DOCB_ENABLED
XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler;
#endif
#ifdef LIBXML_HTML_ENABLED
XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
#endif
XMLPUBVAR xmlError xmlLastError;
/*
* Everything starting from the line below is
* Automatically generated by build_glob.py.
* Do not modify the previous line.
*/
XMLPUBVAR int oldXMLWDcompatibility;
XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
XMLPUBVAR int xmlDefaultBufferSize;
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
XMLPUBVAR void * xmlGenericErrorContext;
XMLPUBVAR void * xmlStructuredErrorContext;
XMLPUBVAR int xmlGetWarningsDefaultValue;
XMLPUBVAR int xmlIndentTreeOutput;
XMLPUBVAR const char * xmlTreeIndentString;
XMLPUBVAR int xmlKeepBlanksDefaultValue;
XMLPUBVAR int xmlLineNumbersDefaultValue;
XMLPUBVAR int xmlLoadExtDtdDefaultValue;
XMLPUBVAR int xmlParserDebugEntities;
XMLPUBVAR const char * xmlParserVersion;
XMLPUBVAR int xmlPedanticParserDefaultValue;
XMLPUBVAR int xmlSaveNoEmptyTags;
XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,488 @@
/*
* Summary: compile-time version informations
* Description: compile-time version informations for the XML library
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_VERSION_H__
#define __XML_VERSION_H__
#include <libxml/xmlexports.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* use those to be sure nothing nasty will happen if
* your library and includes mismatch
*/
#ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */
/**
* LIBXML_DOTTED_VERSION:
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.9.4"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 20904
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "20904"
/**
* LIBXML_VERSION_EXTRA:
*
* extra version information, used to show a CVS compilation
*/
#define LIBXML_VERSION_EXTRA ""
/**
* LIBXML_TEST_VERSION:
*
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(20904);
#ifndef VMS
#if 0
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO
#else
/**
* WITHOUT_TRIO:
*
* defined if the trio support should not be configured in
*/
#define WITHOUT_TRIO
#endif
#else /* VMS */
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO 1
#endif /* VMS */
/**
* LIBXML_THREAD_ENABLED:
*
* Whether the thread support is configured in
*/
#if 1
#define LIBXML_THREAD_ENABLED
#endif
/**
* LIBXML_THREAD_ALLOC_ENABLED:
*
* Whether the allocation hooks are per-thread
*/
#if 0
#define LIBXML_THREAD_ALLOC_ENABLED
#endif
/**
* LIBXML_TREE_ENABLED:
*
* Whether the DOM like tree manipulation API support is configured in
*/
#if 1
#define LIBXML_TREE_ENABLED
#endif
/**
* LIBXML_OUTPUT_ENABLED:
*
* Whether the serialization/saving support is configured in
*/
#if 1
#define LIBXML_OUTPUT_ENABLED
#endif
/**
* LIBXML_PUSH_ENABLED:
*
* Whether the push parsing interfaces are configured in
*/
#if 1
#define LIBXML_PUSH_ENABLED
#endif
/**
* LIBXML_READER_ENABLED:
*
* Whether the xmlReader parsing interface is configured in
*/
#if 1
#define LIBXML_READER_ENABLED
#endif
/**
* LIBXML_PATTERN_ENABLED:
*
* Whether the xmlPattern node selection interface is configured in
*/
#if 1
#define LIBXML_PATTERN_ENABLED
#endif
/**
* LIBXML_WRITER_ENABLED:
*
* Whether the xmlWriter saving interface is configured in
*/
#if 1
#define LIBXML_WRITER_ENABLED
#endif
/**
* LIBXML_SAX1_ENABLED:
*
* Whether the older SAX1 interface is configured in
*/
#if 1
#define LIBXML_SAX1_ENABLED
#endif
/**
* LIBXML_FTP_ENABLED:
*
* Whether the FTP support is configured in
*/
#if 1
#define LIBXML_FTP_ENABLED
#endif
/**
* LIBXML_HTTP_ENABLED:
*
* Whether the HTTP support is configured in
*/
#if 1
#define LIBXML_HTTP_ENABLED
#endif
/**
* LIBXML_VALID_ENABLED:
*
* Whether the DTD validation support is configured in
*/
#if 1
#define LIBXML_VALID_ENABLED
#endif
/**
* LIBXML_HTML_ENABLED:
*
* Whether the HTML support is configured in
*/
#if 1
#define LIBXML_HTML_ENABLED
#endif
/**
* LIBXML_LEGACY_ENABLED:
*
* Whether the deprecated APIs are compiled in for compatibility
*/
#if 1
#define LIBXML_LEGACY_ENABLED
#endif
/**
* LIBXML_C14N_ENABLED:
*
* Whether the Canonicalization support is configured in
*/
#if 1
#define LIBXML_C14N_ENABLED
#endif
/**
* LIBXML_CATALOG_ENABLED:
*
* Whether the Catalog support is configured in
*/
#if 1
#define LIBXML_CATALOG_ENABLED
#endif
/**
* LIBXML_DOCB_ENABLED:
*
* Whether the SGML Docbook support is configured in
*/
#if 1
#define LIBXML_DOCB_ENABLED
#endif
/**
* LIBXML_XPATH_ENABLED:
*
* Whether XPath is configured in
*/
#if 1
#define LIBXML_XPATH_ENABLED
#endif
/**
* LIBXML_XPTR_ENABLED:
*
* Whether XPointer is configured in
*/
#if 1
#define LIBXML_XPTR_ENABLED
#endif
/**
* LIBXML_XINCLUDE_ENABLED:
*
* Whether XInclude is configured in
*/
#if 1
#define LIBXML_XINCLUDE_ENABLED
#endif
/**
* LIBXML_ICONV_ENABLED:
*
* Whether iconv support is available
*/
#if 0
#define LIBXML_ICONV_ENABLED
#endif
/**
* LIBXML_ICU_ENABLED:
*
* Whether icu support is available
*/
#if 1
#define LIBXML_ICU_ENABLED
#endif
/**
* LIBXML_ISO8859X_ENABLED:
*
* Whether ISO-8859-* support is made available in case iconv is not
*/
#if 1
#define LIBXML_ISO8859X_ENABLED
#endif
/**
* LIBXML_DEBUG_ENABLED:
*
* Whether Debugging module is configured in
*/
#if 1
#define LIBXML_DEBUG_ENABLED
#endif
/**
* DEBUG_MEMORY_LOCATION:
*
* Whether the memory debugging is configured in
*/
#if 0
#define DEBUG_MEMORY_LOCATION
#endif
/**
* LIBXML_DEBUG_RUNTIME:
*
* Whether the runtime debugging is configured in
*/
#if 0
#define LIBXML_DEBUG_RUNTIME
#endif
/**
* LIBXML_UNICODE_ENABLED:
*
* Whether the Unicode related interfaces are compiled in
*/
#if 1
#define LIBXML_UNICODE_ENABLED
#endif
/**
* LIBXML_REGEXP_ENABLED:
*
* Whether the regular expressions interfaces are compiled in
*/
#if 1
#define LIBXML_REGEXP_ENABLED
#endif
/**
* LIBXML_AUTOMATA_ENABLED:
*
* Whether the automata interfaces are compiled in
*/
#if 1
#define LIBXML_AUTOMATA_ENABLED
#endif
/**
* LIBXML_EXPR_ENABLED:
*
* Whether the formal expressions interfaces are compiled in
*/
#if 1
#define LIBXML_EXPR_ENABLED
#endif
/**
* LIBXML_SCHEMAS_ENABLED:
*
* Whether the Schemas validation interfaces are compiled in
*/
#if 1
#define LIBXML_SCHEMAS_ENABLED
#endif
/**
* LIBXML_SCHEMATRON_ENABLED:
*
* Whether the Schematron validation interfaces are compiled in
*/
#if 1
#define LIBXML_SCHEMATRON_ENABLED
#endif
/**
* LIBXML_MODULES_ENABLED:
*
* Whether the module interfaces are compiled in
*/
#if 1
#define LIBXML_MODULES_ENABLED
/**
* LIBXML_MODULE_EXTENSION:
*
* the string suffix used by dynamic modules (usually shared libraries)
*/
#define LIBXML_MODULE_EXTENSION ".so"
#endif
/**
* LIBXML_ZLIB_ENABLED:
*
* Whether the Zlib support is compiled in
*/
#if 1
#define LIBXML_ZLIB_ENABLED
#endif
/**
* LIBXML_LZMA_ENABLED:
*
* Whether the Lzma support is compiled in
*/
#if 0
#define LIBXML_LZMA_ENABLED
#endif
#ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H
#include <ansidecl.h>
#endif
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#ifndef ATTRIBUTE_UNUSED
# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
# define ATTRIBUTE_UNUSED __attribute__((unused))
# else
# define ATTRIBUTE_UNUSED
# endif
#endif
/**
* LIBXML_ATTR_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/
#ifndef LIBXML_ATTR_ALLOC_SIZE
# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else
# define LIBXML_ATTR_ALLOC_SIZE(x)
# endif
#else
# undef LIBXML_ATTR_ALLOC_SIZE(x)
# define LIBXML_ATTR_ALLOC_SIZE(x)
#endif
/**
* LIBXML_ATTR_FORMAT:
*
* Macro used to indicate to GCC the parameter are printf like
*/
#ifndef LIBXML_ATTR_FORMAT
# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
# else
# define LIBXML_ATTR_FORMAT(fmt,args)
# endif
#else
# undef LIBXML_ATTR_FORMAT(fmt,args)
# define LIBXML_ATTR_FORMAT(fmt,args)
#endif
#else /* ! __GNUC__ */
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#define ATTRIBUTE_UNUSED
/**
* LIBXML_ATTR_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/
#define LIBXML_ATTR_ALLOC_SIZE(x)
/**
* LIBXML_ATTR_FORMAT:
*
* Macro used to indicate to GCC the parameter are printf like
*/
#define LIBXML_ATTR_FORMAT(fmt,args)
#endif /* __GNUC__ */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,243 @@
module libxml2 [system] [extern_c] {
// Add "-Xcc -I$(SDKROOT)/usr/include/libxml2" to OTHER_SWIFT_FLAGS in Xcode project.
module HTMLparser {
header "libxml/HTMLparser.h"
header "libxml/SAX.h"
header "libxml/SAX2.h"
header "libxml/globals.h"
header "libxml/parser.h"
header "libxml/threads.h"
header "libxml/tree.h"
header "libxml/xlink.h"
header "libxml/xmlmemory.h"
export *
}
module HTMLtree {
header "libxml/HTMLtree.h"
export *
}
module SAX {
export HTMLparser
export *
}
module SAX2 {
export HTMLparser
export *
}
module c14n {
header "libxml/c14n.h"
export *
}
module catalog {
header "libxml/catalog.h"
export *
}
module chvalid {
header "libxml/chvalid.h"
export *
}
module debugXML {
header "libxml/debugXML.h"
export *
}
module dict {
header "libxml/dict.h"
export *
}
module encoding {
header "libxml/encoding.h"
export *
}
module entities {
header "libxml/entities.h"
export *
}
module globals {
export HTMLparser
export *
}
module hash {
header "libxml/hash.h"
export *
}
module list {
header "libxml/list.h"
export *
}
module nanoftp {
header "libxml/nanoftp.h"
export *
}
module nanohttp {
header "libxml/nanohttp.h"
export *
}
module parser {
export HTMLparser
export *
}
module parserInternals {
header "libxml/parserInternals.h"
export *
}
module pattern {
header "libxml/pattern.h"
export *
}
module relaxng {
header "libxml/relaxng.h"
export *
}
module schemasInternals {
header "libxml/schemasInternals.h"
export *
}
module schematron {
header "libxml/schematron.h"
export *
}
module threads {
export HTMLparser
export *
}
module tree {
export HTMLparser
export *
}
module uri {
header "libxml/uri.h"
export *
}
module valid {
header "libxml/valid.h"
export *
}
module xinclude {
header "libxml/xinclude.h"
export *
}
module xlink {
export HTMLparser
export *
}
module xmlIO {
header "libxml/xmlIO.h"
export *
}
module xmlautomata {
header "libxml/xmlautomata.h"
export *
}
module xmlerror {
header "libxml/xmlerror.h"
export *
}
module xmlexports {
header "libxml/xmlexports.h"
export *
}
module xmlmemory {
export HTMLparser
export *
}
module xmlmodule {
header "libxml/xmlmodule.h"
export *
}
module xmlreader {
header "libxml/xmlreader.h"
export *
}
module xmlregexp {
header "libxml/xmlregexp.h"
export *
}
module xmlsave {
header "libxml/xmlsave.h"
export *
}
module xmlschemas {
header "libxml/xmlschemas.h"
export *
}
module xmlschemastypes {
header "libxml/xmlschemastypes.h"
export *
}
module xmlstring {
header "libxml/xmlstring.h"
export *
}
module xmlunicode {
header "libxml/xmlunicode.h"
export *
}
module xmlversion {
header "libxml/xmlversion.h"
export *
}
module xmlwriter {
header "libxml/xmlwriter.h"
export *
}
module xpath {
header "libxml/xpath.h"
export *
}
module xpathInternals {
header "libxml/xpathInternals.h"
export *
}
module xpointer {
header "libxml/xpointer.h"
export *
}
exclude header "libxml/DOCBparser.h" // Deprecated.
}

View File

@ -1,68 +0,0 @@
##----------------------------------------------------------------
##
##-- Filename: Makefile
##
##-- $Date: 2008/02/23 02:56:17 $
##-- $Revision: 1.2 $
##-- $Name: $
##
##----------------------------------------------------------------
NAME = xml2
TOOL_FAMILY=gnu
include $(WIND_USR)/tool/gnu/make.$(VXCPU)
FLAGS = -Wall -g -Isrc -Isrc/include -D_REENTRANT=1
#FLAGS = -Wall -O2 -Isrc -Isrc/include -D_REENTRANT=1
FLAGS += $(DEFINE_CC) $(CC_ARCH_SPEC) -MD -MP -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=gnu -D_VX_TOOL=$(TOOL)
ifeq ($(VXTYPE),RTP)
FLAGS += -mrtp -fpic -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip
else
FLAGS += -D_WRS_KERNEL -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip
endif
ifeq ($(VXTYPE),RTP)
ifeq ($(CPU),SH32)
LIB_LDFLAGS += -L$(WIND_USR)/lib/sh/SH32/commonle/PIC
else
LIB_LDFLAGS += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS)
endif
endif
OBJS = c14n.o catalog.o chvalid.o \
debugXML.o dict.o DOCBparser.o \
encoding.o entities.o error.o \
globals.o \
hash.o \
legacy.o list.o \
parser.o parserInternals.o pattern.o \
relaxng.o \
SAX2.o SAX.o schematron.o \
threads.o tree.o \
uri.o \
valid.o \
xinclude.o xlink.o xmlcatalog.o xmlIO.o \
xmlmemory.o xmlmodule.o xmlreader.o xmlregexp.o \
xmlsave.o xmlschemas.o xmlschemastypes.o xmlstring.o \
xmlunicode.o xmlwriter.o xpath.o xpointer.o
all : lib$(NAME).so
init :
mkdir -p objs
.PHONY : lib$(NAME).so
lib$(NAME).so : init $(patsubst %.o, objs/%.o, $(OBJS))
$(CC) $(FLAGS) $(LIB_LDFLAGS) -shared -o $@ $(patsubst %.o, objs/%.o, $(OBJS))
(NAME).out : init $(patsubst %.o, objs/%.o, $(OBJS))
$(CC) $(FLAGS) -o $@ $(patsubst %.o, objs/%.o, $(OBJS))
objs/%.o: src/%.c
$(CC) $(FLAGS) -o $@ -c $<
clean:
rm -fR *.so objs

51
buildlibxmlforaas.bat Normal file
View File

@ -0,0 +1,51 @@
@echo off
setlocal
set VCVARS_BAT=vcvarsall.bat
set VS_VERS=2017
:VCVARS_DIR
:: VS Professional 2017+
set VCVARS_DIR=C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERS%\Professional\VC\Auxiliary\Build\
IF EXIST "%VCVARS_DIR%%VCVARS_BAT%" (
goto EXECUTE
)
:: VS Build Tools 2017+
set VCVARS_DIR=C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERS%\BuildTools\VC\Auxiliary\Build\
IF EXIST "%VCVARS_DIR%%VCVARS_BAT%" (
goto EXECUTE
)
:MISSING_VCVARS
echo Cannot determine location of %VCVARS_BAT%
goto ERR_END
:EXECUTE
set ARCH=32
set PROGRAMFILESAAS=Program Files (x86)\Common Files\Apple\Apple Application Support
call "%VCVARS_DIR%%VCVARS_BAT%" x86
nmake /f NMakefileArch %1
if %errorlevel% NEQ 0 (
goto ERR_END
)
set ARCH=64
set PROGRAMFILESAAS=Program Files\Common Files\Apple\Apple Application Support
call "%VCVARS_DIR%%VCVARS_BAT%" amd64
nmake /f NMakefileArch %1
if %errorlevel% NEQ 0 (
goto ERR_END
)
goto END
:ERR_END
exit /b 1
:END
endlocal

View File

@ -1,42 +0,0 @@
#ifndef DARLING_LIBXML2_CONFIG_H
#define DARLING_LIBXML2_CONFIG_H
#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STDLIB_H 1
#define HAVE_MATH_H 1
#define HAVE_FLOAT_H 1
#define LIBXML_XPATH_ENABLED 1
#define LIBXML_OUTPUT_ENABLED 1
#define LIBXML_SCHEMAS_ENABLED 1
#define LIBXML_PATTERN_ENABLED 1
#define LIBXML_CATALOG_ENABLED 1
#define LIBXML_XINCLUDE_ENABLED 1
#define LIBXML_C14N_ENABLED 1
#define HAVE_ERRNO_H 1
#define HAVE_SYS_MMAN_H 1
#define HAVE_LIMITS_H 1
#define HAVE_PTHREAD_H 1
#define HAVE_CTYPE_H 1
#define HAVE_TIME_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_NETDB_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDARG_H
#define HAVE_STRINGS_H 1
#define HAVE_VA_COPY 1
#define SEND_ARG2_CAST (const void*)
#define GETHOSTBYNAME_ARG_CAST (const char*)
#define _REENTRANT
#endif

42
libxml2.plist Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OpenSourceProject</key>
<string>libxml2</string>
<key>OpenSourceVersion</key>
<string>2.9.4</string>
<key>OpenSourceWebsiteURL</key>
<string>http://xmlsoft.org/</string>
<key>OpenSourceURL</key>
<string>http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz</string>
<key>OpenSourceMD5</key>
<string>ae249165c173b1ff386ee8ad676815f5</string>
<key>OpenSourceImportDate</key>
<string>2016-05-27</string>
<key>OpenSourceLicense</key>
<string>other</string>
<key>OpenSourceLicenseFile</key>
<string>libxml2.txt</string>
<key>OpenSourceModifications</key>
<array>
<string>rdar://problem/3874282</string>
<string>rdar://problem/3960539</string>
<string>rdar://problem/4723997</string>
<string>rdar://problem/5014269</string>
<string>rdar://problem/6514625</string>
<string>rdar://problem/8371582</string>
<string>rdar://problem/8677255</string>
<string>rdar://problem/9791139</string>
<string>rdar://problem/10141425</string>
<string>rdar://problem/10646045</string>
<string>rdar://problem/10646344</string>
<string>rdar://problem/10734584</string>
<string>rdar://problem/10734593</string>
<string>rdar://problem/10772343</string>
<string>rdar://problem/12751928</string>
<string>rdar://problem/12938958</string>
<string>rdar://problem/26527606</string>
</array>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5DB38AEE14F87BDD0060A507"
BuildableName = "All"
BlueprintName = "All"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "YES"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "44258B5A1E241DA500DEB7B7"
BuildableName = "Libxml2XCTests.xctest"
BlueprintName = "Libxml2XCTests"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "44258B5A1E241DA500DEB7B7"
BuildableName = "Libxml2XCTests.xctest"
BlueprintName = "Libxml2XCTests"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5DB38AEE14F87BDD0060A507"
BuildableName = "All"
BlueprintName = "All"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5DB38AEE14F87BDD0060A507"
BuildableName = "All"
BlueprintName = "All"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5DB38AEE14F87BDD0060A507"
BuildableName = "All"
BlueprintName = "All"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "YES"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "44258B5A1E241DA500DEB7B7"
BuildableName = "Libxml2XCTests.xctest"
BlueprintName = "Libxml2XCTests"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "44258B5A1E241DA500DEB7B7"
BuildableName = "Libxml2XCTests.xctest"
BlueprintName = "Libxml2XCTests"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "44258B5A1E241DA500DEB7B7"
BuildableName = "Libxml2XCTests.xctest"
BlueprintName = "Libxml2XCTests"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4431E4DB1E37F1FE0041D690"
BuildableName = "Test"
BlueprintName = "Test"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4431E4DB1E37F1FE0041D690"
BuildableName = "Test"
BlueprintName = "Test"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4431E4DB1E37F1FE0041D690"
BuildableName = "Test"
BlueprintName = "Test"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D58AF5B14F815F500BE69D8"
BuildableName = "libxml2.2.dylib"
BlueprintName = "libxml2"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D58AF5B14F815F500BE69D8"
BuildableName = "libxml2.2.dylib"
BlueprintName = "libxml2"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D58AF5B14F815F500BE69D8"
BuildableName = "libxml2.2.dylib"
BlueprintName = "libxml2"
ReferencedContainer = "container:libxml2.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

BIN
libxml2/.DS_Store vendored Normal file

Binary file not shown.

121
libxml2/.gitignore vendored Normal file
View File

@ -0,0 +1,121 @@
*.o
*.lo
*.log
*.pyc
*.patch
.deps
.libs
.memdump
COPYING
CVE-*
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache
bissect*
config.guess
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
configure
depcomp
doc/Makefile
doc/Makefile.in
doc/devhelp/Makefile
doc/devhelp/Makefile.in
doc/examples/.deps
doc/examples/Makefile
doc/examples/Makefile.in
doc/examples/io1
doc/examples/io2
doc/examples/parse1
doc/examples/parse2
doc/examples/parse3
doc/examples/parse4
doc/examples/reader1
doc/examples/reader2
doc/examples/reader3
doc/examples/reader4
doc/examples/testWriter
doc/examples/tree1
doc/examples/tree2
doc/examples/xpath1
doc/examples/xpath2
example/.deps
example/Makefile
example/Makefile.in
example/gjobread
include/Makefile
include/Makefile.in
include/libxml/Makefile
include/libxml/Makefile.in
include/libxml/xmlversion.h
install-sh
libtool
libxml-2.0-uninstalled.pc
libxml-2.0.pc
libxml2.la
libxml2.spec
list
ltmain.sh
log
missing
missing.lst
m4
python/.deps
python/.libs
python/Makefile
python/Makefile.in
python/gen_prog
python/libxml2-export.c
python/libxml2-py.c
python/libxml2-py.h
python/libxml2.py
python/libxml2class.py
python/libxml2class.txt
python/libxml2mod.la
python/tests/Makefile
python/tests/Makefile.in
python/tests/tmp.xml
runsuite
runtest
runxmlconf
runxmlconf.log
stamp-h1
tags
test.out
testAutomata
testC14N
testHTML
testModule
testReader
testRegexp
testRelax
testSAX
testSchemas
testThreads
testURI
testXPath
testapi
testapi.c.new
testchar
testdict
testdso.la
testlimits
testrecurse
tmp
tst.c
tst
xml2-config
xml2Conf.sh
xmlcatalog
xmlconf
xmllint
xstc/Makefile
xstc/Makefile.in
xstc/Tests
xstc/xsts-*.tar.gz

View File

@ -1929,7 +1929,7 @@ Mon Jun 12 12:54:25 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
* tree.c: Fixed xmlGetNodePath() to generate the node test "*"
for elements in the default namespace, rather than generating
an unprefixed named node test and loosing the namespace
an unprefixed named node test and losing the namespace
information.
Fri Jun 9 21:45:02 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
@ -2305,7 +2305,7 @@ Mon Mar 6 14:21:08 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
* tree.c: Simplified usage of the internal xmlNsMap. Added a
"strict" lookup for namespaces based on a prefix. Fixed a
namespace processing issue in the clone-node function, which
occured if a @ctxt argument was given.
occurred if a @ctxt argument was given.
Fri Mar 3 17:44:10 CET 2006 Rob Richards <rrichards@ctindustries.net>
@ -3951,7 +3951,7 @@ Thu Jun 30 15:01:52 CEST 2005 Daniel Veillard <daniel@veillard.com>
* README: updated
* debugXML.c: fix a bug raised by bill on IRC
* relaxng.c: fix a leak in weird circumstances
* runsuite.c Makefile.am: standalone test tool agaisnt
* runsuite.c Makefile.am: standalone test tool against
the regression suites, work in progress
Tue Jun 28 08:30:26 CEST 2005 Daniel Veillard <daniel@veillard.com>
@ -4356,7 +4356,7 @@ Fri Apr 8 21:58:04 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Added substitution group constraints; changed
the build of the pre-computed substitution groups. Channeled
errors during xsi assembling of schemas to the validation
context. Fixed a big memory leak, which occured when using
context. Fixed a big memory leak, which occurred when using
IDCs: the precomputed value of attributes was not freed if
the attribute did not resolve to an IDC field (discovered
with the help of Randy J. Ray's schema, posted to the
@ -4551,7 +4551,7 @@ Mon Mar 21 22:58:37 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
Mon Mar 21 21:09:07 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Fixed a segfault, which occured during bubbling
* xmlschemas.c: Fixed a segfault, which occurred during bubbling
of IDC nodes (bug #170779 and #170778, reported by GUY Fabrice):
a variable was missed to be reset in a loop. Deactivated bubbling,
if not referenced by a keyref.
@ -11220,7 +11220,7 @@ Fri Mar 7 19:29:40 CET 2003 Daniel Veillard <daniel@veillard.com>
* test/xsdtest/xsdtest.xml uri.c: after and exchange with James
Clark it appeared I had bug in URI parsing code ...
* relaxng.c include/libxml/relaxng.h: completely revamped error
reporting to not loose message from optional parts.
reporting to not lose message from optional parts.
* xmllint.c: added timing for RNG validation steps
* result/relaxng/*: updated the result, all error messages changed
@ -13182,7 +13182,7 @@ Thu Aug 1 12:17:30 CEST 2002 Daniel Veillard <daniel@veillard.com>
xmlNewCharEncodingHandler as requested in #89415
* python/generator.py python/setup.py.in: applied cleanup
patches from Marc-Andre Lemburg
* tree.c: fixing bug #89332 on a specific case of loosing
* tree.c: fixing bug #89332 on a specific case of losing
the XML-1.0 namespace on xml:xxx attributes
Wed Jul 31 23:27:42 2002 Aleksey Sanin <aleksey@aleksey.com>
@ -15356,7 +15356,7 @@ Sat Oct 6 15:27:12 CEST 2001 Daniel Veillard <daniel@veillard.com>
Sat Oct 6 15:07:14 CEST 2001 Daniel Veillard <daniel@veillard.com>
* xpath.c: fixing #61673 part I, do not loose doc information
* xpath.c: fixing #61673 part I, do not lose doc information
when copying result value trees.
Sat Oct 6 11:58:58 CEST 2001 Daniel Veillard <daniel@veillard.com>
@ -15970,7 +15970,7 @@ Tue Jul 10 17:47:09 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Mon Jul 9 22:06:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* valid.c: fixed "Internal: MIXED struct bad" when #CDATA elements
validation occured on content with element child
validation occurred on content with element child
Mon Jul 9 17:59:08 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>

View File

@ -114,11 +114,14 @@ htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
return;
if (ctxt != NULL)
ctxt->errNo = error;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_HTML, error,
XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2,
NULL, 0, 0,
msg, str1, str2);
#pragma clang diagnostic pop
if (ctxt != NULL)
ctxt->wellFormed = 0;
}
@ -141,9 +144,12 @@ htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
return;
if (ctxt != NULL)
ctxt->errNo = error;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_HTML, error,
XML_ERR_ERROR, NULL, 0, NULL, NULL,
NULL, val, 0, msg, val);
#pragma clang diagnostic pop
if (ctxt != NULL)
ctxt->wellFormed = 0;
}
@ -327,10 +333,12 @@ htmlNodeInfoPop(htmlParserCtxtPtr ctxt)
#define NEXTL(l) do { \
if (*(ctxt->input->cur) == '\n') { \
ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
ctxt->token = 0; ctxt->input->cur += l; ctxt->nbChars++; \
if (ctxt->input->cur + l <= ctxt->input->end) { \
if (*(ctxt->input->cur) == '\n') { \
ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
ctxt->token = 0; ctxt->input->cur += l; ctxt->nbChars++; \
} \
} while (0)
/************
@ -516,14 +524,24 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
guess = htmlFindEncoding(ctxt);
if (guess == NULL) {
xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
int ret = xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
if (ret < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding 'ISO-8859-1'\n",
NULL, NULL);
}
} else {
if (ctxt->input->encoding != NULL)
xmlFree((xmlChar *) ctxt->input->encoding);
ctxt->input->encoding = guess;
handler = xmlFindCharEncodingHandler((const char *) guess);
if (handler != NULL) {
xmlSwitchToEncoding(ctxt, handler);
int ret = xmlSwitchToEncoding(ctxt, handler);
if (ret < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding '%s'\n",
guess, NULL);
}
} else {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"Unsupported encoding %s", guess, NULL);
@ -2528,8 +2546,12 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
}
}
if (ctxt->input->base > ctxt->input->cur - len)
return(NULL);
if (ctxt->input->cur - ctxt->input->base < len) {
/* Sanity check */
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
"unexpected change of input buffer", NULL, NULL);
return (NULL);
}
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
}
@ -2955,6 +2977,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
}
COPY_BUF(l,buf,nbchar,cur);
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
if (ctxt->sax->cdataBlock!= NULL) {
/*
* Insert as CDATA, which is the same as HTML_PRESERVE_NODE
@ -2979,6 +3002,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
}
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
buf[nbchar] = 0;
if (ctxt->sax->cdataBlock!= NULL) {
/*
* Insert as CDATA, which is the same as HTML_PRESERVE_NODE
@ -3024,6 +3048,8 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
COPY_BUF(l,buf,nbchar,cur);
}
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
/*
* Ok the segment is to be consumed as chars.
*/
@ -3601,7 +3627,12 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
"htmlCheckEncoding: wrong encoding meta\n",
NULL, NULL);
} else {
xmlSwitchEncoding(ctxt, enc);
int ret = xmlSwitchEncoding(ctxt, enc);
if (ret < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding '%s'\n",
encoding, NULL);
}
}
ctxt->charset = XML_CHAR_ENCODING_UTF8;
} else {
@ -3610,7 +3641,12 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
*/
handler = xmlFindCharEncodingHandler((const char *) encoding);
if (handler != NULL) {
xmlSwitchToEncoding(ctxt, handler);
int ret = xmlSwitchToEncoding(ctxt, handler);
if (ret < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding '%s'\n",
encoding, NULL);
}
ctxt->charset = XML_CHAR_ENCODING_UTF8;
} else {
htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING,
@ -4444,7 +4480,7 @@ static void
htmlParseElementInternal(htmlParserCtxtPtr ctxt) {
const xmlChar *name;
const htmlElemDesc * info;
htmlParserNodeInfo node_info = { 0, };
htmlParserNodeInfo node_info = { NULL, 0, 0, 0, 0 };
int failed;
if ((ctxt == NULL) || (ctxt->input == NULL)) {
@ -4754,8 +4790,18 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
start[3] = NXT(3);
enc = xmlDetectCharEncoding(&start[0], 4);
if (enc != XML_CHAR_ENCODING_NONE) {
xmlSwitchEncoding(ctxt, enc);
}
int ret = xmlSwitchEncoding(ctxt, enc);
if (ret < 0) {
char buf[20];
snprintf(&buf[0], 20, "0x%02X 0x%02X 0x%02X 0x%02X",
start[0], start[1],
start[2], start[3]);
buf[19] = 0;
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding, bytes %s\n",
(const xmlChar *)buf, NULL);
}
}
}
/*
@ -4941,6 +4987,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
ctxt->wellFormed = 1;
ctxt->replaceEntities = 0;
ctxt->linenumbers = xmlLineNumbersDefaultValue;
ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
ctxt->html = 1;
ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0;
ctxt->vctxt.userData = ctxt;
@ -5072,19 +5119,28 @@ htmlCreateDocParserCtxt(const xmlChar *cur, const char *encoding) {
* registered set of known encodings
*/
if (enc != XML_CHAR_ENCODING_ERROR) {
xmlSwitchEncoding(ctxt, enc);
int ret = xmlSwitchEncoding(ctxt, enc);
if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING,
"Unsupported encoding %s\n",
(const xmlChar *) encoding, NULL);
}
} else if (ret < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding '%s'\n",
(const xmlChar *)encoding, NULL);
}
} else {
/*
* fallback for unknown encodings
*/
handler = xmlFindCharEncodingHandler((const char *) encoding);
if (handler != NULL) {
xmlSwitchToEncoding(ctxt, handler);
int ret = xmlSwitchToEncoding(ctxt, handler);
if (ret < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding '%s'\n",
(const xmlChar *)encoding, NULL);
}
} else {
htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING,
"Unsupported encoding %s\n",
@ -5678,6 +5734,12 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
failed = htmlParseStartTag(ctxt);
/* <meta> tag with new charset can cause fatal encoding error in push mode. */
if (ctxt->instate == XML_PARSER_EOF) {
if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
ctxt->sax->endDocument(ctxt->userData);
goto done;
}
name = ctxt->name;
if ((failed == -1) ||
(name == NULL)) {
@ -5757,13 +5819,13 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
break;
}
case XML_PARSER_CONTENT: {
xmlChar chr[2] = { 0, 0 };
long cons;
/*
* Handle preparsed entities and charRef
*/
if (ctxt->token != 0) {
xmlChar chr[2] = { 0 , 0 } ;
chr[0] = (xmlChar) ctxt->token;
htmlCheckParagraph(ctxt);
if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
@ -5775,21 +5837,22 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
cur = in->cur[0];
if ((cur != '<') && (cur != '&')) {
if (ctxt->sax != NULL) {
chr[0] = cur;
if (IS_BLANK_CH(cur)) {
if (ctxt->keepBlanks) {
if (ctxt->sax->characters != NULL)
ctxt->sax->characters(
ctxt->userData, &in->cur[0], 1);
ctxt->userData, chr, 1);
} else {
if (ctxt->sax->ignorableWhitespace != NULL)
ctxt->sax->ignorableWhitespace(
ctxt->userData, &in->cur[0], 1);
ctxt->userData, chr, 1);
}
} else {
htmlCheckParagraph(ctxt);
if (ctxt->sax->characters != NULL)
ctxt->sax->characters(
ctxt->userData, &in->cur[0], 1);
ctxt->userData, chr, 1);
}
}
ctxt->token = 0;
@ -6273,7 +6336,8 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
*/
htmlDocPtr
htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void *userData) {
htmlSAXParseDoc(const xmlChar *cur, const char *encoding,
htmlSAXHandlerPtr sax, void *userData) {
htmlDocPtr ret;
htmlParserCtxtPtr ctxt;
@ -6312,7 +6376,7 @@ htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void
*/
htmlDocPtr
htmlParseDoc(xmlChar *cur, const char *encoding) {
htmlParseDoc(const xmlChar *cur, const char *encoding) {
return(htmlSAXParseDoc(cur, encoding, NULL, NULL));
}
@ -6366,13 +6430,13 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
/* set encoding */
if (encoding) {
size_t l = strlen(encoding);
size_t encodingLength = strlen(encoding);
if (l < 1000) {
content = xmlMallocAtomic (xmlStrlen(content_line) + l + 1);
if (encodingLength < 1000) {
const size_t contentLength = xmlStrlen(content_line) + encodingLength + 1;
content = xmlMallocAtomic(contentLength);
if (content) {
strcpy ((char *)content, (char *)content_line);
strcat ((char *)content, (char *)encoding);
snprintf((char *)content, contentLength, "%s%s", (char *)content_line, (char *)encoding);
htmlCheckEncoding (ctxt, content);
xmlFree (content);
}
@ -6677,6 +6741,50 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
}
}
#ifdef __APPLE__
#include <dispatch/dispatch.h>
#include <mach-o/dyld.h>
extern int dyld_get_program_sdk_version(void);
#define DYLD_MACOSX_VERSION_10_9 0x000A0900
// libxml2 v2.9 changed the HTML parser's handling of whitespace in a way that broke
// H&R Block at Home 2010. Detect H&R Block at Home 2010 and mimic the old parser behavior.
static bool evaluteHTMLParserNeedsNoBlankQuirkCriteria(void)
{
const char* executablePath = _dyld_get_image_name(0);
if (!executablePath)
return false;
// Find the base name portion of the path.
const char* executableName = strrchr(executablePath, '/');
if (!executableName)
return false;
// Move past the slash.
executableName++;
if (strcmp(executableName, "TaxCut.real"))
return false;
// Apply the workaround if the application was linked against an SDK prior to where
// libxml2 v2.9 was present.
return dyld_get_program_sdk_version() < DYLD_MACOSX_VERSION_10_9;
}
static bool htmlParserNeedsNoBlankQuirk(void)
{
static bool needsQuirk;
static dispatch_once_t hasEvaluatedQuirk;
dispatch_once(&hasEvaluatedQuirk, ^{
needsQuirk = evaluteHTMLParserNeedsNoBlankQuirkCriteria();
});
return needsQuirk;
}
#endif
/**
* htmlCtxtUseOptions:
* @ctxt: an HTML parser context
@ -6693,6 +6801,11 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
if (ctxt == NULL)
return(-1);
#if __APPLE__
if (htmlParserNeedsNoBlankQuirk())
options |= XML_PARSE_NOBLANKS;
#endif
if (options & HTML_PARSE_NOWARNING) {
ctxt->sax->warning = NULL;
ctxt->vctxt.warning = NULL;
@ -6773,10 +6886,16 @@ htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
hdlr = xmlFindCharEncodingHandler(encoding);
if (hdlr != NULL) {
xmlSwitchToEncoding(ctxt, hdlr);
if (ctxt->input->encoding != NULL)
xmlFree((xmlChar *) ctxt->input->encoding);
ctxt->input->encoding = xmlStrdup((xmlChar *)encoding);
int retval = xmlSwitchToEncoding(ctxt, hdlr);
if (retval < 0) {
htmlParseErr(ctxt, ctxt->errNo ? ctxt->errNo : XML_I18N_CONV_FAILED,
"htmlCheckEncoding: error switching to encoding '%s'\n",
(const xmlChar *)encoding, NULL);
} else {
if (ctxt->input->encoding != NULL)
xmlFree((xmlChar *) ctxt->input->encoding);
ctxt->input->encoding = xmlStrdup((xmlChar *)encoding);
}
}
}
if ((URL != NULL) && (ctxt->input != NULL) &&

View File

@ -304,7 +304,7 @@ create:
* output as <option selected>, as per XSLT 1.0 16.2 "HTML Output Method"
*
*/
static const char* htmlBooleanAttrs[] = {
static const char* const htmlBooleanAttrs[] = {
"checked", "compact", "declare", "defer", "disabled", "ismap",
"multiple", "nohref", "noresize", "noshade", "nowrap", "readonly",
"selected", NULL
@ -384,7 +384,10 @@ htmlSaveErr(int code, xmlNodePtr node, const char *extra)
default:
msg = "unexpected error number\n";
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlSimpleError(XML_FROM_OUTPUT, code, node, msg, extra);
#pragma clang diagnostic pop
}
/************************************************************************

View File

@ -2,18 +2,18 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
SUBDIRS = include . doc example $(FUZZ_SUBDIR) $(PYTHON_SUBDIR) xstc
DIST_SUBDIRS = include . doc example python xstc
DIST_SUBDIRS = include . doc example fuzz python xstc
AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \
testReader testapi testModule runtest runsuite testchar \
testdict runxmlconf testrecurse testlimits
check_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \
testReader testapi testModule runtest runsuite testchar \
testdict runxmlconf testrecurse testlimits
bin_PROGRAMS = xmllint xmlcatalog
@ -202,7 +202,8 @@ runxmlconf_LDADD= $(LDADDS)
#testOOM_DEPENDENCIES = $(DEPS)
#testOOM_LDADD= $(LDADDS)
runtests:
runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
[ -d test ] || $(LN_S) $(srcdir)/test .
[ -d result ] || $(LN_S) $(srcdir)/result .
$(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
@ -222,10 +223,10 @@ asan:
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_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES)
tests: XMLtests XMLRecovertests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES)
@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
$(MAKE) tests ; fi)
@(cd doc/examples ; $(MAKE) tests)
$(MAKE) -s tests ; fi)
@(cd doc/examples ; $(MAKE) -s tests)
APItests: testapi$(EXEEXT)
@echo "## Running the API regression tests this may take a little while"
@ -247,7 +248,7 @@ HTMLtests : testHTML$(EXEEXT)
diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
$(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \
diff result.$$name result2.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name result2.$$name error.$$name ; \
fi ; fi ; done)
@ -268,7 +269,7 @@ HTMLPushtests : testHTML$(EXEEXT)
diff -b errorcut.$$name errorcut2.$$name ; \
$(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
diff result.$$name result2.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
fi ; fi ; done)
@echo "## HTML SAX regression tests"
@ -282,7 +283,7 @@ HTMLPushtests : testHTML$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name.sax ; \
fi ; fi ; done)
@echo "## Push HTML SAX regression tests"
@ -296,10 +297,29 @@ HTMLPushtests : testHTML$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name.sax ; \
fi ; fi ; done)
HTMLRecovertests : xmllint$(EXEEXT)
@(echo > .memdump)
@echo "## HTML recover regression tests"
-@(for i in $(srcdir)/test/recover/html/* ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/recover/html/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --html --recover $$i > $(srcdir)/result/recover/html/$$name 2> $(srcdir)/result/recover/html/$$name.err ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \
log=`$(CHECKER) $(top_builddir)/xmllint --html --recover $$i > result.$$name 2> error.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/recover/html/$$name result.$$name ; \
diff -b $(srcdir)/result/recover/html/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm -f result.$$name error.$$name ; \
fi ; fi ; done)
XMLtests : xmllint$(EXEEXT)
@(echo > .memdump)
@echo "## XML regression tests"
@ -317,7 +337,7 @@ XMLtests : xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name` ;\
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name result2.$$name ; \
fi ; fi ; done)
@echo "## XML regression tests on memory"
@ -334,7 +354,7 @@ XMLtests : xmllint$(EXEEXT)
diff $(srcdir)/result/$$name result.$$name ; \
$(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
diff result.$$name result2.$$name ; \
rm result.$$name result2.$$name ; \
fi ; fi ; done)
@ -356,10 +376,29 @@ XMLPushtests: xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name result2.$$name ; \
fi ; fi ; done)
XMLRecovertests: xmllint$(EXEEXT)
@(echo > .memdump)
@echo "## XML recover regression tests"
-@(for i in $(srcdir)/test/recover/xml/* ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/recover/xml/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --recover $$i > $(srcdir)/result/recover/xml/$$name 2> $(srcdir)/result/recover/xml/$$name.err ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \
log=`$(CHECKER) $(top_builddir)/xmllint --recover $$i > result.$$name 2> error.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/recover/xml/$$name result.$$name ; \
diff -b $(srcdir)/result/recover/xml/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm -f result.$$name error.$$name ; \
fi ; fi ; done)
NStests : xmllint$(EXEEXT)
@(echo > .memdump)
@echo "## XML Namespaces regression tests"
@ -377,7 +416,7 @@ NStests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/namespaces/$$name result.$$name ; \
diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@ -398,7 +437,7 @@ IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/xmlid/$$name result.$$name ; \
diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@ -419,7 +458,25 @@ Errtests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/errors/$$name result.$$name ; \
diff $(srcdir)/result/errors/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@echo "## Error cases regression tests (old 1.0)"
-@(for i in $(srcdir)/test/errors10/*.xml ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/errors10/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --oldxml10 $$i \
2> $(srcdir)/result/errors10/$$name.err \
> $(srcdir)/result/errors10/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \
log=`$(CHECKER) $(top_builddir)/xmllint --oldxml10 $$i 2> error.$$name > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/errors10/$$name result.$$name ; \
diff $(srcdir)/result/errors10/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@echo "## Error cases stream regression tests"
@ -436,7 +493,7 @@ Errtests : xmllint$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/errors/$$name.str error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm error.$$name ; \
fi ; fi ; done)
@ -459,7 +516,7 @@ XMLenttests : xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name result2.$$name ; \
fi ; fi ; done)
@ -477,7 +534,7 @@ URItests : testURI$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/URI/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
-@(for i in $(srcdir)/test/URI/*.uri ; do \
@ -491,7 +548,7 @@ URItests : testURI$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/URI/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@ -505,13 +562,13 @@ XPathtests : testXPath$(EXEEXT)
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
$(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \
log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i > result.$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done ; \
for i in $(srcdir)/test/XPath/docs/* ; do \
@ -526,10 +583,10 @@ XPathtests : testXPath$(EXEEXT)
$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \
log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done ; fi ; done)
@ -547,13 +604,13 @@ XPtrtests : testXPath$(EXEEXT)
if [ ! -d $$j ] ; then \
if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \
log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \
log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > result.$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done ; fi ; done)
@ -572,7 +629,7 @@ XIncludetests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XInclude/$$name result.$$name ; \
diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
@ -587,7 +644,7 @@ XIncludetests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XInclude/$$name result.$$name ; \
diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@(echo > .memdump)
@ -604,7 +661,7 @@ XIncludetests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
@ -619,7 +676,7 @@ XIncludetests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \
diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@ -640,7 +697,7 @@ Scripttests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/scripts/$$name result.$$name ; \
diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name result.$$name.err ; \
fi ; fi ; done)
@ -659,7 +716,7 @@ Catatests : xmlcatalog$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
-@(for i in $(srcdir)/test/catalogs/*.script ; do \
@ -674,7 +731,7 @@ Catatests : xmlcatalog$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## Add and del operations on XML Catalogs"
@ -738,7 +795,7 @@ Readertests : xmllint$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.rdr result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## Reader on memory regression tests"
@ -753,7 +810,7 @@ Readertests : xmllint$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.rdr result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@(echo > .memdump)
@ -769,7 +826,7 @@ Readertests : xmllint$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.rdr result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## Reader entities substitution regression tests"
@ -784,7 +841,7 @@ Readertests : xmllint$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.rde result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@ -802,7 +859,7 @@ SAXtests : testSAX$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.sax result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## SAX2 callbacks regression tests"
@ -817,7 +874,37 @@ SAXtests : testSAX$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.sax2 result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## SAX2 callbacks regression tests with entity substitution"
-@(for i in $(srcdir)/test/* ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/noent/$$name.sax2 ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testSAX --sax2 --noent $$i > $(srcdir)/result/noent/$$name.sax2 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/testSAX --sax2 --noent $$i > result.$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/noent/$$name.sax2 result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## SAX2 stop on fatal error regression tests"
-@(for i in $(srcdir)/test/saxerrors/* ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/saxerrors/$$name.sax2 ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --sax --sax-fatal-stop $$i > $(srcdir)/result/saxerrors/$$name.sax2 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/xmllint --sax --sax-fatal-stop $$i > result.$$name 2> /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/saxerrors/$$name.sax2 result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@ -829,7 +916,7 @@ Validtests : xmllint$(EXEEXT)
if [ ! -d $$i ] ; then \
log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
fi ; done ; exit 0)
@echo "## Validity checking regression tests"
-@(for i in $(srcdir)/test/VC/* ; do \
@ -843,7 +930,7 @@ Validtests : xmllint$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/VC/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## General documents valid regression tests"
@ -859,7 +946,7 @@ Validtests : xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/valid/$$name result.$$name ; \
diff $(srcdir)/result/valid/$$name.err error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@ -871,14 +958,16 @@ Regexptests: testRegexp$(EXEEXT)
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
$(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name 2> $(srcdir)/result/regexp/$$name.err ; \
if [ ! -s "$(srcdir)/result/regexp/$$name.err" ] ; then rm $(srcdir)/result/regexp/$$name.err; fi ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \
log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i > result.$$name 2> error.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/regexp/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
rm result.$$name ; \
diff $(srcdir)/result/regexp/$$name result.$$name ; \
if [ -s "$(srcdir)/result/regexp/$$name.err" -o -s "error.$$name" ] ; then diff $(srcdir)/result/regexp/$$name.err error.$$name ; fi` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name error.$$name ; \
fi ; fi ; done)
@echo "## Formal expresssions regression tests"
-@(for i in $(srcdir)/test/expr/* ; do \
@ -892,7 +981,7 @@ Regexptests: testRegexp$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/expr/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@ -910,7 +999,7 @@ Automatatests: testAutomata$(EXEEXT)
log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/automata/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@ -961,7 +1050,7 @@ C14Ntests : testC14N$(EXEEXT)
cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \
fi; \
fi; \
$$cmdline > $(srcdir)/test/c14n/test.tmp; \
$$cmdline > $(srcdir)/test/c14n/test.tmp 2> /dev/null; \
if [ $$? -eq 0 ]; then \
diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \
if [ $$? -ne 0 ]; then \
@ -1002,7 +1091,34 @@ Schemastests: testSchemas$(EXEEXT)
diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \
err.$$name;\
grep Unimplemented err.$$name`; \
if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo "$$log" ; fi ; \
rm res.$$name err.$$name ; \
fi ; fi ;\
done; done)
@echo "## Schemas streaming regression tests"
-@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \
name=`basename $$i | sed 's+_.*++'`; \
sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \
for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \
if [ -f $$j ] ; then \
xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \
then \
echo New test file "$$name"_"$$sno"_"$$xno" ; \
$(CHECKER) $(top_builddir)/testSchemas --stream $$i $$j \
> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err.rdr; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/testSchemas --stream $$i $$j \
> res.$$name 2> err.$$name;\
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
res.$$name;\
diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err.rdr \
err.$$name;\
grep Unimplemented err.$$name`; \
if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo "$$log" ; fi ; \
rm res.$$name err.$$name ; \
fi ; fi ;\
done; done)
@ -1027,7 +1143,7 @@ Relaxtests: xmllint$(EXEEXT)
diff $(srcdir)/result/relaxng/"$$name"_err \
err.$$name | grep -v "error detected at";\
grep Unimplemented err.$$name`; \
if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo schemas $$name result ; echo "$$log" ; fi ; \
rm res.$$name err.$$name ; \
fi; \
for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
@ -1049,7 +1165,7 @@ Relaxtests: xmllint$(EXEEXT)
diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
err.$$name | grep -v "error detected at";\
grep Unimplemented err.$$name`; \
if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \
rm res.$$name err.$$name ; \
fi ; fi ; \
done; done)
@ -1075,7 +1191,7 @@ Relaxtests: xmllint$(EXEEXT)
diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
err.$$name | grep -v "error detected at";\
fi ; grep Unimplemented err.$$name`; \
if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \
rm res.$$name err.$$name ; \
fi ; fi ; \
done; done)
@ -1104,7 +1220,7 @@ Schematrontests: xmllint$(EXEEXT)
diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
err.$$name | grep -v "error detected at";\
grep Unimplemented err.$$name`; \
if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \
rm res.$$name err.$$name ; \
fi ; fi ; \
done; done)
@ -1153,7 +1269,7 @@ Patterntests: xmllint$(EXEEXT)
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
done ;\
diff $(srcdir)/result/pattern/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done ;)

View File

View File

@ -64,22 +64,28 @@ xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) {
ctxt->errNo = XML_ERR_NO_MEMORY;
if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
schannel = ctxt->sax->serror;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(schannel,
ctxt->vctxt.error, ctxt->vctxt.userData,
ctxt, NULL, XML_FROM_PARSER, XML_ERR_NO_MEMORY,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
NULL, NULL, 0, 0,
msg, (const char *) str1, NULL);
#pragma clang diagnostic pop
ctxt->errNo = XML_ERR_NO_MEMORY;
ctxt->instate = XML_PARSER_EOF;
ctxt->disableSAX = 1;
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(schannel,
NULL, NULL,
ctxt, NULL, XML_FROM_PARSER, XML_ERR_NO_MEMORY,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
NULL, NULL, 0, 0,
msg, (const char *) str1, NULL);
#pragma clang diagnostic pop
}
}
@ -106,20 +112,26 @@ xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
ctxt->errNo = error;
if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
schannel = ctxt->sax->serror;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(schannel,
ctxt->vctxt.error, ctxt->vctxt.userData,
ctxt, NULL, XML_FROM_DTD, error,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
(const char *) str2, NULL, 0, 0,
msg, (const char *) str1, (const char *) str2);
#pragma clang diagnostic pop
ctxt->valid = 0;
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(schannel,
NULL, NULL,
ctxt, NULL, XML_FROM_DTD, error,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
(const char *) str2, NULL, 0, 0,
msg, (const char *) str1, (const char *) str2);
#pragma clang diagnostic pop
}
}
@ -142,10 +154,13 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
return;
if (ctxt != NULL)
ctxt->errNo = error;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
XML_ERR_FATAL, NULL, 0,
(const char *) str1, (const char *) str2,
NULL, 0, 0, msg, str1, str2);
#pragma clang diagnostic pop
if (ctxt != NULL) {
ctxt->wellFormed = 0;
ctxt->valid = 0;
@ -173,10 +188,13 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
return;
if (ctxt != NULL)
ctxt->errNo = error;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
XML_ERR_WARNING, NULL, 0,
(const char *) str1, NULL,
NULL, 0, 0, msg, str1);
#pragma clang diagnostic pop
}
/**
@ -198,10 +216,13 @@ xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
return;
if (ctxt != NULL)
ctxt->errNo = error;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error,
XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2,
NULL, 0, 0, msg, str1, str2);
#pragma clang diagnostic pop
}
/**
@ -222,10 +243,13 @@ xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
return;
if (ctxt != NULL)
ctxt->errNo = error;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error,
XML_ERR_WARNING, NULL, 0,
(const char *) str1, (const char *) str2,
NULL, 0, 0, msg, str1, str2);
#pragma clang diagnostic pop
}
/**
@ -2176,6 +2200,50 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
xmlFree(dup);
}
#ifdef __APPLE__
#include <dispatch/dispatch.h>
#include <mach-o/dyld.h>
extern int dyld_get_program_sdk_version(void);
#define DYLD_MACOSX_VERSION_10_9 0x000A0900
// libxml2 v2.9 changed how elements with undeclared namespace prefixes are handled, an error case that has undefined behavior,
// in such a way that broke Microsoft Document Connection. Detect Microsoft Document Connection and mimic the old behavior.
static bool evaluateStartElementNSNeedsUndeclaredPrefixQuirk(void)
{
const char* executablePath = _dyld_get_image_name(0);
if (!executablePath)
return false;
// Find the base name portion of the path.
const char* executableName = strrchr(executablePath, '/');
if (!executableName)
return false;
// Move past the slash.
executableName++;
if (strcmp(executableName, "Microsoft Document Connection"))
return false;
// Apply the workaround if the application was linked against an SDK prior to where
// libxml2 v2.9 was present.
return dyld_get_program_sdk_version() < DYLD_MACOSX_VERSION_10_9;
}
static bool startElementNSNeedsUndeclaredPrefixQuirk(void)
{
static bool needsQuirk;
static dispatch_once_t hasEvaluatedQuirk;
dispatch_once(&hasEvaluatedQuirk, ^{
needsQuirk = evaluateStartElementNSNeedsUndeclaredPrefixQuirk();
});
return needsQuirk;
}
#endif
/**
* xmlSAX2StartElementNs:
* @ctx: the user data (XML parser context)
@ -2228,6 +2296,9 @@ xmlSAX2StartElementNs(void *ctx,
ctxt->validate = 0;
}
#ifdef __APPLE__
if (!startElementNSNeedsUndeclaredPrefixQuirk()) {
#endif
/*
* Take care of the rare case of an undefined namespace prefix
*/
@ -2242,6 +2313,9 @@ xmlSAX2StartElementNs(void *ctx,
lname = xmlBuildQName(localname, prefix, NULL, 0);
}
}
#ifdef __APPLE__
}
#endif
/*
* allocate the node
*/
@ -2311,7 +2385,7 @@ xmlSAX2StartElementNs(void *ctx,
} else {
/*
* any out of memory error would already have been raised
* but we can't be garanteed it's the actual error due to the
* but we can't be guaranteed it's the actual error due to the
* API, best is to skip in this case
*/
continue;
@ -2805,7 +2879,8 @@ xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
xmlTextConcat(lastChild, value, len);
} else {
ret = xmlNewCDataBlock(ctxt->myDoc, value, len);
xmlAddChild(ctxt->node, ret);
if (xmlAddChild(ctxt->node, ret) == NULL)
xmlFreeNode(ret);
}
}

View File

0
autogen.sh → libxml2/autogen.sh Executable file → Normal file
View File

View File

@ -49,7 +49,7 @@ struct _xmlBuf {
size_t use; /* The buffer size used */
size_t size; /* The buffer size */
xmlBufferPtr buffer; /* wrapper for an old buffer */
int error; /* an error code if a failure occured */
int error; /* an error code if a failure occurred */
};
#ifdef WITH_BUFFER_COMPAT
@ -140,7 +140,7 @@ xmlBufCreate(void) {
xmlFree(ret);
return(NULL);
}
ret->content[0] = 0;
memset(ret->content, 0, (ret->size * sizeof(xmlChar)));
ret->contentIO = NULL;
return(ret);
}
@ -175,7 +175,7 @@ xmlBufCreateSize(size_t size) {
xmlFree(ret);
return(NULL);
}
ret->content[0] = 0;
memset(ret->content, 0, (ret->size * sizeof(xmlChar)));
} else
ret->content = NULL;
ret->contentIO = NULL;
@ -417,6 +417,7 @@ xmlBufShrink(xmlBufPtr buf, size_t len) {
} else {
memmove(buf->content, &buf->content[len], buf->use);
buf->content[buf->use] = 0;
buf->size -= len;
}
UPDATE_COMPAT(buf)
return(len);
@ -701,7 +702,7 @@ xmlBufUse(const xmlBufPtr buf)
* used in the buffer. It does not account for the terminating zero
* usually needed
*
* Returns the amount or 0 if none or an error occured
* Returns the amount or 0 if none or an error occurred
*/
size_t

0
build_glob.py → libxml2/build_glob.py Executable file → Normal file
View File

View File

@ -243,11 +243,14 @@ xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error,
const char *msg, const xmlChar *str1, const xmlChar *str2,
const xmlChar *str3)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL, catal, node, XML_FROM_CATALOG,
error, XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2,
(const char *) str3, 0, 0,
msg, str1, str2, str3);
#pragma clang diagnostic pop
}

View File

View File

View File

View File

View File

0
chvalid.def → libxml2/chvalid.def Executable file → Normal file
View File

View File

@ -73,6 +73,15 @@ PKG_PROG_PKG_CONFIG
LT_INIT
dnl #ifdef __APPLE__
dnl Disable -Wl,-undefined -Wl,dynamic_lookup when using libtool to link.
case $host_os in
darwin*)
allow_undefined_flag=
;;
esac
dnl #endif // defined(__APPLE__)
dnl
dnl if the system support linker version scripts for symbol versioning
dnl then add it
@ -137,6 +146,8 @@ AC_ARG_WITH(iso8859x,
[ --with-iso8859x add ISO8859X support if no iconv (on)])
AC_ARG_WITH(legacy,
[ --with-legacy add deprecated APIs for compatibility (on)])
AC_ARG_WITH(fuzzers,
[ --with-fuzzers[[=LIB]] build libxml2 fuzzers (optionally using libFuzzer.a or AFL) (on)])
AC_ARG_WITH(mem_debug,
[ --with-mem-debug add the memory debugging module (off)])
AC_ARG_WITH(minimum,
@ -293,6 +304,10 @@ then
then
with_legacy=no
fi
if test "$with_fuzzers" = ""
then
with_fuzzers=yes
fi
if test "$with_mem_debug" = ""
then
with_mem_debug=no
@ -824,6 +839,67 @@ case ${host} in
esac
dnl
dnl Check for libFuzzer.a
dnl
AC_PROG_CXX
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
dnl If not found, download these macros to a local ./m4/ directory:
dnl https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
dnl https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
if test "$with_fuzzers" = ""
then
with_fuzzers=yes
fi
if test "$with_fuzzers" != "no" -a "$with_fuzzers" != "yes"
then
AC_MSG_CHECKING(for fuzzing library)
_libs="${LIBS}"
LIBS="${LIBS} ${with_fuzzers}"
AC_TRY_LINK([
#include <stddef.h>
#if defined(HAVE_STDINT_H)
#include <stdint.h>
#elif defined(HAVE_INTTYPES_H)
#include <inttypes.h>
#elif defined(WIN32)
typedef unsigned char uint8_t;
#endif
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);],[
return 0; } /* main */
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {],[
AC_MSG_RESULT(yes)
LIBS="${_libs}"],[
with_fuzzers=no
AC_MSG_RESULT(no)
LIBS="${_libs}"])
fi
AC_LANG_RESTORE
if test "$with_fuzzers" = "yes"
then
FUZZ_SUBDIR=fuzz
LIB_FUZZING_ENGINE=
elif test "$with_fuzzers" != "no"
then
FUZZ_SUBDIR=fuzz
LIB_FUZZING_ENGINE="${with_fuzzers}"
else
FUZZ_SUBDIR=
LIB_FUZZING_ENGINE=
fi
AC_SUBST(FUZZ_SUBDIR)
AC_SUBST(LIB_FUZZING_ENGINE)
AM_CONDITIONAL(USE_STANDALONE_FUZZING_ENGINE, test "$with_fuzzers" = "yes")
dnl
dnl check for python
dnl
@ -1265,7 +1341,7 @@ if test "$with_html" = "no" ; then
else
WITH_HTML=1
HTML_OBJ="HTMLparser.o HTMLtree.o"
TEST_HTML=HTMLtests
TEST_HTML="HTMLtests HTMLRecovertests"
if test "$with_push" != "no" ; then
TEST_PHTML=HTMLPushtests
else
@ -1718,7 +1794,7 @@ rm -f COPYING.LIB COPYING
ln -s $srcdir/Copyright COPYING
# keep on one line for cygwin c.f. #130896
AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
AC_OUTPUT

0
dbgen.pl → libxml2/dbgen.pl Executable file → Normal file
View File

0
dbgenattr.pl → libxml2/dbgenattr.pl Executable file → Normal file
View File

View File

@ -168,21 +168,27 @@ static void LIBXML_ATTR_FORMAT(3,0)
xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
{
ctxt->errors++;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL,
NULL, ctxt->node, XML_FROM_CHECK,
error, XML_ERR_ERROR, NULL, 0,
NULL, NULL, NULL, 0, 0,
msg, extra);
#pragma clang diagnostic pop
}
static void LIBXML_ATTR_FORMAT(3,0)
xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra)
{
ctxt->errors++;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__xmlRaiseError(NULL, NULL, NULL,
NULL, ctxt->node, XML_FROM_CHECK,
error, XML_ERR_ERROR, NULL, 0,
NULL, NULL, NULL, 0, 0,
msg, extra);
#pragma clang diagnostic pop
}
/**
@ -2931,7 +2937,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
fprintf(ctxt->output, "\tvalidate check the document for errors\n");
#endif /* LIBXML_VALID_ENABLED */
#ifdef LIBXML_SCHEMAS_ENABLED
fprintf(ctxt->output, "\trelaxng rng validate the document agaisnt the Relax-NG schemas\n");
fprintf(ctxt->output, "\trelaxng rng validate the document against the Relax-NG schemas\n");
#endif
fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n");
#ifdef LIBXML_VALID_ENABLED

View File

@ -533,7 +533,7 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
*
* Create a new dictionary
*
* Returns the newly created dictionary, or NULL if an error occured.
* Returns the newly created dictionary, or NULL if an error occurred.
*/
xmlDictPtr
xmlDictCreate(void) {
@ -580,7 +580,7 @@ xmlDictCreate(void) {
* new dictionary, then in @sub, and if not found are created in the
* new dictionary.
*
* Returns the newly created dictionary, or NULL if an error occured.
* Returns the newly created dictionary, or NULL if an error occurred.
*/
xmlDictPtr
xmlDictCreateSub(xmlDictPtr sub) {
@ -699,7 +699,7 @@ xmlDictGrow(xmlDictPtr dict, size_t size) {
} else {
/*
* we don't have much ways to alert from herei
* result is loosing an entry and unicity garantee
* result is losing an entry and unicity guarantee
*/
ret = -1;
}

Some files were not shown because too many files have changed in this diff Show More