-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
42 lines (39 loc) · 1.4 KB
/
main.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dselmy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/01 18:06:48 by dselmy #+# #+# */
/* Updated: 2022/02/02 00:26:53 by dselmy ### ########.fr */
/* */
/* ************************************************************************** */
#include "./includes/parser.h"
int main(int argc, char **argv, char **envp)
{
t_data *all;
char *inpt;
rl_catch_signals = 0;
g_exit_status = 0;
if (argc == 1)
{
init_struct_first(&all, envp);
while (1)
{
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, &sig_int);
inpt = readline("minishell$ ");
init_data(all, inpt);
if (*inpt)
{
add_history(inpt);
if (!parser(all))
launch_minishell(all, ft_lstdouble_size(all->tokens));
}
free_cmd(all);
}
}
unknown_arguments(argc, argv);
return (0);
}