3
|
1 // utils.cc -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #include <sys/types.h> |
|
25 #include <unistd.h> |
|
26 #include <signal.h> |
|
27 #include <stdlib.h> |
|
28 |
|
29 #include "f77-uscore.h" |
|
30 |
|
31 /* |
|
32 * All the STOP statements in the Fortran routines have been replaced |
|
33 * with a call to XSTOPX, defined in the file libcruft/misc/xstopx.f. |
|
34 * |
|
35 * The XSTOPX function calls this function, which will send a SIGINT |
|
36 * signal to the program that invoked it. |
|
37 * |
|
38 * Octave\'s SIGINT signal handler calls jump_to_top_level(), and the |
|
39 * user will end up at the top level instead of the shell prompt. |
|
40 * |
|
41 * Programs that don\'t handle SIGINT will be interrupted. |
|
42 */ |
|
43 |
|
44 extern "C" |
|
45 { |
|
46 |
|
47 volatile void |
|
48 #if defined (F77_APPEND_UNDERSCORE) |
|
49 do_stop_ (void) |
|
50 #else |
|
51 do_stop (void) |
|
52 #endif |
|
53 { |
|
54 kill (getpid (), SIGINT); |
|
55 abort (); |
|
56 } |
|
57 } |
|
58 |
|
59 /* |
|
60 ;;; Local Variables: *** |
|
61 ;;; mode: C++ *** |
|
62 ;;; page-delimiter: "^/\\*" *** |
|
63 ;;; End: *** |
|
64 */ |