[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Determining if glp_error_hook is set
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Determining if glp_error_hook is set |
Date: |
Sun, 7 Mar 2010 23:29:40 +0300 |
> in glpk-java I use the glp_error_hook. I set it before calling
> a function and use setjmp.
> This is what my error handler looks like:
> void glp_java_error_hook(void *in) {
> /* free GLPK memory */
> glp_free_env();
> /* safely return */
> longjmp(*((jmp_buf*)in), 1);
> When in a callback a glp_functions fails this results
> in the wrong long jump being executed because the glpk-java
> wrapper library is not aware of the callback.
> Is there a way to determine if the error hook function is
> already set or not?
Currently not, however, glp_error_hook can be changed to return, say,
the following structure:
typedef struct { void *func, *info; } glp_hook;
(also suitable for glp_term_hook). Would this be sufficient?
> I am missing functions to retrieve the error hook function and
> the info which could be used to build a chain of error
> handlers.