[liblouis-liblouisxml] Re: Getting libxml2 to use lou_logPrint for its error messages.

  • From: Christian Egli <christian.egli@xxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 13 Jan 2010 15:29:17 +0100

Hi

"John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxx> writes:
> If you uncomment the code that assigns the callback and then try an xml 
> file with errors you will get a segmentation fault. I'm not sure I'm 
> using the right function assignment or the right parameters. 

I seem to have found a solution for the problem where libxml2 wasn't
using lou_logPrint. Check the latest commit in liblouisxml
(http://code.google.com/p/liblouisxml/source/detail?r=206). I used
http://github.com/martine/LogJam/blob/master/src/tools.c#L284 as an
example on how to achieve this. However as you see from the example what
is missing is the clean up part. I do not free the context (
xmlFreeParserCtxt(ctxt);) and I do not set the old error handler
(apparently through initGenericErrorDefaultFunc(NULL);). I tried to do
this but I got a segmentation fault.

Maybe this helps for further explorations

Thanks
Christian
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland
For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: