1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

- speedup of IS_CHAR like macros, significant overall improvement

- More interfaces for new I/O functions: xmlNewIOInputStream,
  xmlParserInputBufferCreateIO, xmlCreateIOParserCtxt
- added I/O test to xmllint
Daniel
This commit is contained in:
Daniel Veillard
2000-04-12 13:27:38 +00:00
parent fc708e2b7c
commit 5e873c4627
13 changed files with 936 additions and 683 deletions

View File

@ -46,6 +46,7 @@ static int debug = 0;
static int copy = 0;
static int recovery = 0;
static int push = 0;
static int speed = 0;
xmlSAXHandler emptySAXHandlerStruct = {
NULL, /* internalSubset */
@ -635,20 +636,33 @@ void parseAndPrintFile(char *filename) {
fclose(f);
}
} else {
/*
* Empty callbacks for checking
*/
res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
if (!speed) {
/*
* Empty callbacks for checking
*/
res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
/*
* Debug callback
*/
res = xmlSAXUserParseFile(debugSAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
/*
* Debug callback
*/
res = xmlSAXUserParseFile(debugSAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
} else {
/*
* test 100x the SAX parse
*/
int i;
for (i = 0; i<100;i++)
res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
}
}
}
@ -669,6 +683,9 @@ int main(int argc, char **argv) {
else if ((!strcmp(argv[i], "-push")) ||
(!strcmp(argv[i], "--push")))
push++;
else if ((!strcmp(argv[i], "-speed")) ||
(!strcmp(argv[i], "--speed")))
speed++;
}
for (i = 1; i < argc ; i++) {
if (argv[i][0] != '-') {