diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-27 18:55:07 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-27 18:55:07 +0200 |
commit | 487a66394061f2d14a2fa421302966b5442d643f (patch) | |
tree | 34237d4e9cb85f94bcefd46f399d2224dff3f6b3 /src/e_builtins.c | |
parent | Correct shell prompt (diff) | |
download | 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.gz 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.bz2 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.xz 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.zst 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.zip |
I couldn't see shit
Diffstat (limited to '')
-rw-r--r-- | src/e_builtins.c (renamed from src/ft_e_builtins.c) | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ft_e_builtins.c b/src/e_builtins.c index 382f85d..e35416a 100644 --- a/src/ft_e_builtins.c +++ b/src/e_builtins.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_e_builtins.c :+: :+: :+: */ +/* e_builtins.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ @@ -16,27 +16,27 @@ #include <stdint.h> #include <unistd.h> -#include "ft_m_redirs.h" -#include "ft_s_destroy.h" -#include "ft_s_lcom.h" -#include "ft_s_struct.h" +#include "m_redirs.h" +#include "s_destroy.h" +#include "s_lcom.h" +#include "s_struct.h" static void - ft_e_builtin_child(const t_lcom *ptr, + e_builtin_child(const t_lcom *ptr, uint8_t bu_id, t_msh *msh) { int32_t ret; - ft_dup_redirs(ptr, msh); + dup_redirs(ptr, msh); ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); - ft_lcom_clear(&msh->curr); - ft_s_destroy(msh); + lcom_clear(&msh->curr); + s_destroy(msh); exit(ret); } static void - ft_e_builtin_parent(pid_t pid, + e_builtin_parent(pid_t pid, const t_lcom *ptr, uint8_t bu_id, t_msh *msh) @@ -60,14 +60,14 @@ static void ret = ft_atoi(ptr->argv[1]); else ret = msh->ret; - ft_lcom_clear(&msh->curr); - ft_s_destroy(msh); + lcom_clear(&msh->curr); + s_destroy(msh); exit(ret); } } void - ft_e_builtin(const t_lcom *ptr, + e_builtin(const t_lcom *ptr, uint8_t bu_id, t_msh *msh) { @@ -76,7 +76,7 @@ void /* TODO: find a way to handle exit | bu_id = 6 */ if ((pid = fork()) == 0) { - ft_e_builtin_child(ptr, bu_id, msh); + e_builtin_child(ptr, bu_id, msh); } else if (pid < 0) { @@ -84,6 +84,6 @@ void } else { - ft_e_builtin_parent(pid, ptr, bu_id, msh); + e_builtin_parent(pid, ptr, bu_id, msh); } } |