MiniDevil As beautiful as a shell
executor.c File Reference

Main executor (dispatches to pipe/redir/command handlers) More...

#include "executor.h"
#include "token.h"
#include "libft.h"
+ Include dependency graph for executor.c:

Detailed Description

Main executor (dispatches to pipe/redir/command handlers)

Definition in file executor.c.

Functions

static int exec_command_node (t_ast *node, t_shell *shell)
 Execute a NODE_COMMAND AST node. More...
 
int executor (t_ast *node, t_shell *shell)
 Main AST executor that dispatches by node type. More...
 

Function Documentation

◆ exec_command_node()

static int exec_command_node ( t_ast node,
t_shell shell 
)
static

Execute a NODE_COMMAND AST node.

Parameters
nodeAST node of type NODE_COMMAND
shellShell context
Returns
Exit status of the executed command

Definition at line 24 of file executor.c.

References t_cmd_node::args, t_ast_data::cmd, t_ast::data, and exec_simple_command().

Referenced by executor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executor()

int executor ( t_ast node,
t_shell shell 
)

Main AST executor that dispatches by node type.

Parameters
nodeRoot of the AST subtree to execute
shellShell context
Returns
Exit status of the executed pipe/command and 0 for NULL nodes

Definition at line 42 of file executor.c.

References exec_command_node(), handle_pipe(), handle_redir(), NODE_COMMAND, NODE_PIPE, NODE_REDIR_HEREDOC, NODE_REDIR_IN, and t_ast::type.

Referenced by exec_left_pipe_child(), exec_right_pipe_child(), handle_redir(), process_input(), and process_ui_input().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Go to the source code of this file.