OLD | NEW |
1 /* | 1 /* |
2 * entities.c : implementation for the XML entities handling | 2 * entities.c : implementation for the XML entities handling |
3 * | 3 * |
4 * See Copyright for the status of this software. | 4 * See Copyright for the status of this software. |
5 * | 5 * |
6 * daniel@veillard.com | 6 * daniel@veillard.com |
7 */ | 7 */ |
8 | 8 |
9 #define IN_LIBXML | 9 #define IN_LIBXML |
10 #include "libxml.h" | 10 #include "libxml.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 xmlEntityPtr ret; | 152 xmlEntityPtr ret; |
153 | 153 |
154 ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity)); | 154 ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity)); |
155 if (ret == NULL) { | 155 if (ret == NULL) { |
156 xmlEntitiesErrMemory("xmlCreateEntity: malloc failed"); | 156 xmlEntitiesErrMemory("xmlCreateEntity: malloc failed"); |
157 return(NULL); | 157 return(NULL); |
158 } | 158 } |
159 memset(ret, 0, sizeof(xmlEntity)); | 159 memset(ret, 0, sizeof(xmlEntity)); |
160 ret->type = XML_ENTITY_DECL; | 160 ret->type = XML_ENTITY_DECL; |
161 ret->checked = 0; | 161 ret->checked = 0; |
| 162 ret->guard = XML_ENTITY_NOT_BEING_CHECKED; |
162 | 163 |
163 /* | 164 /* |
164 * fill the structure. | 165 * fill the structure. |
165 */ | 166 */ |
166 ret->etype = (xmlEntityType) type; | 167 ret->etype = (xmlEntityType) type; |
167 if (dict == NULL) { | 168 if (dict == NULL) { |
168 ret->name = xmlStrdup(name); | 169 ret->name = xmlStrdup(name); |
169 if (ExternalID != NULL) | 170 if (ExternalID != NULL) |
170 ret->ExternalID = xmlStrdup(ExternalID); | 171 ret->ExternalID = xmlStrdup(ExternalID); |
171 if (SystemID != NULL) | 172 if (SystemID != NULL) |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 if (ent->ExternalID != NULL) | 925 if (ent->ExternalID != NULL) |
925 cur->ExternalID = xmlStrdup(ent->ExternalID); | 926 cur->ExternalID = xmlStrdup(ent->ExternalID); |
926 if (ent->SystemID != NULL) | 927 if (ent->SystemID != NULL) |
927 cur->SystemID = xmlStrdup(ent->SystemID); | 928 cur->SystemID = xmlStrdup(ent->SystemID); |
928 if (ent->content != NULL) | 929 if (ent->content != NULL) |
929 cur->content = xmlStrdup(ent->content); | 930 cur->content = xmlStrdup(ent->content); |
930 if (ent->orig != NULL) | 931 if (ent->orig != NULL) |
931 cur->orig = xmlStrdup(ent->orig); | 932 cur->orig = xmlStrdup(ent->orig); |
932 if (ent->URI != NULL) | 933 if (ent->URI != NULL) |
933 cur->URI = xmlStrdup(ent->URI); | 934 cur->URI = xmlStrdup(ent->URI); |
| 935 cur->guard = 0; |
934 return(cur); | 936 return(cur); |
935 } | 937 } |
936 | 938 |
937 /** | 939 /** |
938 * xmlCopyEntitiesTable: | 940 * xmlCopyEntitiesTable: |
939 * @table: An entity table | 941 * @table: An entity table |
940 * | 942 * |
941 * Build a copy of an entity table. | 943 * Build a copy of an entity table. |
942 * | 944 * |
943 * Returns the new xmlEntitiesTablePtr or NULL in case of error. | 945 * Returns the new xmlEntitiesTablePtr or NULL in case of error. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 * | 1098 * |
1097 * This will dump the content of the entity table as an XML DTD definition | 1099 * This will dump the content of the entity table as an XML DTD definition |
1098 */ | 1100 */ |
1099 void | 1101 void |
1100 xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) { | 1102 xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) { |
1101 xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDeclScan, buf); | 1103 xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDeclScan, buf); |
1102 } | 1104 } |
1103 #endif /* LIBXML_OUTPUT_ENABLED */ | 1105 #endif /* LIBXML_OUTPUT_ENABLED */ |
1104 #define bottom_entities | 1106 #define bottom_entities |
1105 #include "elfgcchack.h" | 1107 #include "elfgcchack.h" |
OLD | NEW |