27 node = ft_calloc(
sizeof(
t_ast), 1);
47 node = ft_calloc(
sizeof(
t_ast), 1);
75 node = ft_calloc(
sizeof(
t_ast), 1);
t_ast * create_redir_node(t_node_type type, char *file, t_ast *cmd, int quoted)
Create a redirection AST node.
t_ast * create_cmd_node(char **args, int argc)
Create a NODE_COMMAND AST node.
t_ast * create_pipe_node(t_ast *left, t_ast *right)
Create a pipe AST node connecting 2 subtrees.
AST node creation and destruction prototypes.
void free_ast(t_ast *node)
Recursively free an entire AST tree.
t_node_type
AST node types.
t_ast_data data
cmd, redir or binary data
t_node_type type
To determine which union member to pick.
struct s_ast * left
left child (before pipe)
struct s_ast * right
right child (after pipe)
char ** args
NULL terminated args array.
int argc
Number of arguments.
int heredoc_fd
Heredoc pipe fd (-1 if not used)
t_node_type redir_type
Redirection type.
char * file
Target filename or delimiter.
struct s_ast * cmd
Command subtree.
int quote
1 if delimiter was quoted