minishell
Minishell Project for École 42
|
Functions for filling the t_executor list and processing the t_lexer_list. More...
#include "minishell.h"
Functions | |
int | process_out_append (t_executor *current, t_lexer_list *lexer) |
Processes output redirections and append for the given node of the executor list. | |
int | process_in_heredoc (t_executor *current, t_lexer_list *lexer) |
Processes input redirections and heredoc for the given node of the executor list. | |
int | process_command (t_executor *current, t_lexer_list *lexer) |
Processes the command part for the given node of the executor list. | |
t_executor * | process_lexemes (t_executor *list, t_executor *current, t_lexer_list **lexer) |
Processes lexemes and sets values in the given t_executor node. | |
t_executor * | fill_executor_list (t_shell *shell, t_executor *list) |
Fills the t_executor linked list with info about the parsed commands. | |
Functions for filling the t_executor list and processing the t_lexer_list.
t_executor * fill_executor_list | ( | t_shell * | shell, |
t_executor * | list | ||
) |
Fills the t_executor linked list with info about the parsed commands.
Fills the t_executor linked list by processing the lexer linked list and setting values in a t_executor node for each command and its operation.
shell | A pointer to the main data structure. |
list | A pointer the t_executor linked list to be filled. |
int process_command | ( | t_executor * | current, |
t_lexer_list * | lexer | ||
) |
Processes the command part for the given node of the executor list.
Handles the command part of the given executor list node by creating an array of command arguments.
current | A pointer to the current t_executor node. |
lexer | A pointer to the current lexer list node. |
int process_in_heredoc | ( | t_executor * | current, |
t_lexer_list * | lexer | ||
) |
Processes input redirections and heredoc for the given node of the executor list.
Handles input redirections and heredoc for the given executor list node by calling its subfunctions. Has some edgecase handling.
current | A pointer to the current t_executor node. |
lexer | A pointer to the current lexer list node. |
t_executor * process_lexemes | ( | t_executor * | list, |
t_executor * | current, | ||
t_lexer_list ** | lexer | ||
) |
Processes lexemes and sets values in the given t_executor node.
Processes lexemes in the lexer linked list and populates the executor linked list accordingly. It handles output redirections, input redirections inclusive heredoc and command executions. On error, frees the entire t_executor linked list and returns NULL.
list | A pointer to the t_executor linked list. |
current | A pointer to the current t_executor node. |
lexer | A pointer to the lexer linked list. |
int process_out_append | ( | t_executor * | current, |
t_lexer_list * | lexer | ||
) |
Processes output redirections and append for the given node of the executor list.
Handles output redirections and append for the given executor list node by calling its subfunctions. Has some edgecase handling.
current | A pointer to the current t_executor node. |
lexer | A pointer to the current lexer list node. |