Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
yabtaour

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: yabtaour/Minishell-42
Path: blob/main/init_main.c
Views: 1266
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* init_main.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: ssabbaji <ssabbaji@student.42.fr> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/10/02 11:28:02 by ssabbaji #+# #+# */
9
/* Updated: 2022/10/06 16:36:34 by ssabbaji ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "./minishell.h"
14
15
void init_sig(void)
16
{
17
rl_catch_signals = 0;
18
signal(SIGINT, sig_handler);
19
signal(SIGQUIT, sig_handler);
20
}
21
22
void init_main(t_data *data)
23
{
24
g_vars.g_heredoc = 1;
25
init_sig();
26
ft_initialize2(data);
27
g_vars.g_where_ami = 1;
28
}
29
30
void ft_initialize2(t_data *data)
31
{
32
g_vars.g_where_ami = 1;
33
data->lst_cmd = NULL;
34
data->lst_lexer = NULL;
35
data->her_doc = 0;
36
data->general.index = 0;
37
g_vars.g_exit_stat = 0;
38
}
39
40