|
Minishell 1.0
42 School Minishell Project - A simple shell implementation
|
Heredoc implementasyonu (fork tabanlı). Ayrıntılar...
#include "../../include/minishell.h"#include <signal.h>#include <stdlib.h>#include <sys/wait.h>#include <termios.h>#include <unistd.h>Bu dosyanın kaynak koduna git.
Fonksiyonlar | |
| static char * | heredoc_read_line (void) |
| Heredoc için bir satır oku (readline yerine read kullanır). | |
| static void | heredoc_child (t_shell *shell, t_redir *redir, int write_fd) |
| Heredoc satırlarını oku ve pipe'a yaz (child process). | |
| int | redir_heredoc (t_shell *shell, t_redir *redir) |
| Heredoc redirection uygula (fork tabanlı). | |
Heredoc implementasyonu (fork tabanlı).
Heredoc okuma child process'te yapılır. readline yerine write+read kullanılır (cooked mode, SIG_DFL çalışır). Ctrl-C → child SIG_DFL ile ölür, parent terminali düzeltir.
executor_heredoc.c dosyasında tanımlanmıştır.
|
static |
Heredoc için bir satır oku (readline yerine read kullanır).
Cooked mode'da read() Enter'a kadar bekler, tüm satırı döner. SIG_DFL bu modda doğru çalışır (readline override etmez).
executor_heredoc.c dosyasının 36 numaralı satırında tanımlanmıştır.
Referans veren heredoc_child().
Heredoc satırlarını oku ve pipe'a yaz (child process).
executor_heredoc.c dosyasının 62 numaralı satırında tanımlanmıştır.
Referanslar expand_heredoc_line(), s_redir::file, ft_strcmp(), heredoc_read_line(), s_redir::quoted ve write_heredoc_line().
Referans veren redir_heredoc().
Heredoc redirection uygula (fork tabanlı).
| shell | Shell structure |
| redir | Redirection yapısı |
Child process heredoc'u okur (write+read, readline değil). Ctrl-C: child ölür (SIG_DFL), parent terminali düzeltir.
executor_heredoc.c dosyasının 109 numaralı satırında tanımlanmıştır.
Referanslar create_heredoc_pipe(), s_shell::exit_status, s_redir::file, heredoc_child(), setup_signals() ve shell_exit().
Referans veren apply_redir().