MiniDevil As beautiful as a shell
signals.h
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* signals.h :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: baelgadi <baelgadi@student.42.fr> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2025/12/11 00:25:59 by baelgadi #+# #+# */
9 /* Updated: 2026/03/04 04:32:23 by baelgadi ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #ifndef SIGNALS_H
14 # define SIGNALS_H
15 
16 # include <signal.h>
17 
24 extern volatile sig_atomic_t g_signal;
25 
26 void interactive_sigint_handler(int sig);
27 
28 void setup_interactive_signals(void);
29 
30 void reset_child_signals(void);
31 
32 void setup_execution_signals(void);
33 
34 void heredoc_sigint_handler(int sig);
35 
36 void setup_heredoc_signals(void);
37 
38 void restore_stdin(void);
39 
40 #endif
void heredoc_sigint_handler(int sig)
SIGINT handler for heredoc.
void restore_stdin(void)
Restore STDIN after heredoc SIGINT closed it.
void interactive_sigint_handler(int sig)
SIGINT handler for the interactive prompt.
Definition: signals.c:26
volatile sig_atomic_t g_signal
The single global variable.
Definition: signals.c:17
void setup_heredoc_signals(void)
Configure signals for heredoc.
void setup_execution_signals(void)
Ignore signals during command execution in the parent.
Definition: signals.c:83
void setup_interactive_signals(void)
Configure signals for the interactive prompt.
Definition: signals.c:43
void reset_child_signals(void)
Reset signals to default behavior for the child processes.
Definition: signals.c:66