1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-20 16:43:05 +03:00

added support for large file, tested with a 3+GB instance, and some

* libxml.h include/libxml/parser.h parser.c xmlIO.c DOCBparser.c:
  added support for large file, tested with a 3+GB instance,
  and some cleanup.
* catalog.c: added a TODO
* Makefile.am: added some "make tests" comments
Daniel
This commit is contained in:
Daniel Veillard
2003-04-18 12:34:58 +00:00
parent e81765f610
commit 3e59fc52d5
8 changed files with 41 additions and 10 deletions

View File

@ -1,3 +1,11 @@
Fri Apr 18 14:31:15 CEST 2003 Daniel Veillard <daniel@veillard.com>
* libxml.h include/libxml/parser.h parser.c xmlIO.c DOCBparser.c:
added support for large file, tested with a 3+GB instance,
and some cleanup.
* catalog.c: added a TODO
* Makefile.am: added some "make tests" comments
Thu Apr 17 14:51:57 CEST 2003 Daniel Veillard <daniel@veillard.com> Thu Apr 17 14:51:57 CEST 2003 Daniel Veillard <daniel@veillard.com>
* relaxng.c: some cleanups * relaxng.c: some cleanups

View File

@ -4713,7 +4713,7 @@ docbParseInternalSubset(xmlParserCtxtPtr ctxt) {
*/ */
while (RAW != ']') { while (RAW != ']') {
const xmlChar *check = CUR_PTR; const xmlChar *check = CUR_PTR;
int cons = ctxt->input->consumed; unsigned int cons = ctxt->input->consumed;
SKIP_BLANKS; SKIP_BLANKS;
docbParseMarkupDecl(ctxt); docbParseMarkupDecl(ctxt);

View File

@ -408,6 +408,8 @@ XIncludetests : xmllint$(EXEEXT)
@echo "##" @echo "##"
@echo "## XInclude regression tests" @echo "## XInclude regression tests"
@echo "##" @echo "##"
@echo "## the warning reported on fallback.xml test is expected"
@echo "##"
-@(for i in $(srcdir)/test/XInclude/docs/* ; do \ -@(for i in $(srcdir)/test/XInclude/docs/* ; do \
name=`basename $$i`; \ name=`basename $$i`; \
if [ ! -d $$i ] ; then \ if [ ! -d $$i ] ; then \
@ -736,6 +738,9 @@ Relaxtests: xmllint$(EXEEXT)
@echo "##" @echo "##"
@echo "## Relax-NG streaming regression tests" @echo "## Relax-NG streaming regression tests"
@echo "##" @echo "##"
@echo "## Some error messages are different than non-streaming"
@echo "## and generate small diffs"
@echo "##"
-@(for i in $(srcdir)/test/relaxng/*.rng ; do \ -@(for i in $(srcdir)/test/relaxng/*.rng ; do \
name=`basename $$i | sed 's+\.rng++'`; \ name=`basename $$i | sed 's+\.rng++'`; \
for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \

View File

@ -47,6 +47,11 @@
* TODO: * TODO:
* *
* macro to flag unimplemented blocks * macro to flag unimplemented blocks
* XML_CATALOG_PREFER user env to select between system/public prefered
* option. C.f. Richard Tobin <richard@cogsci.ed.ac.uk>
*> Just FYI, I am using an environment variable XML_CATALOG_PREFER with
*> values "system" and "public". I have made the default be "system" to
*> match yours.
*/ */
#define TODO \ #define TODO \
xmlGenericError(xmlGenericErrorContext, \ xmlGenericError(xmlGenericErrorContext, \

View File

@ -55,7 +55,12 @@ struct _xmlParserInput {
int length; /* length if known */ int length; /* length if known */
int line; /* Current line */ int line; /* Current line */
int col; /* Current column */ int col; /* Current column */
int consumed; /* How many xmlChars already consumed */ /*
* NOTE: consumed is only tested for equality in the parser code,
* so even if there is an overflow this should not give troubles
* for parsing very large instances.
*/
unsigned long consumed; /* How many xmlChars already consumed */
xmlParserInputDeallocate free; /* function to deallocate the base */ xmlParserInputDeallocate free; /* function to deallocate the base */
const xmlChar *encoding; /* the encoding string for entity */ const xmlChar *encoding; /* the encoding string for entity */
const xmlChar *version; /* the version string for entity */ const xmlChar *version; /* the version string for entity */

View File

@ -9,6 +9,15 @@
#ifndef __XML_LIBXML_H__ #ifndef __XML_LIBXML_H__
#define __XML_LIBXML_H__ #define __XML_LIBXML_H__
#ifndef NO_LARGEFILE_SOURCE
#ifndef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
#endif
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
#include "win32config.h" #include "win32config.h"
#elif defined(macintosh) #elif defined(macintosh)

View File

@ -5044,7 +5044,7 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
while ((RAW != 0) && ((RAW != ']') || (NXT(1) != ']') || while ((RAW != 0) && ((RAW != ']') || (NXT(1) != ']') ||
(NXT(2) != '>'))) { (NXT(2) != '>'))) {
const xmlChar *check = CUR_PTR; const xmlChar *check = CUR_PTR;
int cons = ctxt->input->consumed; unsigned int cons = ctxt->input->consumed;
if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
xmlParseConditionalSections(ctxt); xmlParseConditionalSections(ctxt);
@ -5352,7 +5352,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
((RAW == '<') && (NXT(1) == '!')) || ((RAW == '<') && (NXT(1) == '!')) ||
(RAW == '%') || IS_BLANK(CUR)) { (RAW == '%') || IS_BLANK(CUR)) {
const xmlChar *check = CUR_PTR; const xmlChar *check = CUR_PTR;
int cons = ctxt->input->consumed; unsigned int cons = ctxt->input->consumed;
GROW; GROW;
if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
@ -6485,7 +6485,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
*/ */
while (RAW != ']') { while (RAW != ']') {
const xmlChar *check = CUR_PTR; const xmlChar *check = CUR_PTR;
int cons = ctxt->input->consumed; unsigned int cons = ctxt->input->consumed;
SKIP_BLANKS; SKIP_BLANKS;
xmlParseMarkupDecl(ctxt); xmlParseMarkupDecl(ctxt);
@ -6695,7 +6695,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
((RAW != '/') || (NXT(1) != '>')) && ((RAW != '/') || (NXT(1) != '>')) &&
(IS_CHAR(RAW))) { (IS_CHAR(RAW))) {
const xmlChar *q = CUR_PTR; const xmlChar *q = CUR_PTR;
int cons = ctxt->input->consumed; unsigned int cons = ctxt->input->consumed;
attname = xmlParseAttribute(ctxt, &attvalue); attname = xmlParseAttribute(ctxt, &attvalue);
if ((attname != NULL) && (attvalue != NULL)) { if ((attname != NULL) && (attvalue != NULL)) {
@ -7030,7 +7030,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
while ((RAW != 0) && while ((RAW != 0) &&
((RAW != '<') || (NXT(1) != '/'))) { ((RAW != '<') || (NXT(1) != '/'))) {
const xmlChar *test = CUR_PTR; const xmlChar *test = CUR_PTR;
int cons = ctxt->input->consumed; unsigned int cons = ctxt->input->consumed;
const xmlChar *cur = ctxt->input->cur; const xmlChar *cur = ctxt->input->cur;
/* /*
@ -8709,7 +8709,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
} }
case XML_PARSER_CONTENT: { case XML_PARSER_CONTENT: {
const xmlChar *test; const xmlChar *test;
int cons; unsigned int cons;
if ((avail < 2) && (ctxt->inputNr == 1)) if ((avail < 2) && (ctxt->inputNr == 1))
goto done; goto done;
cur = ctxt->input->cur[0]; cur = ctxt->input->cur[0];

View File

@ -1713,8 +1713,7 @@ xmlOutputBufferClose(xmlOutputBufferPtr out) {
* Returns the new parser input or NULL * Returns the new parser input or NULL
*/ */
xmlParserInputBufferPtr xmlParserInputBufferPtr
xmlParserInputBufferCreateFilename xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
(const char *URI, xmlCharEncoding enc) {
xmlParserInputBufferPtr ret; xmlParserInputBufferPtr ret;
int i = 0; int i = 0;
void *context = NULL; void *context = NULL;