struct s_data t_data
Definition data_structure.h:38
struct s_command t_command
Definition data_structure.h:35
struct s_garbage t_garbage
Definition data_structure.h:26
void execute_pipeline(t_data *data, pid_t *pids, size_t *count)
Execute all the command that are followed by pipes.
Definition exec_pipeline.c:67
void wait_all_childs(t_command *command, pid_t *pids)
Waits for all the childs with their pids.
Definition exec_pipeline.c:102
size_t count_commands(t_command *command)
Cound the number of commands in the command structure.
Definition exec-utils.c:30
void dup_and_close(t_garbage *garbage, int oldfd, int newfd)
Special dup2 that also closes the old fd.
Definition exec-utils.c:74
void fill_toks_into_commands(t_data *data, t_command *command)
Definition exec.c:45
int safe_close(int *fd)
Safely close fd.
Definition exec-utils.c:51
void search_paths(t_data *data, t_command *command)
Search Path for all commands.
Definition exec.c:95
void search_path(t_data *data, t_command *command)
Search path for the designated command.
Definition exec.c:71
int execve_fork(t_data *data, char *path, char **toks, char **envp)
Definition exec_extern.c:41
int prepare_command(t_data *data)
Prepare the command for search_command()
Definition exec.c:27
void reset_redirection(t_garbage *garbage, t_command *command, int fd_backup[2], unsigned char i)
Reset redirections by default values Replace the new redirections by stdin and stdout.
Definition ft_dups.c:86
int handle_redirections(t_garbage *garbage, t_command *command, int fd_backup[2])
Create and redirect inputs and outputs needed for the command.
Definition ft_dups.c:33
int handle_redirections_forks(t_garbage *garbage, t_command *command)
Create and redirect inputs and outputs needed for the command.
Definition ft_dups.c:62
int not_builtins(t_data *data, t_command *command, char **tokens)
Executes commands that are not builtins.
Definition exec_extern.c:30
int search_command(t_data *data, t_command *command, char **tokens)
Search if command is a builtin or not.
Definition search_command.c:26
char ** copy_toks(t_data *data, t_command *command)
Creates a copy of all tokens that are in a command structure It's used for forks during exec.
Definition token-utils.c:30
int needs_to_be_forked(t_command *command)
Check if it needs to be forked.
Definition exec-utils.c:91
int prepare_command_forks(t_data *data)
Definition exec.c:108