maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
execute.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* execute.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: dmdemirk <dmdemirk@student.42london.c +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/06/03 16:34:42 by dmdemirk #+# #+# */
9/* Updated: 2024/09/10 13:18:54 by rmikhayl ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#ifndef EXECUTE_H
14# define EXECUTE_H
15
16# include "shell.h"
17# include "tokens.h"
18# include "env.h"
19
20/* execute */
21int execute_ast(t_ast *node, t_ms_data *data);
22int execute(t_ms_data *data);
23
24/* utils */
25char *ft_find_path(char *cmd, t_env *envp);
26void ft_free_2d_arr(char **arr);
27int ft_perror(char *str);
28void close_fds(int in, int out);
29void handle_io_fd(t_ms_data *data);
30void handle_std_io(int *std_io, int std_fileno);
31
32/* shell variable execution */
33int handle_shell_variable(t_ast *node, t_ms_data *data);
34int handle_get_shell_variable(t_ms_data *data, const char *key);
35void shell_variable_update(t_ms_data *data, int status);
36
37#endif
int execute_ast(t_ast *node, t_ms_data *data)
execute Abstract Syntax Tree
Definition execute.c:38
void shell_variable_update(t_ms_data *data, int status)
char * ft_find_path(char *cmd, t_env *envp)
function find the full path of the executed command
Definition utils_1.c:32
void handle_std_io(int *std_io, int std_fileno)
Definition utils_0.c:50
void ft_free_2d_arr(char **arr)
int handle_get_shell_variable(t_ms_data *data, const char *key)
int handle_shell_variable(t_ast *node, t_ms_data *data)
void handle_io_fd(t_ms_data *data)
close temporary input/output file descriptors and reset them to -1
Definition utils_0.c:39
void close_fds(int in, int out)
close two file descriptors
Definition utils_0.c:28
int ft_perror(char *str)
int execute(t_ms_data *data)
execute distribution function
Definition tokens.h:50
Definition env.h:17