-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathminishell.h
78 lines (50 loc) · 2.16 KB
/
minishell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ariahi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/01 14:54:31 by ariahi #+# #+# */
/* Updated: 2022/09/17 09:07:35 by ariahi ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include "parse/parse.h"
# include "libft/libft.h"
# include <sys/types.h>
# include <sys/wait.h>
typedef int (*t_built_in)(int, char **);
typedef struct s_shell_s
{
int ac;
char **av;
t_list *envlst;
unsigned char exit_s;
int exec;
} t_shell_s;
extern t_shell_s g_shell;
int int_minishell(int ac, char **av, char **env);
t_built_in check_built_in(char **av);
int exe_built_in(t_parse *parse, t_built_in built_in);
int check_rdr(t_list *rdr_lst, int stdio[2]);
int exe_execve(char *path, char **envp);
int stdio_res(int stdio[2]);
void exe_close_pipe(int std[2]);
int exe_echo(int ac, char **av);
int exe_cd(int ac, char **av);
int exe_pwd(int ac, char **av);
int exe_env(int ac, char **av);
int exe_exit(int ac, char **av);
int exe_unset(int ac, char **av);
int exe_export(int ac, char **av);
int exe_simple_cmd_pid(t_parse *parse, int std_i[2], int std_o[2]);
int exe_simple_cmd(t_parse *parse, int std_i[2], int std_o[2]);
int exe_pipe(t_parse *parse, int std_i[2], int std_o[2]);
int exe_fork_set(int std_i[2], int std_o[2]);
int exe_execve(char *path, char **envp);
int exe(t_parse *parse, int std_i[2], int std_o[2]);
int exe_waitpid(int pid);
void exe_set_signal(int catch_signals);
#endif