diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2000-10-24 17:10:12 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2000-10-24 17:10:12 +0000 |
commit | 126f27992d541f6ff897554828c339822fafee65 (patch) | |
tree | 9c49d268178d61a85f83a5e4bd8e832ed3c1361e /debugXML.c | |
parent | 3fe876892e75ac2220988daba60d059d84ce3cfb (diff) | |
download | android_external_libxml2-126f27992d541f6ff897554828c339822fafee65.tar.gz android_external_libxml2-126f27992d541f6ff897554828c339822fafee65.tar.bz2 android_external_libxml2-126f27992d541f6ff897554828c339822fafee65.zip |
Bunch of fixes, finishing moving datastructures to the hash stuff:
- hash.[ch] debugXML.c: expanded/enhanced the API, added
multikey tuples, made hash structure opaque
- valid.[ch]: moved elements, attributes, notations decalarations
as well as ID and refs to hash tables.
- entities.c: hash cleanup
- xmlmemory.c: fixed a dump problem in debug mode
- include/Makefile.am: problem passing in DESTDIR= values patch
from Marc Christensen <marc@calderasystems.com>
- nanohttp.c: removed debugging remains
- HTMLparser.c: the bogus tag should be ignored (Wayne)
- HTMLparser.c parser.c: fixing a number of problems with the
macros in the *parser.c files (Wayne).
- HTMLparser.c: close the previous option when opening a new one
(Marc Sanfacon).
- result/HTML/*: updated the HTML results accordingly
Daniel
Diffstat (limited to 'debugXML.c')
-rw-r--r-- | debugXML.c | 114 |
1 files changed, 36 insertions, 78 deletions
@@ -771,11 +771,41 @@ void xmlDebugDumpDTD(FILE *output, xmlDtdPtr dtd) { xmlDebugDumpNodeList(output, dtd->children, 1); } -void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) { - int i; - xmlHashEntryPtr ent; - xmlEntityPtr cur; +void xmlDebugDumpEntityCallback(xmlEntityPtr cur, FILE *output, + const xmlChar *name) { + fprintf(output, "%s : ", cur->name); + switch (cur->etype) { + case XML_INTERNAL_GENERAL_ENTITY: + fprintf(output, "INTERNAL GENERAL, "); + break; + case XML_EXTERNAL_GENERAL_PARSED_ENTITY: + fprintf(output, "EXTERNAL PARSED, "); + break; + case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY: + fprintf(output, "EXTERNAL UNPARSED, "); + break; + case XML_INTERNAL_PARAMETER_ENTITY: + fprintf(output, "INTERNAL PARAMETER, "); + break; + case XML_EXTERNAL_PARAMETER_ENTITY: + fprintf(output, "EXTERNAL PARAMETER, "); + break; + default: + fprintf(output, "UNKNOWN TYPE %d", + cur->etype); + } + if (cur->ExternalID != NULL) + fprintf(output, "ID \"%s\"", cur->ExternalID); + if (cur->SystemID != NULL) + fprintf(output, "SYSTEM \"%s\"", cur->SystemID); + if (cur->orig != NULL) + fprintf(output, "\n orig \"%s\"", cur->orig); + if (cur->content != NULL) + fprintf(output, "\n content \"%s\"", cur->content); + fprintf(output, "\n"); +} +void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) { if (output == NULL) output = stdout; if (doc == NULL) { fprintf(output, "DOCUMENT == NULL !\n"); @@ -829,86 +859,14 @@ void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) { xmlEntitiesTablePtr table = (xmlEntitiesTablePtr) doc->intSubset->entities; fprintf(output, "Entities in internal subset\n"); - for (i = 0;i < table->size;i++) { - ent = table->table[i]; - while (ent != NULL) { - cur = (xmlEntityPtr) ent->payload; - fprintf(output, "%d : %s : ", i, cur->name); - switch (cur->etype) { - case XML_INTERNAL_GENERAL_ENTITY: - fprintf(output, "INTERNAL GENERAL, "); - break; - case XML_EXTERNAL_GENERAL_PARSED_ENTITY: - fprintf(output, "EXTERNAL PARSED, "); - break; - case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY: - fprintf(output, "EXTERNAL UNPARSED, "); - break; - case XML_INTERNAL_PARAMETER_ENTITY: - fprintf(output, "INTERNAL PARAMETER, "); - break; - case XML_EXTERNAL_PARAMETER_ENTITY: - fprintf(output, "EXTERNAL PARAMETER, "); - break; - default: - fprintf(output, "UNKNOWN TYPE %d", - cur->etype); - } - if (cur->ExternalID != NULL) - fprintf(output, "ID \"%s\"", cur->ExternalID); - if (cur->SystemID != NULL) - fprintf(output, "SYSTEM \"%s\"", cur->SystemID); - if (cur->orig != NULL) - fprintf(output, "\n orig \"%s\"", cur->orig); - if (cur->content != NULL) - fprintf(output, "\n content \"%s\"", cur->content); - fprintf(output, "\n"); - ent = ent->next; - } - } + xmlHashScan(table, (xmlHashScanner)xmlDebugDumpEntityCallback, output); } else fprintf(output, "No entities in internal subset\n"); if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) { xmlEntitiesTablePtr table = (xmlEntitiesTablePtr) doc->extSubset->entities; fprintf(output, "Entities in external subset\n"); - for (i = 0;i < table->size;i++) { - ent = table->table[i]; - while (ent != NULL) { - cur = (xmlEntityPtr) ent->payload; - fprintf(output, "%d : %s : ", i, cur->name); - switch (cur->etype) { - case XML_INTERNAL_GENERAL_ENTITY: - fprintf(output, "INTERNAL GENERAL, "); - break; - case XML_EXTERNAL_GENERAL_PARSED_ENTITY: - fprintf(output, "EXTERNAL PARSED, "); - break; - case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY: - fprintf(output, "EXTERNAL UNPARSED, "); - break; - case XML_INTERNAL_PARAMETER_ENTITY: - fprintf(output, "INTERNAL PARAMETER, "); - break; - case XML_EXTERNAL_PARAMETER_ENTITY: - fprintf(output, "EXTERNAL PARAMETER, "); - break; - default: - fprintf(output, "UNKNOWN TYPE %d", - cur->etype); - } - if (cur->ExternalID != NULL) - fprintf(output, "ID \"%s\"", cur->ExternalID); - if (cur->SystemID != NULL) - fprintf(output, "SYSTEM \"%s\"", cur->SystemID); - if (cur->orig != NULL) - fprintf(output, "\n orig \"%s\"", cur->orig); - if (cur->content != NULL) - fprintf(output, "\n content \"%s\"", cur->content); - fprintf(output, "\n"); - ent = ent->next; - } - } + xmlHashScan(table, (xmlHashScanner)xmlDebugDumpEntityCallback, output); } else fprintf(output, "No entities in external subset\n"); } |