Common Lisp CFFI setjmp/longjmp

61 Views Asked by At

I am calling functions in the MuPDF C library using Common Lisp and CFFI. MuPDF uses setjmp/longjmp for exception handling. The MuPDF website states:

All functions you call should be guarded by a fz_try block to catch the errors, or the program will call exit() on errors. You don’t want that.

Even though I have yet to encounter an exception when calling MuPDF, it would be nice to handle any future exceptions in a graceful manner.

Based on my understanding of setjmp/longjmp, I think the answer to the following question is "no" (but hopefully I'm wrong). Is it possible to use Common Lisp and CFFI to hook into MuPDF's exception handling system?

If it is not possible, then this question and answer seems applicable.

0

There are 0 best solutions below