added a new configure option --with-push, some cleanups, chased code size
* HTMLparser.c Makefile.am configure.in legacy.c parser.c
parserInternals.c testHTML.c xmllint.c include/libxml/HTMLparser.h
include/libxml/parser.h include/libxml/parserInternals.h
include/libxml/xmlversion.h.in: added a new configure
option --with-push, some cleanups, chased code size anomalies.
Now a library configured --with-minimum is around 150KB,
sounds good enough.
Daniel
diff --git a/testHTML.c b/testHTML.c
index 4067fd4..4a6074a 100644
--- a/testHTML.c
+++ b/testHTML.c
@@ -44,7 +44,9 @@
static int sax = 0;
static int repeat = 0;
static int noout = 0;
+#ifdef LIBXML_PUSH_ENABLED
static int push = 0;
+#endif /* LIBXML_PUSH_ENABLED */
static char *encoding = NULL;
static int options = 0;
@@ -619,6 +621,7 @@
/*
* Empty callbacks for checking
*/
+#ifdef LIBXML_PUSH_ENABLED
if (push) {
FILE *f;
@@ -675,6 +678,7 @@
}
}
} else {
+#endif /* LIBXML_PUSH_ENABLED */
doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL);
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
@@ -691,7 +695,9 @@
xmlFreeDoc(doc);
}
}
+#ifdef LIBXML_PUSH_ENABLED
}
+#endif /* LIBXML_PUSH_ENABLED */
}
static void
@@ -782,8 +788,10 @@
#endif
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
copy++;
+#ifdef LIBXML_PUSH_ENABLED
else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push")))
push++;
+#endif /* LIBXML_PUSH_ENABLED */
else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax")))
sax++;
else if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout")))
@@ -831,7 +839,9 @@
printf("\t--sax : debug the sequence of SAX callbacks\n");
printf("\t--repeat : parse the file 100 times, for timing\n");
printf("\t--noout : do not print the result\n");
+#ifdef LIBXML_PUSH_ENABLED
printf("\t--push : use the push mode parser\n");
+#endif /* LIBXML_PUSH_ENABLED */
printf("\t--encode encoding : output in the given encoding\n");
}
xmlCleanupParser();