Mercurial > octave
annotate libinterp/corefcn/sighandlers.h @ 22049:ccf50f029999
move octave_child_list to separate file and define inside namespace
* liboctave/system/child-list.cc, liboctave/system/child-list.h:
New files.
* liboctave/system/module.mk: Update.
* sighandlers.h, sighandlers.cc: Move octave_child and
octave_child_list classes to separate files in liboctave and defined
inside the octave namespace. Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 06 Jul 2016 14:57:54 -0400 |
parents | 3ff59d4f9411 |
children | 6db928d06b07 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17958
diff
changeset
|
3 Copyright (C) 1993-2015 John W. Eaton |
1 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
1 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
1 | 20 |
21 */ | |
22 | |
2939 | 23 /* |
24 | |
25 The signal blocking macros defined below were adapted from similar | |
26 functions from GNU Bash, the Bourne Again SHell, copyright (C) 1994 | |
27 Free Software Foundation, Inc. | |
28 | |
29 */ | |
30 | |
834 | 31 // This file should always be included after config.h! |
32 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
33 #if ! defined (octave_sighandlers_h) |
383 | 34 #define octave_sighandlers_h 1 |
1 | 35 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21186
diff
changeset
|
36 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21186
diff
changeset
|
37 |
22049
ccf50f029999
move octave_child_list to separate file and define inside namespace
John W. Eaton <jwe@octave.org>
parents:
21988
diff
changeset
|
38 #include "child-list.h" |
3566 | 39 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17778
diff
changeset
|
40 // FIXME: the data should probably be private... |
2554 | 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 typedef void octave_sig_handler (int); |
ccf50f029999
move octave_child_list to separate file and define inside namespace
John W. Eaton <jwe@octave.org>
parents:
21988
diff
changeset
|
43 |
2705 | 44 struct |
45 octave_interrupt_handler | |
46 { | |
21941
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
47 octave_sig_handler *int_handler; |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
48 octave_sig_handler *brk_handler; |
2705 | 49 }; |
2554 | 50 |
1 | 51 // Nonzero means we have already printed a message for this series of |
52 // SIGPIPES. We assume that the writer will eventually give up. | |
53 extern int pipe_handler_error_count; | |
54 | |
3018 | 55 // TRUE means we can be interrupted. |
6972 | 56 extern OCTINTERP_API bool can_interrupt; |
1 | 57 |
21941
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
58 extern OCTINTERP_API octave_sig_handler * |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
59 octave_set_signal_handler (int sig, octave_sig_handler *, |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
60 bool restart_syscalls = true); |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
61 |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
62 extern OCTINTERP_API octave_sig_handler * |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
63 octave_set_signal_handler (const char *signame, octave_sig_handler *, |
1d23b75cbcd1
hide signal.h from C++ sources
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
64 bool restart_syscalls = true); |
1443 | 65 |
6109 | 66 extern OCTINTERP_API void install_signal_handlers (void); |
1 | 67 |
6109 | 68 extern OCTINTERP_API void octave_signal_handler (void); |
5142 | 69 |
6109 | 70 extern OCTINTERP_API octave_interrupt_handler octave_catch_interrupts (void); |
2554 | 71 |
6109 | 72 extern OCTINTERP_API octave_interrupt_handler octave_ignore_interrupts (void); |
2554 | 73 |
6109 | 74 extern OCTINTERP_API octave_interrupt_handler |
5770 | 75 octave_set_interrupt_handler (const volatile octave_interrupt_handler&, |
10313 | 76 bool restart_syscalls = true); |
1651 | 77 |
2214 | 78 // extern void ignore_sigchld (void); |
79 | |
15595
6e780fb15c14
Make Vdebug_on_interrupt not be static
Max Brister <max@2bass.com>
parents:
15195
diff
changeset
|
80 // TRUE means we should try to enter the debugger on SIGINT. |
6e780fb15c14
Make Vdebug_on_interrupt not be static
Max Brister <max@2bass.com>
parents:
15195
diff
changeset
|
81 extern OCTINTERP_API bool Vdebug_on_interrupt; |
6e780fb15c14
Make Vdebug_on_interrupt not be static
Max Brister <max@2bass.com>
parents:
15195
diff
changeset
|
82 |
1 | 83 #endif |