MiniDevil
As beautiful as a shell
Execution output capture. More...
#include "minishell_ui.h"#include "token.h"#include "parser.h"#include "ast.h"#include "executor.h"
Include dependency graph for execute_utils.c:Execution output capture.
Definition in file execute_utils.c.
Functions | |
| static void | process_output_char (t_ui *ui, char c, char *line, int *line_len) |
| Process 1 output character from the child pipe into line buffers. More... | |
| void | read_output_from_fd (t_ui *ui, int fd) |
| Read all available bytes from fd and split into output lines. More... | |
| int | process_ui_input (char *input, t_shell *shell) |
| Full pipeline inside the UI. More... | |
|
static |
Process 1 output character from the child pipe into line buffers.
\n it flushes the current line to out_add_line() & resets len| ui | UI state |
| c | Character read from the pipe |
| line | Working buffer (accumulates the current line) |
| line_len | Pointer to the current position in the line |
Definition at line 30 of file execute_utils.c.
References BUF_SIZE, t_ui::out, and out_add_line().
Referenced by read_output_from_fd().
Here is the call graph for this function:
Here is the caller graph for this function:| void read_output_from_fd | ( | t_ui * | ui, |
| int | fd | ||
| ) |
Read all available bytes from fd and split into output lines.
Reads in chunks of BUF_SIZE and any unterminated line is flushed after EOF
| ui | UI states |
| fd | File descriptor to read from (pipe read end) |
Definition at line 53 of file execute_utils.c.
References BUF_SIZE, t_ui::out, out_add_line(), and process_output_char().
Referenced by exec_parent().
Here is the call graph for this function:
Here is the caller graph for this function:| int process_ui_input | ( | char * | input, |
| t_shell * | shell | ||
| ) |
Full pipeline inside the UI.
tokenize -> expand_all_tokens -> parse -> collect_heredocs -> executor
| input | Command string to execute |
| shell | Shell state (provides environment and execution context) |
Definition at line 88 of file execute_utils.c.
References collect_heredocs(), executor(), expand_all_tokens(), free_ast(), free_token_list(), parse(), and tokenize().
Referenced by exec_child().
Here is the call graph for this function:
Here is the caller graph for this function: