[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [xml] initGenericErrorDefaultFunc weirdness.
- From: "William M. Brack" <wbrack mmm com hk>
- To: "Jose Commins" <axora myrealbox com>
- Cc: xml gnome org
- Subject: Re: [xml] initGenericErrorDefaultFunc weirdness.
- Date: Wed, 2 Jun 2004 10:37:46 +0800 (HKT)
Jose Commins said:
>
> Odd, I am trying to use:
>
> initGenericErrorDefaultFunc((xmlGenericErrorFunc)MyXMLErrorFunction);
>
> But I get this error on compilation:
>
> main.c:109: passing arg 1 of `initGenericErrorDefaultFunc' from
> incompatible pointer type
>
> And here's my function:
>
> void MyXMLErrorFunction(void *ctx, const char *msg, ...)
> {
> printf("Aiee! And error has occured!\n");
> }
>
>
> I've tried everything: using the direct address, different
> assignments
> and so on, but I either get the same error or bus errors. I *do*
> have
> this working:
>
> xmlSetGenericErrorFunc(NULL,
> (xmlGenericErrorFunc)MyXMLErrorFunction);
>
> And that works fine.
>
> But, am I doing something wrong with the declaration/assignment of
> 'initGenericErrorDefaultFunc' or is it b0rked?
>
>
> Regards,
> Jose.
>From xmlerror.h:
XMLPUBFUN void XMLCALL
xmlSetGenericErrorFunc (void *ctx,
xmlGenericErrorFunc handler);
XMLPUBFUN void XMLCALL
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
so perhaps you could try
initGenericErrorDefaultFunc(&(xmlGenericErrorFunc)MyXMLErrorFunction);
(i.e. use the '&' address-of operator)?
Regards,
Bill
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]