31 struct sigaction *sa_old);
39 struct sigaction sa_new;
42 sigemptyset(&sa_new.sa_mask);
44 sigaction(SIGINT, &sa_new, sa_old);
48 struct sigaction *sa_old)
53 unlink(
"/tmp/heredoc");
55 sigaction(SIGINT, sa_old, NULL);
68 data->
std_in = dup(*file_fd);
82 write(file_fd,
"\n", 1);
85 *line = readline(
"🌞 > ");
94 struct sigaction sa_old;
109 sigaction(SIGINT, &sa_old, NULL);
112 unlink(
"/tmp/heredoc");
int execute_ast(t_ast *node, t_ms_data *data)
execute Abstract Syntax Tree
int ft_strcmp(const char *s1, const char *s2)
size_t ft_strlen(const char *s)
char * ft_strdup(const char *s)
static int handle_heredoc_interruption(char *line, char *eof, int file_fd, struct sigaction *sa_old)
volatile sig_atomic_t g_heredoc_interrupted
static void setup_sigint_handler(struct sigaction *sa_old)
static void execute_child(t_ast *node, t_ms_data *data, int *file_fd)
static void write_heredoc_lines(char **line, int file_fd, char *eof, t_ms_data *data)
int redirect_here_doc(t_ast *node, t_ms_data *data)
char * process_and_reassemble(char *line, t_ms_data *data)
int open_tmp_file(const char *type)
void handle_sigint_heredoc(int signo)