Mercurial > octave
diff libcruft/misc/quit.cc @ 5142:0f9108f298ab
[project @ 2005-02-12 02:29:34 by jwe]
author | jwe |
---|---|
date | Sat, 12 Feb 2005 02:29:35 +0000 |
parents | ef4bdde0805d |
children | 4c8a2e4e0717 |
line wrap: on
line diff
--- a/libcruft/misc/quit.cc Thu Feb 10 18:37:55 2005 +0000 +++ b/libcruft/misc/quit.cc Sat Feb 12 02:29:35 2005 +0000 @@ -26,14 +26,29 @@ #include <cstring> +#include <iostream> #include <new> #include "quit.h" +void (*octave_signal_hook) (void) = 0; void (*octave_interrupt_hook) (void) = 0; void (*octave_bad_alloc_hook) (void) = 0; void +octave_handle_signal (void) +{ + if (octave_signal_hook) + octave_signal_hook (); + + if (octave_interrupt_state > 0) + { + octave_interrupt_state = -1; + octave_throw_interrupt_exception (); + } +} + +void octave_throw_interrupt_exception (void) { if (octave_interrupt_hook)