[xml] when to call initGenericErrorDefaultFunc()



hi,

I've searched the mails and the online-content, but found no answer, so here is it.

This is how I initialize libxml2 (2.4.21):

  //-- set own error handler
  initGenericErrorDefaultFunc(&gitk_libxml_error_func);
  //-- initialise the xml parser
  xmlInitParser();
  //-- InitParser does that for us
  //xmlXPathInit();
  xmlSubstituteEntitiesDefault(1);
  xmlLoadExtDtdDefaultValue=1;

And this is my log-handler :

void gitk_libxml_error_func(void *ctx,const char *msg,...) {
  char str[1024];
  va_list args;

  va_start(args,msg);
  vsnprintf(str,1024,msg,args);
  va_end(args);
  puts(str);
}

when compiling, gcc keeps telling me :

warning: passing arg 1 of `initGenericErrorDefaultFunc' from incompatible pointer type

this refers to the line with the initGenericErrorDefaultFunc() call.
but I can't see whats wrong with that. Upon the first libxml error I get a core dump.

Daniel, would it be possible to add a page to xmlsoft.org like "Memory Management" etc. which describes how to properly intercept error messages.

Stefan
--
      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 300066
|      ///           04277 Leipzig      04277 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail    st_kost gmx net    kost imn htwk-leipzig de
|           WWW      www.sonicpulse.de  www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - -  -    -




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]