/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* m_minishell.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include #include #include #include "f_fail.h" #include "m_argv.h" #include "s_struct.h" #include "s_init.h" #include "s_destroy.h" #include "u_vars.h" #include "u_vars_next.h" #include "s_lvars.h" int main(int argc, char *const argv[], char *const envp[]) { int32_t ret; char *str_one; char *str_two; t_msh *msh; /* TODO: handle general variables | $var */ if (!(msh = init_msh(argv, envp))) { ft_dprintf(2, "%s\n", strerror(errno)); return (FT_RET_ALLOC); } u_subst_var_value("$SHLVL", str_one =ft_itoa( ft_atoi(str_two = u_get_var_value("$SHLVL", msh)) + 1), msh); ft_memdel((void*)&str_one); ft_memdel((void*)&str_two); /* TODO: delet this */ ret = m_argv(argc, argv, msh); s_destroy(msh); return (ret); } /* ** ====== INFO ====== ** Files prefixes info ** ------------------- ** b_ -> builtins related ** d_ -> defines related ** e_ -> exec related ** f_ -> failure related ** m_ -> core minishell related ** p_ -> parse related ** s_ -> structs related ** u_ -> utils related ** v_ -> general purpose variables related */