mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-25 02:02:11 +03:00
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
This commit is contained in:
10
testHTML.c
10
testHTML.c
@ -44,7 +44,9 @@ static int copy = 0;
|
||||
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 @@ parseSAXFile(char *filename) {
|
||||
/*
|
||||
* Empty callbacks for checking
|
||||
*/
|
||||
#ifdef LIBXML_PUSH_ENABLED
|
||||
if (push) {
|
||||
FILE *f;
|
||||
|
||||
@ -675,6 +678,7 @@ parseSAXFile(char *filename) {
|
||||
}
|
||||
}
|
||||
} 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 @@ parseSAXFile(char *filename) {
|
||||
xmlFreeDoc(doc);
|
||||
}
|
||||
}
|
||||
#ifdef LIBXML_PUSH_ENABLED
|
||||
}
|
||||
#endif /* LIBXML_PUSH_ENABLED */
|
||||
}
|
||||
|
||||
static void
|
||||
@ -782,8 +788,10 @@ int main(int argc, char **argv) {
|
||||
#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 @@ int main(int argc, char **argv) {
|
||||
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();
|
||||
|
Reference in New Issue
Block a user