GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
sighandlers.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1993-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 /*
27 
28 The signal blocking macros defined below were adapted from similar
29 functions from GNU Bash, the Bourne Again SHell, copyright (C) 1994
30 Free Software Foundation, Inc.
31 
32 */
33 
34 // This file should always be included after config.h!
35 
36 #if ! defined (octave_sighandlers_h)
37 #define octave_sighandlers_h 1
38 
39 #include "octave-config.h"
40 
41 #include "child-list.h"
42 
44 
45 // This type must match the typedef in signal-wrappers.h.
46 typedef void sig_handler (int);
47 
49 {
52 };
53 
54 // Nonzero means we have already printed a message for this series of
55 // SIGPIPES. We assume that the writer will eventually give up.
56 extern int pipe_handler_error_count;
57 
58 // TRUE means we can be interrupted.
59 extern OCTINTERP_API bool can_interrupt;
60 
61 extern OCTINTERP_API sig_handler *
62 set_signal_handler (int sig, sig_handler *h,
63  bool restart_syscalls = true);
64 
65 extern OCTINTERP_API sig_handler *
66 set_signal_handler (const char *signame, sig_handler *h,
67  bool restart_syscalls = true);
68 
69 extern OCTINTERP_API void install_signal_handlers (void);
70 
71 extern OCTINTERP_API void respond_to_pending_signals (void);
72 
73 extern OCTINTERP_API interrupt_handler catch_interrupts (void);
74 
75 extern OCTINTERP_API interrupt_handler ignore_interrupts (void);
76 
77 extern OCTINTERP_API interrupt_handler
78 set_interrupt_handler (const volatile interrupt_handler& h,
79  bool restart_syscalls = true);
80 
81 // TRUE means we should try to enter the debugger on SIGINT.
82 extern OCTINTERP_API bool Vdebug_on_interrupt;
83 
85 
86 #endif
OCTAVE_END_NAMESPACE(octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTINTERP_API void install_signal_handlers(void)
Definition: sighandlers.cc:365
OCTINTERP_API interrupt_handler catch_interrupts(void)
Definition: sighandlers.cc:326
OCTINTERP_API interrupt_handler ignore_interrupts(void)
Definition: sighandlers.cc:337
int pipe_handler_error_count
Definition: sighandlers.cc:65
OCTINTERP_API sig_handler * set_signal_handler(int sig, sig_handler *h, bool restart_syscalls=true)
Definition: sighandlers.cc:259
void sig_handler(int)
Definition: sighandlers.h:46
OCTINTERP_API bool can_interrupt
Definition: sighandlers.cc:68
OCTINTERP_API interrupt_handler set_interrupt_handler(const volatile interrupt_handler &h, bool restart_syscalls=true)
Definition: sighandlers.cc:348
OCTINTERP_API void respond_to_pending_signals(void)
Definition: sighandlers.cc:110
OCTINTERP_API bool Vdebug_on_interrupt
Definition: sighandlers.cc:71
sig_handler * int_handler
Definition: sighandlers.h:50
sig_handler * brk_handler
Definition: sighandlers.h:51