1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

- fix for PIs name starting with xml

- fixed a potential problem with || and && ops
 - generate win32config.h for those on the Other Side !
Daniel
This commit is contained in:
Daniel Veillard 1999-12-22 11:30:41 +00:00
parent 0caf07a701
commit 3c558c3753
22 changed files with 145 additions and 35 deletions

View File

@ -1,3 +1,8 @@
Wed Dec 22 12:20:53 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c: fix for PIs name starting with xml
* tree.c: fixed a potential problem with || and && ops
Tue Dec 21 17:22:17 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c: fixed a stupid = vs. == bug :-(

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -7,7 +7,9 @@
*/
#ifndef WIN32
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif
#include <stdio.h>

5
SAX.c
View File

@ -7,6 +7,11 @@
*/
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include "xmlmemory.h"

View File

@ -142,5 +142,5 @@ AC_SUBST(HAVE_ISINF)
AC_SUBST(Z_LIBS)
AC_SUBST(M_LIBS)
AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xml-config)
AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xml-config win32config.h)

View File

@ -7,6 +7,11 @@
* Daniel Veillard <Daniel.Veillard@w3.org>
*/
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif
#include <stdio.h>
#include "tree.h"
#include "parser.h"

View File

@ -19,7 +19,9 @@
* Daniel.Veillard@w3.org
*/
#ifndef WIN32
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -6,7 +6,9 @@
* Daniel.Veillard@w3.org
*/
#ifndef WIN32
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -6,6 +6,12 @@
* Daniel Veillard <Daniel.Veillard@w3.org>
*/
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif
#include <stdio.h>
#include <stdarg.h>
#include "parser.h"

View File

@ -14,10 +14,13 @@
/* TODO add compression support, Send the Accept- , and decompress on the
fly with ZLIB if found at compile-time */
#ifndef WIN32
#ifdef WIN32
#include "win32config.h"
#else
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif
@ -46,6 +45,14 @@
const char *xmlParserVersion = LIBXML_VERSION;
/*
* List of XML prefixed PI allowed by W3C specs
*/
const char *xmlW3CPIs[] = {
"xml-stylesheet",
NULL
};
/************************************************************************
* *
@ -3321,17 +3328,21 @@ xmlParsePITarget(xmlParserCtxtPtr ctxt) {
xmlChar *name;
name = xmlParseName(ctxt);
if ((name != NULL) && (name[3] == 0) &&
if ((name != NULL) &&
((name[0] == 'x') || (name[0] == 'X')) &&
((name[1] == 'm') || (name[1] == 'M')) &&
((name[2] == 'l') || (name[2] == 'L'))) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
ctxt->sax->error(ctxt->userData,
int i;
for (i = 0;;i++) {
if (xmlW3CPIs[i] == NULL) break;
if (!xmlStrcmp(name, (const xmlChar *)xmlW3CPIs[i]))
return(name);
}
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) {
ctxt->sax->warning(ctxt->userData,
"xmlParsePItarget: invalid name prefix 'xml'\n");
ctxt->errNo = XML_ERR_RESERVED_XML_NAME;
/* ctxt->wellFormed = 0; !!! ? */
}
return(NULL);
}
return(name);
}

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

5
tree.c
View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif
@ -3000,7 +2999,7 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace) {
if ((!xmlStrcmp(prop->name, name)) &&
(((prop->ns == NULL) && (node->ns != NULL) &&
(!xmlStrcmp(node->ns->href, namespace))) ||
(prop->ns != NULL) && (!xmlStrcmp(prop->ns->href, namespace)))) {
((prop->ns != NULL) && (!xmlStrcmp(prop->ns->href, namespace))))) {
xmlChar *ret;
ret = xmlNodeListGetString(node->doc, prop->val, 1);

View File

@ -8,8 +8,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

80
win32config.h.in Normal file
View File

@ -0,0 +1,80 @@
#define HAVE_CTYPE_H
#define HAVE_STDLIB_H
#define HAVE_MALLOC_H
#define HAVE_TIME_H
#define HAVE_FCNTL_H
#define LIBXML_VERSION "@LIBXML_VERSION@"
#include <io.h>
#include <winsock2.h>
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY
#define ENOTSOCK WSAENOTSOCK
#define EDESTADDRREQ WSAEDESTADDRREQ
#define EMSGSIZE WSAEMSGSIZE
#define EPROTOTYPE WSAEPROTOTYPE
#define ENOPROTOOPT WSAENOPROTOOPT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
#define EOPNOTSUPP WSAEOPNOTSUPP
#define EPFNOSUPPORT WSAEPFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EADDRINUSE WSAEADDRINUSE
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define ENETDOWN WSAENETDOWN
#define ENETUNREACH WSAENETUNREACH
#define ENETRESET WSAENETRESET
#define ECONNABORTED WSAECONNABORTED
#define ECONNRESET WSAECONNRESET
#define ENOBUFS WSAENOBUFS
#define EISCONN WSAEISCONN
#define ENOTCONN WSAENOTCONN
#define ESHUTDOWN WSAESHUTDOWN
#define ETOOMANYREFS WSAETOOMANYREFS
#define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED
#define ELOOP WSAELOOP
#define ENAMETOOLONG WSAENAMETOOLONG
#define EHOSTDOWN WSAEHOSTDOWN
#define EHOSTUNREACH WSAEHOSTUNREACH
#define ENOTEMPTY WSAENOTEMPTY
#define EPROCLIM WSAEPROCLIM
#define EUSERS WSAEUSERS
#define EDQUOT WSAEDQUOT
#define ESTALE WSAESTALE
#define EREMOTE WSAEREMOTE
#include <math.h>
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;
}
}

View File

@ -9,8 +9,7 @@
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -7,8 +7,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -5,8 +5,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif

View File

@ -14,8 +14,7 @@
*/
#ifdef WIN32
#define HAVE_FCNTL_H
#include <io.h>
#include "win32config.h"
#else
#include "config.h"
#endif