Eduardo Cavazos <[email protected]> wrote:

Here's how I'm defining 'XSetErrorHandler' on the Chicken side:

(define XSetErrorHandler
 (foreign-safe-lambda c-pointer XSetErrorHandler
   (function int (c-pointer c-pointer))))

And finally, a test error handler:

(define-external (xerrorhandler (c-pointer dpy) (c-pointer ev)) int
 (display "Error handler called\n"))

If I trigger an X error, I get a pretty wacky error:

   Error: bad argument count - received 134902918 but expected 2: #()

felix winkelmann wrote:

How do you invoke XSetErrorHandler?

In this particular case, like this:

    (XSetErrorHandler xerrorhandler)

But ideally, the API should work such that you can do flexible stuff like:

    (XSetErrorHandler (lambda (dpy ev) ...))

I.e. pass arbitrary callbacks at runtime.

Ed


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to