1 /* trap.h -- data structures used in the trap mechanism. */
3 /* Copyright (C) 1993 Free Software Foundation, Inc.
5 This file is part of GNU Bash, the Bourne Again SHell.
7 Bash is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License along
18 with Bash; see the file COPYING. If not, write to the Free Software
19 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
21 #if !defined (_TRAP_H_)
26 #if !defined (SIG_DFL)
27 #include "bashtypes.h"
36 #define DEFAULT_SIG SIG_DFL
37 #define IGNORE_SIG SIG_IGN
39 /* Special shell trap names. */
40 #define DEBUG_TRAP NSIG
43 #define signal_object_p(x) (decode_signal (x) != NO_SIG)
45 extern char *trap_list[];
47 /* Externally-visible functions declared in trap.c. */
48 extern void initialize_traps __P((void));
49 extern void run_pending_traps __P((void));
50 extern void maybe_set_sigchld_trap __P((char *));
51 extern void set_sigchld_trap __P((char *));
52 extern void set_debug_trap __P((char *));
53 extern void set_sigint_trap __P((char *));
54 extern void set_signal __P((int, char *));
55 extern void restore_default_signal __P((int));
56 extern void ignore_signal __P((int));
57 extern int run_exit_trap __P((void));
58 extern void run_trap_cleanup __P((int));
59 extern void run_debug_trap __P((void));
60 extern void free_trap_strings __P((void));
61 extern void reset_signal_handlers __P((void));
62 extern void restore_original_signals __P((void));
64 extern char *signal_name __P((int));
66 extern int decode_signal __P((char *));
67 extern void run_interrupt_trap __P((void));
68 extern int maybe_call_trap_handler __P((int));
69 extern int signal_is_trapped __P((int));
70 extern int signal_is_ignored __P((int));
71 extern int signal_is_special __P((int));
72 extern void set_signal_ignored __P((int));