/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: lperrey +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/04 05:59:26 by lperrey #+# #+# */ /* Updated: 2021/10/27 14:48:03 by hulamy ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" int main(int argc, char *argv[], char *envp[]) { t_all c; (void)argc; (void)argv; if (!init(&c, envp)) exit(EXIT_FAILURE); shell_loop(&c); return (0); } /* ** idea about malloc protection : ** have them(mallocand similar) done in a specific function that would check their return and accordingly exit the program or continue ** -> so that it can be done in one line ** void calloc_or_exit(int num, int size); ** and possibly give it a pointer to a function that will clean before exit ** void calloc_or_exit(int num, int size, void (*f)(void *ptr), void *ptr); */