Commit c1aa3d82 authored by Jim Fulton's avatar Jim Fulton

major update with expat 1.1 and new pyexpat

parent 773b9f8b
*shared* *shared*
pyexpat pyexpat.o expat/libexpat.a -Iexpat/xmlparse pyexpat pyexpat.c -DXML_NS -Iexpat/xmlparse -Iexpat/xmltok expat/xmlparse/xmlparse.c expat/xmlparse/hashtable.c expat/xmltok/xmlrole.c expat/xmltok/xmltok.c
CC=cc CC=gcc
CFLAGS=-O2 -Ixmltok -Ixmlparse # If you know what your system's byte order is, define XML_BYTE_ORDER:
# use -DXML_BYTE_ORDER=12 for little-endian byte order;
# use -DXML_BYTE_ORDER=21 for big-endian (network) byte order.
# -DXML_NS adds support for checking of lexical aspects of XML namespaces spec
# -DXML_MIN_SIZE makes a smaller but slower parser
CFLAGS=-O2 -Ixmltok -Ixmlparse -DXML_NS
# Use one of the next two lines; unixfilemap is better if it works. # Use one of the next two lines; unixfilemap is better if it works.
FILEMAP_OBJ=xmlwf/unixfilemap.o FILEMAP_OBJ=xmlwf/unixfilemap.o
#FILEMAP_OBJ=xmlwf/readfilemap.o #FILEMAP_OBJ=xmlwf/readfilemap.o
OBJS=xmltok/xmltok.o \ OBJS=xmltok/xmltok.o \
xmltok/xmlrole.o \ xmltok/xmlrole.o \
xmlwf/xmlwf.o \ xmlwf/xmlwf.o \
xmlwf/xmlfile.o \
xmlwf/codepage.o \
xmlparse/xmlparse.o \ xmlparse/xmlparse.o \
xmlparse/hashtable.o \ xmlparse/hashtable.o \
$(FILEMAP_OBJ) $(FILEMAP_OBJ)
EXE= EXE=
all: xmlwf/xmlwf$(EXE) all: xmlwf/xmlwf$(EXE)
libexpat.a: $(OBJS)
ar cr libexpat.a $(OBJS)
xmlwf/xmlwf$(EXE): $(OBJS) xmlwf/xmlwf$(EXE): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS)
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd"> "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML> <HTML>
<TITLE>expat</TITLE> <TITLE>expat</TITLE>
<BODY> <BODY>
<H1>expat - XML Parser Toolkit</H1> <H1>expat - XML Parser Toolkit</H1>
<H3>Version 19980405</H3>
<P> <H3>Version 1.1</H3>
Copyright (c) 1998 James Clark. Expat is subject to the <A
HREF="MPL-1_0.html">Mozilla Public License Version 1.0</A>. You may <P>Copyright (c) 1998, 1999 James Clark. Expat is subject to the <A
not use expat except in compliance with this license. Please contact HREF="http://www.mozilla.org/NPL/NPL-1_1Final.html">Mozilla Public
me if you wish to negotiate an alternative license.</P><P> License Version 1.1</A>. Alternatively you may use expat under the <A
Expat is an <A HREF="http://www.w3.org/TR/1998/REC-xml-19980210">XML href="http://www.gnu.org/copyleft/gpl.html">GNU General Public
1.0</A> parser written in C. It aims to be fully conforming. It is License</A> instead. Please contact me if you wish to negotiate an
currently not a validating XML processor. alternative license.</P>
Expat can be downloaded from <A href =
"ftp://ftp.jclark.com/pub/xml/expat.zip">ftp://ftp.jclark.com/pub/xml/expat.zip</A>. <P>Expat is an <A
This is a beta-test version.</P> HREF="http://www.w3.org/TR/1998/REC-xml-19980210">XML 1.0</A> parser
<P> written in C. It aims to be fully conforming. It is currently not a
The directory <SAMP>xmltok</SAMP> contains a low-level library for validating XML processor. The current production version of expat can
tokenizing XML. The interface is documented in <SAMP>xmltok/xmltok.h</SAMP>.</P> be downloaded from <A href = "ftp://ftp.jclark.com/pub/xml/expat.zip"
<P> >ftp://ftp.jclark.com/pub/xml/expat.zip</A>.</P>
The directory <SAMP>xmlparse</SAMP> contains an XML parser library
<P>The directory <SAMP>xmltok</SAMP> contains a low-level library for
tokenizing XML. The interface is documented in
<SAMP>xmltok/xmltok.h</SAMP>.</P>
<P>The directory <SAMP>xmlparse</SAMP> contains an XML parser library
which is built on top of the <SAMP>xmltok</SAMP> library. The which is built on top of the <SAMP>xmltok</SAMP> library. The
interface is documented in <SAMP>xmlparse/xmlparse.h</SAMP>.</P> interface is documented in <SAMP>xmlparse/xmlparse.h</SAMP>. The
<P> directory <SAMP>sample</SAMP> contains a simple example program using
The directory <SAMP>xmlwf</SAMP> contains the <SAMP>xmlwf</SAMP> this interface; <SAMP>sample/build.bat</SAMP> is a batch file to build
the example using Visual C++.</P>
<P>The directory <SAMP>xmlwf</SAMP> contains the <SAMP>xmlwf</SAMP>
application, which uses the <SAMP>xmlparse</SAMP> library. The application, which uses the <SAMP>xmlparse</SAMP> library. The
arguments to <SAMP>xmlwf</SAMP> are one or more files which are each arguments to <SAMP>xmlwf</SAMP> are one or more files which are each
to be checked for well-formedness. An option <SAMP>-d to be checked for well-formedness. An option <SAMP>-d
...@@ -33,10 +45,29 @@ file the corresponding <A ...@@ -33,10 +45,29 @@ file the corresponding <A
href="http://www.jclark.com/xml/canonxml.html">canonical XML</A> will href="http://www.jclark.com/xml/canonxml.html">canonical XML</A> will
be written to <SAMP>dir/<VAR>f</VAR></SAMP>, where be written to <SAMP>dir/<VAR>f</VAR></SAMP>, where
<SAMP><VAR>f</VAR></SAMP> is the filename (without any path) of the <SAMP><VAR>f</VAR></SAMP> is the filename (without any path) of the
input file.</P> input file. A <CODE>-x</CODE> option will cause references to
external general entities to be processed. A <CODE>-s</CODE> option
will make documents that are not standalone cause an error (a document
is considered standalone if either it is intrinsically standalone
because it has no external subset and no references to parameter
entities in the internal subset or it is declared as standalone in the
XML declaration).</P>
<P>The <SAMP>bin</SAMP> directory contains Win32 executables. The
<SAMP>lib</SAMP> directory contains Win32 import libraries.</P>
<P>Answers to some frequently asked questions about expat can be found
in the <A HREF="http://www.jclark.com/xml/expatfaq.html">expat
FAQ</A>.</P>
<P></P> <P></P>
<ADDRESS> <ADDRESS>
<A HREF="mailto:jjc@jclark.com">James Clark</A> <A HREF="mailto:jjc@jclark.com">James Clark</A>
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at csompliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" Software distributed under the License is distributed on an "AS IS"
...@@ -12,21 +12,45 @@ under the License. ...@@ -12,21 +12,45 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
#include "xmldef.h" #include "xmldef.h"
#ifdef XML_UNICODE_WCHAR_T
#ifndef XML_UNICODE
#define XML_UNICODE
#endif
#endif
#include "hashtable.h" #include "hashtable.h"
#include <stdlib.h>
#include <string.h>
#define INIT_SIZE 64 #define INIT_SIZE 64
static static
unsigned long hash(const char *s) int keyeq(KEY s1, KEY s2)
{
for (; *s1 == *s2; s1++, s2++)
if (*s1 == 0)
return 1;
return 0;
}
static
unsigned long hash(KEY s)
{ {
unsigned long h = 0; unsigned long h = 0;
while (*s) while (*s)
...@@ -34,7 +58,7 @@ unsigned long hash(const char *s) ...@@ -34,7 +58,7 @@ unsigned long hash(const char *s)
return h; return h;
} }
NAMED *lookup(HASH_TABLE *table, const char *name, size_t createSize) NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize)
{ {
size_t i; size_t i;
if (table->size == 0) { if (table->size == 0) {
...@@ -52,7 +76,7 @@ NAMED *lookup(HASH_TABLE *table, const char *name, size_t createSize) ...@@ -52,7 +76,7 @@ NAMED *lookup(HASH_TABLE *table, const char *name, size_t createSize)
for (i = h & (table->size - 1); for (i = h & (table->size - 1);
table->v[i]; table->v[i];
i == 0 ? i = table->size - 1 : --i) { i == 0 ? i = table->size - 1 : --i) {
if (strcmp(name, table->v[i]->name) == 0) if (keyeq(name, table->v[i]->name))
return table->v[i]; return table->v[i];
} }
if (!createSize) if (!createSize)
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,17 +12,41 @@ under the License. ...@@ -12,17 +12,41 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
#include <stddef.h> #include <stddef.h>
#ifdef XML_UNICODE
#ifdef XML_UNICODE_WCHAR_T
typedef const wchar_t *KEY;
#else /* not XML_UNICODE_WCHAR_T */
typedef const unsigned short *KEY;
#endif /* not XML_UNICODE_WCHAR_T */
#else /* not XML_UNICODE */
typedef const char *KEY;
#endif /* not XML_UNICODE */
typedef struct { typedef struct {
const char *name; KEY name;
} NAMED; } NAMED;
typedef struct { typedef struct {
...@@ -32,7 +56,7 @@ typedef struct { ...@@ -32,7 +56,7 @@ typedef struct {
size_t usedLim; size_t usedLim;
} HASH_TABLE; } HASH_TABLE;
NAMED *lookup(HASH_TABLE *table, const char *name, size_t createSize); NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize);
void hashTableInit(HASH_TABLE *); void hashTableInit(HASH_TABLE *);
void hashTableDestroy(HASH_TABLE *); void hashTableDestroy(HASH_TABLE *);
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
...@@ -32,7 +42,7 @@ Contributor(s): ...@@ -32,7 +42,7 @@ Contributor(s):
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,12 +12,25 @@ under the License. ...@@ -12,12 +12,25 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
#define STRICT 1
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h> #include <windows.h>
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
...@@ -33,7 +43,7 @@ Contributor(s): ...@@ -33,7 +43,7 @@ Contributor(s):
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,19 +12,50 @@ under the License. ...@@ -12,19 +12,50 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
#include <string.h>
#ifdef XML_WINLIB
#define WIN32_LEAN_AND_MEAN
#define STRICT
#include <windows.h>
#define malloc(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define calloc(x, y) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x)*(y))
#define free(x) HeapFree(GetProcessHeap(), 0, (x))
#define realloc(x, y) HeapReAlloc(GetProcessHeap(), 0, x, y)
#define abort() /* as nothing */
#else /* not XML_WINLIB */
#include <stdlib.h>
#endif /* not XML_WINLIB */
/* This file can be used for any definitions needed in /* This file can be used for any definitions needed in
particular environments. */ particular environments. */
#ifdef MOZILLA #ifdef MOZILLA
#include "nspr.h" #include "nspr.h"
#define malloc(x) PR_Calloc(1,(x)) #define malloc(x) PR_Malloc(x)
#define realloc(x, y) PR_Realloc((x), (y))
#define calloc(x, y) PR_Calloc((x),(y)) #define calloc(x, y) PR_Calloc((x),(y))
#define free(x) PR_Free(x) #define free(x) PR_Free(x)
#define int int32 #define int int32
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
#include "xmldef.h" #include "xmldef.h"
...@@ -149,6 +159,7 @@ int doctype0(PROLOG_STATE *state, ...@@ -149,6 +159,7 @@ int doctype0(PROLOG_STATE *state,
case XML_TOK_PROLOG_S: case XML_TOK_PROLOG_S:
return XML_ROLE_NONE; return XML_ROLE_NONE;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = doctype1; state->handler = doctype1;
return XML_ROLE_DOCTYPE_NAME; return XML_ROLE_DOCTYPE_NAME;
} }
...@@ -594,7 +605,7 @@ int notation4(PROLOG_STATE *state, ...@@ -594,7 +605,7 @@ int notation4(PROLOG_STATE *state,
return XML_ROLE_NOTATION_SYSTEM_ID; return XML_ROLE_NOTATION_SYSTEM_ID;
case XML_TOK_DECL_CLOSE: case XML_TOK_DECL_CLOSE:
state->handler = internalSubset; state->handler = internalSubset;
return XML_ROLE_NONE; return XML_ROLE_NOTATION_NO_SYSTEM_ID;
} }
return syntaxError(state); return syntaxError(state);
} }
...@@ -610,6 +621,7 @@ int attlist0(PROLOG_STATE *state, ...@@ -610,6 +621,7 @@ int attlist0(PROLOG_STATE *state,
case XML_TOK_PROLOG_S: case XML_TOK_PROLOG_S:
return XML_ROLE_NONE; return XML_ROLE_NONE;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = attlist1; state->handler = attlist1;
return XML_ROLE_ATTLIST_ELEMENT_NAME; return XML_ROLE_ATTLIST_ELEMENT_NAME;
} }
...@@ -630,6 +642,7 @@ int attlist1(PROLOG_STATE *state, ...@@ -630,6 +642,7 @@ int attlist1(PROLOG_STATE *state,
state->handler = internalSubset; state->handler = internalSubset;
return XML_ROLE_NONE; return XML_ROLE_NONE;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = attlist2; state->handler = attlist2;
return XML_ROLE_ATTRIBUTE_NAME; return XML_ROLE_ATTRIBUTE_NAME;
} }
...@@ -689,6 +702,7 @@ int attlist3(PROLOG_STATE *state, ...@@ -689,6 +702,7 @@ int attlist3(PROLOG_STATE *state,
return XML_ROLE_NONE; return XML_ROLE_NONE;
case XML_TOK_NMTOKEN: case XML_TOK_NMTOKEN:
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = attlist4; state->handler = attlist4;
return XML_ROLE_ATTRIBUTE_ENUM_VALUE; return XML_ROLE_ATTRIBUTE_ENUM_VALUE;
} }
...@@ -836,6 +850,7 @@ int element0(PROLOG_STATE *state, ...@@ -836,6 +850,7 @@ int element0(PROLOG_STATE *state,
case XML_TOK_PROLOG_S: case XML_TOK_PROLOG_S:
return XML_ROLE_NONE; return XML_ROLE_NONE;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = element1; state->handler = element1;
return XML_ROLE_ELEMENT_NAME; return XML_ROLE_ELEMENT_NAME;
} }
...@@ -893,6 +908,7 @@ int element2(PROLOG_STATE *state, ...@@ -893,6 +908,7 @@ int element2(PROLOG_STATE *state,
state->handler = element6; state->handler = element6;
return XML_ROLE_GROUP_OPEN; return XML_ROLE_GROUP_OPEN;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = element7; state->handler = element7;
return XML_ROLE_CONTENT_ELEMENT; return XML_ROLE_CONTENT_ELEMENT;
case XML_TOK_NAME_QUESTION: case XML_TOK_NAME_QUESTION:
...@@ -940,6 +956,7 @@ int element4(PROLOG_STATE *state, ...@@ -940,6 +956,7 @@ int element4(PROLOG_STATE *state,
case XML_TOK_PROLOG_S: case XML_TOK_PROLOG_S:
return XML_ROLE_NONE; return XML_ROLE_NONE;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = element5; state->handler = element5;
return XML_ROLE_CONTENT_ELEMENT; return XML_ROLE_CONTENT_ELEMENT;
} }
...@@ -980,6 +997,7 @@ int element6(PROLOG_STATE *state, ...@@ -980,6 +997,7 @@ int element6(PROLOG_STATE *state,
state->level += 1; state->level += 1;
return XML_ROLE_GROUP_OPEN; return XML_ROLE_GROUP_OPEN;
case XML_TOK_NAME: case XML_TOK_NAME:
case XML_TOK_PREFIXED_NAME:
state->handler = element7; state->handler = element7;
return XML_ROLE_CONTENT_ELEMENT; return XML_ROLE_CONTENT_ELEMENT;
case XML_TOK_NAME_QUESTION: case XML_TOK_NAME_QUESTION:
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
#ifndef XmlRole_INCLUDED #ifndef XmlRole_INCLUDED
...@@ -44,6 +54,7 @@ enum { ...@@ -44,6 +54,7 @@ enum {
XML_ROLE_ENTITY_NOTATION_NAME, XML_ROLE_ENTITY_NOTATION_NAME,
XML_ROLE_NOTATION_NAME, XML_ROLE_NOTATION_NAME,
XML_ROLE_NOTATION_SYSTEM_ID, XML_ROLE_NOTATION_SYSTEM_ID,
XML_ROLE_NOTATION_NO_SYSTEM_ID,
XML_ROLE_NOTATION_PUBLIC_ID, XML_ROLE_NOTATION_PUBLIC_ID,
XML_ROLE_ATTRIBUTE_NAME, XML_ROLE_ATTRIBUTE_NAME,
XML_ROLE_ATTRIBUTE_TYPE_CDATA, XML_ROLE_ATTRIBUTE_TYPE_CDATA,
......
/* /*
The contents of this file are subject to the Mozilla Public License The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/ http://www.mozilla.org/MPL/
...@@ -12,10 +12,20 @@ under the License. ...@@ -12,10 +12,20 @@ under the License.
The Original Code is expat. The Original Code is expat.
The Initial Developer of the Original Code is James Clark. The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998 Portions created by James Clark are Copyright (C) 1998, 1999
James Clark. All Rights Reserved. James Clark. All Rights Reserved.
Contributor(s): Contributor(s):
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License (the "GPL"), in which case the
provisions of the GPL are applicable instead of those above. If you
wish to allow use of your version of this file only under the terms of
the GPL and not to allow others to use your version of this file under
the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the
GPL. If you do not delete the provisions above, a recipient may use
your version of this file under either the MPL or the GPL.
*/ */
enum { enum {
...@@ -42,6 +52,7 @@ enum { ...@@ -42,6 +52,7 @@ enum {
BT_LSQB, BT_LSQB,
BT_S, BT_S,
BT_NMSTRT, BT_NMSTRT,
BT_COLON,
BT_HEX, BT_HEX,
BT_DIGIT, BT_DIGIT,
BT_NAME, BT_NAME,
......
This diff is collapsed.
This diff is collapsed.
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