[xslt] debugger callbacks



In libxslt, there is a structure called _xsltDebuggerCallbacks which
is part of the API for xsltSetDebuggerCallbacks().  But the structure
is in a C file (xsltutils.c), so the argument to xsltSetDebuggerCallbacks
is void *.  The members of the structure are specific functions
that have to match prototypes defined in xslutils.h.

I'm confused about why _xsltDebuggerCallbacks isn't public and the
argument to xsltSetDebuggerCallbacks isn't strongly typed.  Can
someone clue me in?  Is this some sort of forward compatibility
trade off?

I guess if the caller is passing in a structure and the sizeof the
structure changes, you've lost API compatibility, and perhaps having
an allocator/deallocator in the API isn't worthwhile.  But the
current void array scheme has a significant "ick" factor.

Can the caller just pass in the size of the structure, like:

    xsltSetDebuggerCallbacks(&mine, sizeof mine));

If the struct changes, the size will differ and the call can fail,
similar to the "(no != XSLT_CALLBACK_NUMBER)" test that's currently
there.

Thanks,
 Phil


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