summaryrefslogtreecommitdiff
path: root/testReader.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2005-03-27 13:13:58 +0000
committerMike Hommey <glandium@debian.org>2005-03-27 13:13:58 +0000
commit50e5b428562964b1eb2f876370058b34b47c5e90 (patch)
treec66bcae6dbbce07128ee881353ff60090524462c /testReader.c
parenta7457388701e6ccba9091ba3ec09505dc903b758 (diff)
downloadlibxml2-50e5b428562964b1eb2f876370058b34b47c5e90.tar.gz
Load /tmp/tmp.XJZ6qc/libxml2-2.6.18 intoupstream/2.6.18
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'testReader.c')
-rw-r--r--testReader.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/testReader.c b/testReader.c
index a874250..4d5711b 100644
--- a/testReader.c
+++ b/testReader.c
@@ -39,12 +39,14 @@ int dump = 0;
int noent = 0;
int count = 0;
int valid = 0;
+int consumed = 0;
static void usage(const char *progname) {
printf("Usage : %s [options] XMLfiles ...\n", progname);
printf("\tParse the XML files using the xmlTextReader API\n");
printf("\t --count: count the number of attribute and elements\n");
printf("\t --valid: validate the document\n");
+ printf("\t --consumed: count the number of bytes consumed\n");
exit(1);
}
static int elem, attrs;
@@ -87,6 +89,8 @@ static void handleFile(const char *filename) {
/*
* Done, cleanup and status
*/
+ if (consumed)
+ printf("%ld bytes consumed by parser\n", xmlTextReaderByteConsumed(reader));
xmlFreeTextReader(reader);
if (ret != 0) {
printf("%s : failed to parse\n", filename);
@@ -113,6 +117,8 @@ int main(int argc, char **argv) {
dump++;
else if ((!strcmp(argv[i], "-count")) || (!strcmp(argv[i], "--count")))
count++;
+ else if ((!strcmp(argv[i], "-consumed")) || (!strcmp(argv[i], "--consumed")))
+ consumed++;
else if ((!strcmp(argv[i], "-valid")) || (!strcmp(argv[i], "--valid")))
valid++;
else if ((!strcmp(argv[i], "-noent")) ||