Could someone please review this patch before I commit it? It fixed a
bunch of compile problems with the latest libxml2 snapshot.
After appling this patch, I'm left with the following error which I
don't know how to fix:
ut_xml_libxml2.cpp: In method `UT_Error UT_XML::html (const char *)':
/usr/include/gnome-xml/libxml/parser.h:423: too many arguments to
function `xmlParserCtxt
*xmlCreatePushParserCtxt (xmlSAXHandler *, void *, const char *, int,
const char *)'
ut_xml_libxml2.cpp:244: at this point in file
ut_xml_libxml2.cpp: In method `UT_Error UT_XML::html (const char *,
unsigned int)':
/usr/include/gnome-xml/libxml/parser.h:423: too many arguments to
function `xmlParserCtxt
*xmlCreatePushParserCtxt (xmlSAXHandler *, void *, const char *, int,
const char *)'
ut_xml_libxml2.cpp:302: at this point in file
ut_xml_libxml2.cpp: In method `char *UT_XML::decode (const char *)':
ut_xml_libxml2.cpp:378: `xmlStringDecodeEntities' undeclared (first use
this function)
ut_xml_libxml2.cpp:378: (Each undeclared identifier is reported only
once for each function it appears in.)
ut_xml_libxml2.cpp:379: Unable to find a register to spill in class `
AREG'.
ut_xml_libxml2.cpp:379: confused by earlier errors, bailing out
Index: abi/src/af/util/xp/ut_xml_libxml2.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_xml_libxml2.cpp,v
retrieving revision 1.5
diff -u -r1.5 ut_xml_libxml2.cpp
--- abi/src/af/util/xp/ut_xml_libxml2.cpp 13 May 2002 15:03:23 -0000 1.5
+++ abi/src/af/util/xp/ut_xml_libxml2.cpp 13 May 2002 15:08:47 -0000
@@ -184,7 +184,7 @@
hdl.endElement = _endElement;
hdl.characters = _charData;
- ctxt = xmlCreateMemoryParserCtxt (buffer, (int) length);
+ ctxt = xmlCreateMemoryParserCtxt (const_cast<char *>(buffer), (int) length);
if (ctxt == NULL)
{
UT_DEBUGMSG (("Unable to create libxml2 memory context!\n"));
@@ -241,7 +241,7 @@
if (length)
{
- ctxt = htmlCreatePushParserCtxt (&hdl, (void *) this, buffer, (int) length, szFilename, XML_CHAR_ENCODING_NONE);
+ ctxt = xmlCreatePushParserCtxt (&hdl, (void *) this, buffer, (int) length, szFilename, XML_CHAR_ENCODING_NONE);
if (ctxt == NULL)
{
UT_DEBUGMSG (("Unable to create libxml2 (HTML) push-parser context!\n"));
@@ -255,7 +255,7 @@
length = reader->readBytes (buffer, sizeof (buffer));
done = (length < sizeof (buffer));
- if (htmlParseChunk (ctxt, buffer, (int) length, 0))
+ if (xmlParseChunk (ctxt, buffer, (int) length, 0))
{
UT_DEBUGMSG (("Error parsing '%s'\n",szFilename));
ret = UT_IE_IMPORTERROR;
@@ -264,14 +264,14 @@
}
if (ret == UT_OK)
if (!m_bStopped)
- if (htmlParseChunk (ctxt, buffer, 0, 1))
+ if (xmlParseChunk (ctxt, buffer, 0, 1))
{
UT_DEBUGMSG (("Error parsing '%s'\n",szFilename));
ret = UT_IE_IMPORTERROR;
}
ctxt->sax = NULL;
- htmlFreeParserCtxt (ctxt);
+ xmlFreeParserCtxt (ctxt);
reader->closeFile ();
@@ -299,7 +299,7 @@
if (length)
{
- ctxt = htmlCreatePushParserCtxt (&hdl, (void *) this, buffer, (int) length, 0, XML_CHAR_ENCODING_NONE);
+ ctxt = xmlCreatePushParserCtxt (&hdl, (void *) this, buffer, (int) length, 0, XML_CHAR_ENCODING_NONE);
if (ctxt == NULL)
{
UT_DEBUGMSG (("Unable to create libxml2 (HTML) push-parser context!\n"));
@@ -308,14 +308,14 @@
xmlSubstituteEntitiesDefault (1);
}
if (!m_bStopped)
- if (htmlParseChunk (ctxt, buffer, 0, 1))
+ if (xmlParseChunk (ctxt, buffer, 0, 1))
{
UT_DEBUGMSG (("Error parsing buffer\n"));
ret = UT_IE_IMPORTERROR;
}
ctxt->sax = NULL;
- htmlFreeParserCtxt (ctxt);
+ xmlFreeParserCtxt (ctxt);
return ret;
}