GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
cquit.c
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <signal.h>
28 #include <string.h>
29 
30 #include "quit.h"
31 
33 
34 void
36 {
37  memcpy (save_buf, current_context, sizeof (octave_jmp_buf));
38 }
39 
40 void
42 {
43  memcpy (current_context, save_buf, sizeof (octave_jmp_buf));
44 }
45 
46 void
48 {
49 #if defined (OCTAVE_HAVE_SIG_JUMP)
50  siglongjmp (current_context, 1);
51 #else
52  longjmp (current_context, 1);
53 #endif
54 }
55 
57 
58 sig_atomic_t octave_interrupt_state = 0;
59 
60 sig_atomic_t octave_exception_state = 0;
61 
63 
65 
66 volatile sig_atomic_t octave_signal_caught = 0;
volatile sig_atomic_t octave_signal_caught
Definition: cquit.c:66
sig_atomic_t octave_exit_exception_safe_to_return
Definition: cquit.c:64
jmp_buf octave_jmp_buf
Definition: quit.h:47
void octave_restore_current_context(void *save_buf)
Definition: cquit.c:41
sig_atomic_t octave_exit_exception_status
Definition: cquit.c:62
void octave_jump_to_enclosing_context(void)
Definition: cquit.c:47
sig_atomic_t octave_exception_state
Definition: cquit.c:60
sig_atomic_t octave_interrupt_state
Definition: cquit.c:58
sig_atomic_t octave_interrupt_immediately
Definition: cquit.c:56
octave_jmp_buf current_context
Definition: cquit.c:32
void octave_save_current_context(void *save_buf)
Definition: cquit.c:35