diff options
author | Mike Hommey <glandium@debian.org> | 2005-03-27 13:13:58 +0000 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2005-03-27 13:13:58 +0000 |
commit | 50e5b428562964b1eb2f876370058b34b47c5e90 (patch) | |
tree | c66bcae6dbbce07128ee881353ff60090524462c /testReader.c | |
parent | a7457388701e6ccba9091ba3ec09505dc903b758 (diff) | |
download | libxml2-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.c | 6 |
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")) || |