From 487a66394061f2d14a2fa421302966b5442d643f Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 27 Jul 2020 18:55:07 +0200 Subject: I couldn't see shit --- src/m_minishell.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/m_minishell.c (limited to 'src/m_minishell.c') diff --git a/src/m_minishell.c b/src/m_minishell.c new file mode 100644 index 0000000..1e065b4 --- /dev/null +++ b/src/m_minishell.c @@ -0,0 +1,60 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* 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" + +int + main(int argc, + char *const argv[], + char *const envp[]) +{ + t_msh *msh; + int32_t ret; + + /* TODO: increment $SHLVL */ + /* TODO: also set $SHELL | maybe not bash does not set $SHELL */ + /* only zsh does */ + /* TODO: handle general variables | $var */ + if (!(msh = init_msh(argv, envp))) + { + ft_dprintf(2, "%s\n", strerror(errno)); + return (FT_RET_ALLOC); + } + 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 +*/ -- cgit v1.2.3