[LIBXML2] Update to version 2.10.0. CORE-17766
[reactos.git] / sdk / lib / 3rdparty / libxml2 / entities.c
index 1a8f86f..8443551 100644 (file)
@@ -15,9 +15,8 @@
 #include "libxml.h"
 
 #include <string.h>
-#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#endif
+
 #include <libxml/xmlmemory.h>
 #include <libxml/hash.h>
 #include <libxml/entities.h>
@@ -86,7 +85,7 @@ xmlEntitiesErrMemory(const char *extra)
  * @code:  the error code
  * @msg:  the message
  *
- * Handle an out of memory condition
+ * Raise an error.
  */
 static void LIBXML_ATTR_FORMAT(2,0)
 xmlEntitiesErr(xmlParserErrors code, const char *msg)
@@ -94,6 +93,23 @@ xmlEntitiesErr(xmlParserErrors code, const char *msg)
     __xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL);
 }
 
+/**
+ * xmlEntitiesWarn:
+ * @code:  the error code
+ * @msg:  the message
+ *
+ * Raise a warning.
+ */
+static void LIBXML_ATTR_FORMAT(2,0)
+xmlEntitiesWarn(xmlParserErrors code, const char *msg, const xmlChar *str1)
+{
+    __xmlRaiseError(NULL, NULL, NULL,
+                NULL, NULL, XML_FROM_TREE, code,
+                XML_ERR_WARNING, NULL, 0,
+                (const char *)str1, NULL, NULL, 0, 0,
+                msg, (const char *)str1, NULL);
+}
+
 /*
  * xmlFreeEntity : clean-up an entity record.
  */
@@ -255,9 +271,9 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
                     }
                 }
                 if (!valid) {
-                    xmlEntitiesErr(XML_ERR_ENTITY_PROCESSING,
+                    xmlEntitiesWarn(XML_ERR_ENTITY_PROCESSING,
                             "xmlAddEntity: invalid redeclaration of predefined"
-                            " entity");
+                            " entity '%s'", name);
                     return(NULL);
                 }
             }
@@ -1159,5 +1175,3 @@ xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) {
     xmlHashScan(table, xmlDumpEntityDeclScan, buf);
 }
 #endif /* LIBXML_OUTPUT_ENABLED */
-#define bottom_entities
-#include "elfgcchack.h"