annotate libinterp/corefcn/sighandlers.h @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
3 Copyright (C) 1993-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
5 See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
6 or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
7
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
9 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
10
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24520
diff changeset
11 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
12 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24520
diff changeset
13 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
14 (at your option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
16 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
17 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
19 GNU General Public License for more details.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6972
diff changeset
22 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24520
diff changeset
23 <https://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
24
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
2939
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
27 /*
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
28
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
29 The signal blocking macros defined below were adapted from similar
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
30 functions from GNU Bash, the Bourne Again SHell, copyright (C) 1994
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
31 Free Software Foundation, Inc.
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
32
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
33 */
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
34
834
44ce29d8cb7b [project @ 1994-10-19 18:17:44 by jwe]
jwe
parents: 383
diff changeset
35 // This file should always be included after config.h!
44ce29d8cb7b [project @ 1994-10-19 18:17:44 by jwe]
jwe
parents: 383
diff changeset
36
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
37 #if ! defined (octave_sighandlers_h)
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 296
diff changeset
38 #define octave_sighandlers_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
39
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21186
diff changeset
40 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21186
diff changeset
41
22049
ccf50f029999 move octave_child_list to separate file and define inside namespace
John W. Eaton <jwe@octave.org>
parents: 21988
diff changeset
42 #include "child-list.h"
3566
4b1a93f83264 [project @ 2000-02-03 09:19:49 by jwe]
jwe
parents: 3546
diff changeset
43
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
44 namespace octave
2705
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
45 {
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
46 // This type must match the typedef in signal-wrappers.h.
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
47 typedef void sig_handler (int);
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
48
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
49 struct
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
50 interrupt_handler
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
51 {
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
52 sig_handler *int_handler;
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
53 sig_handler *brk_handler;
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
54 };
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
55
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
56 // Nonzero means we have already printed a message for this series of
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
57 // SIGPIPES. We assume that the writer will eventually give up.
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
58 extern int pipe_handler_error_count;
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
59
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
60 // TRUE means we can be interrupted.
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
61 extern OCTINTERP_API bool can_interrupt;
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
62
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
63 extern OCTINTERP_API sig_handler *
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
64 set_signal_handler (int sig, sig_handler *h,
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
65 bool restart_syscalls = true);
2554
f7e3d23f0a8f [project @ 1996-11-21 01:41:57 by jwe]
jwe
parents: 2469
diff changeset
66
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
67 extern OCTINTERP_API sig_handler *
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
68 set_signal_handler (const char *signame, sig_handler *h,
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
69 bool restart_syscalls = true);
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
70
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
71 extern OCTINTERP_API void install_signal_handlers (void);
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
72
24520
c5c11b07598a refactor signal handling (bug #52757)
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
73 extern OCTINTERP_API void respond_to_pending_signals (void);
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
74
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
75 extern OCTINTERP_API interrupt_handler catch_interrupts (void);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
76
22051
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
77 extern OCTINTERP_API interrupt_handler ignore_interrupts (void);
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
78
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
79 extern OCTINTERP_API interrupt_handler
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
80 set_interrupt_handler (const volatile interrupt_handler& h,
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
81 bool restart_syscalls = true);
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
82
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
83 // TRUE means we should try to enter the debugger on SIGINT.
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
84 extern OCTINTERP_API bool Vdebug_on_interrupt;
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
85 }
6db928d06b07 move signal functions into octave namespace
John W. Eaton <jwe@octave.org>
parents: 22049
diff changeset
86
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
87 #endif