On 2015-11-05 22:20, Heinrich Schuchardt wrote:
Hello Jeroen,
could you, please, describe the use case for the patch.
My use case is really for using GLPK through SageMath, which is a
mathematical program with an interactive Python interface. I want to
convert GLPK errors to Python exceptions. For this I install an error
hook and a term hook. But I need to distinguish between normal messages
and error messages.
Currently both normal messages and error messages are sent to stdout,
which does not match usual usage of output streams.
I propose to store the information if an error message is written in
env->term_out and to use a new value GLP_ERROR = 2 to indicate an error
message.
This value then should be used in glp_puts to decide if a message shall
be sent to stdout or stderr.
An API function could be provided to read env->term_out. The return
value could be used in the terminal hook function.
Sure, I don't really care so much *how* this feature is added. I
implemented it the way I did mainly because it was the simplest solution.
Jeroen.
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk