RE: [xml] when to call initGenericErrorDefaultFunc()



hi,
since I didn't use it till now, I can't tell how to use the error handling
functionality of libxml, but I would like to remark, that

initGenericErrorDefaultFunc(gitk_libxml_error_func);

is implicitly converted to:

   initGenericErrorDefaultFunc(&gitk_libxml_error_func);

these two calls are semantically identical. The problem is rather that
initGenericErrorDefaultFunc takes a pointer to a function pointer as an
argument and directs this pointer to the default error handling function:

xmlerror.h:
typedef void (*xmlGenericErrorFunc) (void *ctx,
                                 const char *msg,
                                 ...);

error.c:
void
initGenericErrorDefaultFunc(xmlGenericErrorFunc * handler)
{
    if (handler == NULL)
        xmlGenericError = xmlGenericErrorDefaultFunc;
    else
        (*handler) = xmlGenericErrorDefaultFunc;
}

Cheers,
  Marcus



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