Commit a63922d8 authored by Alexandre Julliard's avatar Alexandre Julliard

xslt: Import upstream release 1.1.36.

parent 3110b72e
......@@ -14,25 +14,6 @@
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#ifdef HAVE_NAN_H
#include <nan.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/hash.h>
......
......@@ -14,9 +14,7 @@
#include "libxslt.h"
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
......
......@@ -15,13 +15,6 @@
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
......@@ -194,36 +187,18 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
xmlXPathFreeContext(xptrctxt);
#endif /* LIBXML_XPTR_ENABLED */
if (resObj == NULL)
goto out_fragment;
switch (resObj->type) {
case XPATH_NODESET:
break;
case XPATH_UNDEFINED:
case XPATH_BOOLEAN:
case XPATH_NUMBER:
case XPATH_STRING:
case XPATH_POINT:
case XPATH_USERS:
case XPATH_XSLT_TREE:
case XPATH_RANGE:
case XPATH_LOCATIONSET:
xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n",
fragment);
goto out_object;
if ((resObj != NULL) && (resObj->type != XPATH_NODESET)) {
xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n",
fragment);
xmlXPathFreeObject(resObj);
resObj = NULL;
}
valuePush(ctxt, resObj);
xmlFree(fragment);
return;
out_object:
xmlXPathFreeObject(resObj);
out_fragment:
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
if (resObj == NULL)
resObj = xmlXPathNewNodeSet(NULL);
valuePush(ctxt, resObj);
xmlFree(fragment);
}
......
......@@ -14,25 +14,6 @@
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#ifdef HAVE_NAN_H
#include <nan.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/hash.h>
......
......@@ -14,24 +14,6 @@
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#ifdef HAVE_NAN_H
#include <nan.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifndef XSLT_NEED_TRIO
#include <stdio.h>
#else
......
......@@ -18,23 +18,7 @@
#include <sys/stat.h>
#endif
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#ifdef HAVE_NAN_H
#include <nan.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32)
#include <windows.h>
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
......@@ -279,7 +263,7 @@ xsltCheckFilename (const char *path)
{
#ifdef HAVE_STAT
struct stat stat_buffer;
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32)
DWORD dwAttrs;
dwAttrs = GetFileAttributesA(path);
......@@ -384,7 +368,7 @@ xsltCheckWrite(xsltSecurityPrefsPtr sec,
if ((uri->scheme == NULL) ||
(xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32)
if ((uri->path)&&(uri->path[0]=='/')&&
(uri->path[1]!='\0')&&(uri->path[2]==':'))
ret = xsltCheckWritePath(sec, ctxt, uri->path+1);
......
......@@ -637,7 +637,6 @@ xsltNewTransformContext(xsltStylesheetPtr style, xmlDocPtr doc) {
cur->prof = 0;
cur->style = style;
xmlXPathInit();
cur->xpathCtxt = xmlXPathNewContext(doc);
if (cur->xpathCtxt == NULL) {
xsltTransformError(NULL, NULL, (xmlNodePtr) doc,
......
......@@ -363,7 +363,6 @@ xsltReleaseRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
}
/*
* Clear the document tree.
* REVISIT TODO: Do we expect ID/IDREF tables to be existent?
*/
if (RVT->children != NULL) {
xmlFreeNodeList(RVT->children);
......@@ -374,10 +373,6 @@ xsltReleaseRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
xmlFreeIDTable((xmlIDTablePtr) RVT->ids);
RVT->ids = NULL;
}
if (RVT->refs != NULL) {
xmlFreeRefTable((xmlRefTablePtr) RVT->refs);
RVT->refs = NULL;
}
/*
* Reset the ownership information.
......@@ -968,6 +963,8 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
xmlDocPtr container;
xmlNodePtr oldInsert;
xmlDocPtr oldOutput;
const xmlChar *oldLastText;
int oldLastTextSize, oldLastTextUse;
xsltStackElemPtr oldVar = ctxt->contextVariable;
/*
......@@ -993,6 +990,9 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
oldOutput = ctxt->output;
oldInsert = ctxt->insert;
oldLastText = ctxt->lasttext;
oldLastTextSize = ctxt->lasttsize;
oldLastTextUse = ctxt->lasttuse;
ctxt->output = container;
ctxt->insert = (xmlNodePtr) container;
......@@ -1007,6 +1007,9 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
ctxt->contextVariable = oldVar;
ctxt->insert = oldInsert;
ctxt->output = oldOutput;
ctxt->lasttext = oldLastText;
ctxt->lasttsize = oldLastTextSize;
ctxt->lasttuse = oldLastTextUse;
result = xmlXPathNewValueTree((xmlNodePtr) container);
}
......
......@@ -9,75 +9,6 @@
#ifndef __LIBXSLT_WIN32_CONFIG__
#define __LIBXSLT_WIN32_CONFIG__
#define HAVE_CTYPE_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_TIME_H 1
#define HAVE_LOCALTIME 1
#define HAVE_GMTIME 1
#define HAVE_TIME 1
#define HAVE_MATH_H 1
#define HAVE_FCNTL_H 1
#include <io.h>
#define HAVE_ISINF
#define HAVE_ISNAN
#include <math.h>
#ifdef _WIN32
/* MS C-runtime has functions which can be used in order to determine if
a given floating-point variable contains NaN, (+-)INF. These are
preferred, because floating-point technology is considered propriatary
by MS and we can assume that their functions know more about their
oddities than we do. */
#include <float.h>
/* Bjorn Reese figured a quite nice construct for isinf() using the
_fpclass() function. */
#ifndef isinf
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
#endif
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
#ifndef isnan
#define isnan(d) (_isnan(d))
#endif
#else /* _MSC_VER */
static int isinf (double d) {
int expon = 0;
double val = frexp (d, &expon);
if (expon == 1025) {
if (val == 0.5) {
return 1;
} else if (val == -0.5) {
return -1;
} else {
return 0;
}
} else {
return 0;
}
}
static int isnan (double d) {
int expon = 0;
double val = frexp (d, &expon);
if (expon == 1025) {
if (val == 0.5) {
return 0;
} else if (val == -0.5) {
return 0;
} else {
return 1;
}
} else {
return 0;
}
}
#endif /* _MSC_VER */
#include <direct.h>
/* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */
#if defined(_MSC_VER) && _MSC_VER < 1900
......@@ -115,15 +46,6 @@ __inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
#define HAVE_SYS_STAT_H
#define HAVE_STAT
#define HAVE_STRING_H
#include <libxml/xmlversion.h>
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED
#endif
#define _WINSOCKAPI_
#endif /* __LIBXSLT_WIN32_CONFIG__ */
......@@ -20,26 +20,26 @@ extern "C" {
*
* the version string like "1.2.3"
*/
#define LIBXSLT_DOTTED_VERSION "1.1.35"
#define LIBXSLT_DOTTED_VERSION "1.1.36"
/**
* LIBXSLT_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXSLT_VERSION 10135
#define LIBXSLT_VERSION 10136
/**
* LIBXSLT_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXSLT_VERSION_STRING "10135"
#define LIBXSLT_VERSION_STRING "10136"
/**
* LIBXSLT_VERSION_EXTRA:
*
* extra version information, used to show a CVS compilation
* extra version information, used to show a Git commit description
*/
#define LIBXSLT_VERSION_EXTRA ""
......@@ -86,7 +86,6 @@ extern "C" {
#define XSLT_NEED_TRIO
#endif
#ifdef __VMS
#define HAVE_MATH_H 1
#define HAVE_SYS_STAT_H 1
#ifndef XSLT_NEED_TRIO
#define XSLT_NEED_TRIO
......
......@@ -3,134 +3,56 @@
* Description: macros for marking symbols as exportable/importable.
*
* Copy: See Copyright for the status of this software.
*
* Author: Igor Zlatkovic <igor@zlatkovic.com>
*/
#ifndef __XSLT_EXPORTS_H__
#define __XSLT_EXPORTS_H__
/**
* XSLTPUBFUN:
* XSLTPUBFUN, XSLTPUBVAR, XSLTCALL
*
* Macros which declare an exportable function, an exportable variable and
* the calling convention used for functions.
*
* Please use an extra block for every platform/compiler combination when
* modifying this, rather than overlong #ifdef lines. This helps
* readability as well as the fact that different compilers on the same
* platform might need different definitions.
*/
#if defined(_WIN32) || defined(__CYGWIN__)
/** DOC_DISABLE */
#ifdef LIBXSLT_STATIC
#define XSLTPUBLIC
#elif defined(IN_LIBXSLT)
#define XSLTPUBLIC __declspec(dllexport)
#else
#define XSLTPUBLIC __declspec(dllimport)
#endif
#define XSLTCALL __cdecl
/** DOC_ENABLE */
#else /* not Windows */
/**
* XSLTPUBFUN:
*
* Macros which declare an exportable function
*/
#define XSLTPUBFUN
/**
* XSLTPUBVAR:
* XSLTPUBLIC:
*
* Macros which declare an exportable variable
* Macro which declares a public symbol
*/
#define XSLTPUBVAR extern
#define XSLTPUBLIC
/**
* XSLTCALL:
*
* Macros which declare the called convention for exported functions
* Macro which declares the calling convention for exported functions
*/
#define XSLTCALL
/** DOC_DISABLE */
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
#endif /* platform switch */
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
/*
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
*/
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
* XSLTPUBFUN:
*
* Macro which declares an exportable function
*/
#define XSLTPUBFUN XSLTPUBLIC
/* Cygwin platform (does not define _WIN32), GNU compiler */
#if defined(__CYGWIN__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#endif
/**
* XSLTPUBVAR:
*
* Macro which declares an exportable variable
*/
#define XSLTPUBVAR XSLTPUBLIC extern
/* Compatibility */
#if !defined(LIBXSLT_PUBLIC)
......
......@@ -32,7 +32,7 @@
typedef locale_t xsltLocale;
typedef xmlChar xsltLocaleChar;
#elif defined(_WIN32) && !defined(__CYGWIN__)
#elif defined(_WIN32)
/*
* XSLT_LOCALE_WINAPI:
......
......@@ -19,17 +19,16 @@
#endif
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdarg.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
......@@ -42,7 +41,7 @@
#include "imports.h"
#include "transform.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32)
#define XSLT_WIN32_PERFORMANCE_COUNTER
#endif
......
......@@ -13,9 +13,6 @@
#define __XML_XSLTUTILS_H__
#include <libxslt/xsltconfig.h>
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include <libxml/xpath.h>
#include <libxml/dict.h>
#include <libxml/xmlerror.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment