280
|
1 /* dostop.c -*- 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 |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
280
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include "config.h" |
|
26 #endif |
|
27 |
|
28 #include <signal.h> |
|
29 #include <stdlib.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 volatile void |
|
45 #if defined (F77_APPEND_UNDERSCORE) |
|
46 dostop_ (void) |
|
47 #else |
|
48 dostop (void) |
|
49 #endif |
|
50 { |
1617
|
51 raise (SIGINT); |
280
|
52 abort (); |
|
53 } |
|
54 |
|
55 /* |
|
56 ;;; Local Variables: *** |
|
57 ;;; mode: C *** |
|
58 ;;; page-delimiter: "^/\\*" *** |
|
59 ;;; End: *** |
|
60 */ |