Re: [xml] when to call initGenericErrorDefaultFunc()



 --- Stefan Kost <kost imn htwk-leipzig de> a écrit : 
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

I'm not a specialist, but what you give to this function is a pointer
on a function pointer...
Is it really what you want to do?

Generally I wrote things like this:
initGenericErrorDefaultFunc(gitk_libxml_error_func);

Hope it helps.

Fabien.




___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



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