mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
Started working on the hash table module integration, fixed a bug:
- entities.[ch] xpath.[ch] hash.[ch] debugXML.c tree.h: added/hacked hash tables from Bjorn Reese <breese@mail1.stofanet.dk>. Switched XPath functions and XML entities table to them. More to come... - xmlIO.c: fixed libxml closing FILEs it didn't open. Daniel
This commit is contained in:
19
debugXML.c
19
debugXML.c
@ -773,6 +773,7 @@ void xmlDebugDumpDTD(FILE *output, xmlDtdPtr dtd) {
|
||||
|
||||
void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
int i;
|
||||
xmlHashEntryPtr ent;
|
||||
xmlEntityPtr cur;
|
||||
|
||||
if (output == NULL) output = stdout;
|
||||
@ -828,9 +829,10 @@ void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
|
||||
doc->intSubset->entities;
|
||||
fprintf(output, "Entities in internal subset\n");
|
||||
for (i = 0;i < table->max_entities;i++) {
|
||||
cur = table->table[i];
|
||||
while (cur != NULL) {
|
||||
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:
|
||||
@ -861,7 +863,7 @@ void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
if (cur->content != NULL)
|
||||
fprintf(output, "\n content \"%s\"", cur->content);
|
||||
fprintf(output, "\n");
|
||||
cur = cur->nexte;
|
||||
ent = ent->next;
|
||||
}
|
||||
}
|
||||
} else
|
||||
@ -870,9 +872,10 @@ void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
|
||||
doc->extSubset->entities;
|
||||
fprintf(output, "Entities in external subset\n");
|
||||
for (i = 0;i < table->max_entities;i++) {
|
||||
cur = table->table[i];
|
||||
while (cur != NULL) {
|
||||
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:
|
||||
@ -903,7 +906,7 @@ void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
if (cur->content != NULL)
|
||||
fprintf(output, "\n content \"%s\"", cur->content);
|
||||
fprintf(output, "\n");
|
||||
cur = cur->nexte;
|
||||
ent = ent->next;
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
Reference in New Issue
Block a user