octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to Octave shutdown procedures


From: Jaroslav Hajek
Subject: Re: Patch to Octave shutdown procedures
Date: Tue, 19 May 2009 21:56:58 +0200

On Tue, May 19, 2009 at 9:36 PM, John Swensen <address@hidden> wrote:
>
> On May 19, 2009, at 3:21 PM, Jaroslav Hajek wrote:
>>
>> But why don't you call octave_main with embedded = true and just call
>> main_loop afterwards?
>>
>> octave_main (argc, argv, true);
>>
>> // possibly call install_signal_handlers () and adjust the handlers
>>
>> main_loop ();
>>
>> // cleanup
>> do_octave_atexit ();
>> sysdep_cleanup ();
>>
>> what's the problem with this scheme?
>>
>>
>
> I think there are 2 problem with this approach:
> 1) That still doesn't solve the problem of the Octave quit function and the
> signal handlers calling exit().  I suppose I could replace all the Octave
> signal handlers with my own, but that seems like just asking for trouble and
> would still have the problem with the Octave quit function.

I think your approach solves the problem with signal handlers neither.
quit() is a real trouble.
Maybe it'd be best if there was an octave_exit function pointer, that
could be replaced?
In all places where we call exit() now, we'd just just call (*octave_exit)().

> 2) How do you force octave_parse () to return something other than zero to
> make it exit the main_loop function?  I tried looking through parse.cc, but
> can't understand exactly what is going on in the octave_parse function
> (#defined as the yyparse function) and what exact condition will cause it to
> return a non-zero value.
>

how do you supply input to Octave? just writing EOF to the stream
where Octave reads its input from should suffice.
manually setting parser_end_of_input may also work, but I wouldn't recommend it.

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]