added initialisation for ctxt->vctxt in HTMLInitParser (bug 133127) minor
* HTMLparser.c: added initialisation for ctxt->vctxt
in HTMLInitParser (bug 133127)
* valid.c: minor cosmetic change (removed ATTRIBUTE_UNUSED
from several function params)
diff --git a/ChangeLog b/ChangeLog
index e892a31..b7ad8e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Feb 6 15:28:36 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * HTMLparser.c: added initialisation for ctxt->vctxt
+ in HTMLInitParser (bug 133127)
+ * valid.c: minor cosmetic change (removed ATTRIBUTE_UNUSED
+ from several function params)
+
Tue Feb 3 16:48:57 PST 2004 William Brack <wbrack@mmm.com.hk>
* xinclude.c: fixed problem regarding freeing of dictionary
diff --git a/HTMLparser.c b/HTMLparser.c
index 7c0d32a..db7a485 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -64,7 +64,7 @@
************************************************************************/
/**
- * xmlErrMemory:
+ * htmlErrMemory:
* @ctxt: an HTML parser context
* @extra: extra informations
*
@@ -3893,7 +3893,7 @@
************************************************************************/
/**
- * xmlInitParserCtxt:
+ * htmlInitParserCtxt:
* @ctxt: an HTML parser context
*
* Initialize a parser context
@@ -3986,6 +3986,9 @@
ctxt->replaceEntities = 0;
ctxt->linenumbers = xmlLineNumbersDefaultValue;
ctxt->html = 1;
+ ctxt->vctxt.userData = ctxt;
+ ctxt->vctxt.error = xmlParserValidityError;
+ ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->record_info = 0;
ctxt->validate = 0;
ctxt->nbChars = 0;
diff --git a/valid.c b/valid.c
index 96b54dd..b0c2507 100644
--- a/valid.c
+++ b/valid.c
@@ -132,7 +132,6 @@
channel = ctxt->error;
data = ctxt->userData;
pctxt = ctxt->userData;
- pctxt = ctxt->userData;
}
__xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error,
XML_ERR_ERROR, NULL, 0,
@@ -152,7 +151,7 @@
* Handle a validation error, provide contextual informations
*/
static void
-xmlErrValidNode(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlErrValidNode(xmlValidCtxtPtr ctxt,
xmlNodePtr node, xmlParserErrors error,
const char *msg, const xmlChar * str1,
const xmlChar * str2, const xmlChar * str3)
@@ -166,7 +165,6 @@
channel = ctxt->error;
data = ctxt->userData;
pctxt = ctxt->userData;
- pctxt = ctxt->userData;
}
__xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error,
XML_ERR_ERROR, NULL, 0,
@@ -179,14 +177,14 @@
* @ctxt: an XML validation parser context
* @node: the node raising the error
* @error: the error number
- * @str1: extra informations
- * @str2: extra informations
- * @str3: extra informations
+ * @str1: extra information
+ * @str2: extra information
+ * @str3: extra information
*
- * Handle a validation error, provide contextual informations
+ * Handle a validation error, provide contextual information
*/
static void
-xmlErrValidWarning(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlErrValidWarning(xmlValidCtxtPtr ctxt,
xmlNodePtr node, xmlParserErrors error,
const char *msg, const xmlChar * str1,
const xmlChar * str2, const xmlChar * str3)
@@ -200,7 +198,6 @@
channel = ctxt->error;
data = ctxt->userData;
pctxt = ctxt->userData;
- pctxt = ctxt->userData;
}
__xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error,
XML_ERR_WARNING, NULL, 0,
@@ -1219,7 +1216,7 @@
* Returns NULL if not, otherwise the entity
*/
xmlElementPtr
-xmlAddElementDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlAddElementDecl(xmlValidCtxtPtr ctxt,
xmlDtdPtr dtd, const xmlChar *name,
xmlElementTypeVal type,
xmlElementContentPtr content) {
@@ -1777,7 +1774,7 @@
* Returns NULL if not new, otherwise the attribute decl
*/
xmlAttributePtr
-xmlAddAttributeDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlAddAttributeDecl(xmlValidCtxtPtr ctxt,
xmlDtdPtr dtd, const xmlChar *elem,
const xmlChar *name, const xmlChar *ns,
xmlAttributeType type, xmlAttributeDefault def,
@@ -2183,7 +2180,7 @@
* Returns NULL if not, otherwise the entity
*/
xmlNotationPtr
-xmlAddNotationDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDtdPtr dtd,
+xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
const xmlChar *name,
const xmlChar *PublicID, const xmlChar *SystemID) {
xmlNotationPtr ret;
@@ -2729,7 +2726,7 @@
* Returns NULL if not, otherwise the new xmlRefPtr
*/
xmlRefPtr
-xmlAddRef(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDocPtr doc, const xmlChar *value,
+xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
xmlAttrPtr attr) {
xmlRefPtr ret;
xmlRefTablePtr table;
@@ -5267,7 +5264,7 @@
* Returns 1 if yes, 0 if no, -1 in case of error
*/
static int
-xmlValidateCheckMixed(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlValidateCheckMixed(xmlValidCtxtPtr ctxt,
xmlElementContentPtr cont, const xmlChar *qname) {
const xmlChar *name;
int plen;