46 ret = read(STDIN_FILENO, &c, 1);
53 if (i == 0 && ret <= 0)
56 return (ft_strdup(buf));
67 signal(SIGINT, SIG_DFL);
68 signal(SIGQUIT, SIG_IGN);
69 tcgetattr(STDIN_FILENO, &term);
70 term.c_lflag |= (ICANON | ECHO | ISIG);
71 term.c_iflag &= ~(IGNCR);
72 term.c_iflag |= ICRNL;
73 term.c_oflag |= (OPOST | ONLCR);
74 tcsetattr(STDIN_FILENO, TCSANOW, &term);
81 ft_putstr_fd(
"minishell: warning: heredoc delimited by EOF\n", 2);
114 struct termios saved_term;
116 if (!redir || !redir->
file)
120 tcgetattr(STDIN_FILENO, &saved_term);
121 signal(SIGINT, SIG_IGN);
131 waitpid(pid, &status, 0);
132 tcflush(STDIN_FILENO, TCIFLUSH);
133 tcsetattr(STDIN_FILENO, TCSANOW, &saved_term);
135 if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
void shell_exit(t_shell *shell, int exit_code)
Shell'i temizleyip programdan çıkar.
static void heredoc_child(t_shell *shell, t_redir *redir, int write_fd)
Heredoc satırlarını oku ve pipe'a yaz (child process).
static char * heredoc_read_line(void)
Heredoc için bir satır oku (readline yerine read kullanır).
int redir_heredoc(t_shell *shell, t_redir *redir)
Heredoc redirection uygula (fork tabanlı).
int create_heredoc_pipe(int *pipefd)
Heredoc için pipe oluştur.
char * expand_heredoc_line(t_shell *shell, char *line)
Heredoc satırındaki $VAR değişkenlerini genişlet.
int write_heredoc_line(int fd, char *line)
Heredoc satırını pipe'a yaz.
Minishell ana header dosyası
int ft_strcmp(const char *s1, const char *s2)