maxishell
Implementation of a shell for Linux-like systems
|
Go to the source code of this file.
Functions | |
int | execute_ast (t_ast *node, t_ms_data *data) |
execute Abstract Syntax Tree | |
int | execute (t_ms_data *data) |
execute distribution function | |
char * | ft_find_path (char *cmd, t_env *envp) |
function find the full path of the executed command | |
void | ft_free_2d_arr (char **arr) |
int | ft_perror (char *str) |
void | close_fds (int in, int out) |
close two file descriptors | |
void | handle_io_fd (t_ms_data *data) |
close temporary input/output file descriptors and reset them to -1 | |
void | handle_std_io (int *std_io, int std_fileno) |
int | handle_shell_variable (t_ast *node, t_ms_data *data) |
int | handle_get_shell_variable (t_ms_data *data, const char *key) |
void | shell_variable_update (t_ms_data *data, int status) |
void close_fds | ( | int | in, |
int | out | ||
) |
close two file descriptors
--
fds | file descriptors |
Definition at line 28 of file utils_0.c.
Referenced by child_process(), execute_child(), new_process(), and setup_pipe_processes().
int execute | ( | t_ms_data * | data | ) |
execute distribution function
--
data | minishell data struct |
Definition at line 40 of file execute_child.c.
References s_ms_data::args, builtin_cd(), builtin_echo(), builtin_env(), builtin_exit(), builtin_export(), builtin_pwd(), builtin_unset(), ft_strcmp(), and new_process().
Referenced by execute_ast().
execute Abstract Syntax Tree
--
node | Abstract Syntax Tree Node |
data | minishell data struct |
Definition at line 38 of file execute.c.
References s_ms_data::args, s_ast::args, builtin_pipe(), execute(), EXIT_FAILURE, EXIT_SUCCESS, PHRASE, PIPE, REDIR_APPEND, REDIR_HEREDOC, REDIR_IN, REDIR_OUT, redirect_append(), redirect_here_doc(), redirect_in(), redirect_out(), and s_ast::type.
Referenced by execute_child(), execute_child(), process_command(), redirect_append(), redirect_in(), and redirect_out().
char * ft_find_path | ( | char * | cmd, |
t_env * | envp | ||
) |
function find the full path of the executed command
--
cmd | string from the first argument |
envp | structure with environment variables |
Definition at line 32 of file utils_1.c.
References ft_free_2d_arr(), ft_split(), ft_strdup(), ft_strncmp(), get_env(), and relative_path_handle().
Referenced by child_process().
void ft_free_2d_arr | ( | char ** | arr | ) |
Definition at line 15 of file ft_free_2d_arr.c.
Referenced by builtin_exit(), ft_find_path(), process_and_reassemble(), and split_loc_vars().
int ft_perror | ( | char * | str | ) |
Definition at line 18 of file exit_status_utils.c.
References EXIT_FAILURE.
Referenced by builtin_pipe(), execute_child(), execute_child(), new_process(), open_tmp_file(), and setup_pipe_processes().
int handle_get_shell_variable | ( | t_ms_data * | data, |
const char * | key | ||
) |
Definition at line 47 of file shell_variables.c.
References ft_putstr_fd(), get_env(), s_ms_data::shell_variables, and s_ms_data::std_out.
Referenced by handle_shell_variable().
void handle_io_fd | ( | t_ms_data * | data | ) |
close temporary input/output file descriptors and reset them to -1
--
data | minishell structure |
Definition at line 39 of file utils_0.c.
References s_ms_data::std_in, and s_ms_data::std_out.
Referenced by process_command().
Definition at line 64 of file shell_variables.c.
References s_ast::args, handle_get_shell_variable(), s_ast::left, and s_ast::right.
void handle_std_io | ( | int * | std_io, |
int | std_fileno | ||
) |
Definition at line 50 of file utils_0.c.
Referenced by builtin_echo(), child_process(), and new_process().
void shell_variable_update | ( | t_ms_data * | data, |
int | status | ||
) |
Definition at line 71 of file shell_variables.c.
References s_ms_data::exit_status, ft_itoa(), set_shell_var(), and s_ms_data::shell_variables.