From f68a88318934a2373b0c73aeecebca38ef3881be Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 30 Sep 2020 18:48:54 +0200 Subject: Normed e_builtins --- src/e_builtins.c | 31 ++++++++++--------------------- src/e_builtins.h | 8 ++++---- 2 files changed, 14 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/e_builtins.c b/src/e_builtins.c index 2f6d33f..bc14ced 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -27,9 +27,7 @@ #include "s_struct.h" #include "u_utils.h" -static void - e_export_env_fork(const t_com *ptr, - t_msh *msh) +static void e_export_env_fork(const t_com *ptr, t_msh *msh) { char **re_ptr; @@ -41,10 +39,7 @@ static void } } -static void - e_builtin_child(const t_com *ptr, - uint8_t bu_id, - t_msh *msh) +static void e_builtin_child(const t_com *ptr, uint8_t bu_id, t_msh *msh) { int32_t ret; @@ -63,11 +58,10 @@ static void exit(ret); } -static void - e_builtin_parent(pid_t pid, - const t_com *ptr, - uint8_t bu_id, - t_msh *msh) +static void e_builtin_parent(pid_t pid, + const t_com *ptr, + uint8_t bu_id, + t_msh *msh) { int32_t status; int32_t ret; @@ -95,12 +89,8 @@ static void } } -void - e_builtin(const t_com *ptr, - uint8_t bu_id, - t_msh *msh) +void e_builtin(const t_com *ptr, uint8_t bu_id, t_msh *msh) { - /* int32_t ret; */ pid_t pid; if ((pid = fork()) == 0) @@ -109,13 +99,12 @@ void } else if (pid < 0) { - /* TODO: handle fork() failed */ + /* + ** TODO: handle fork() failed + */ } else { e_builtin_parent(pid, ptr, bu_id, msh); } - /* dup_redirs(ptr, msh); */ - /* ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); */ - /* msh->ret = ret; */ } diff --git a/src/e_builtins.h b/src/e_builtins.h index f3492c9..302e795 100644 --- a/src/e_builtins.h +++ b/src/e_builtins.h @@ -10,12 +10,12 @@ /* */ /* ************************************************************************** */ -#ifndef E_BUILTINS_H -#define E_BUILTINS_H +#ifndef FT_E_BUILTINS_H +# define FT_E_BUILTINS_H -#include +# include -#include "s_struct.h" +# include "s_struct.h" void e_builtin(const t_com *ptr, uint8_t bu_id, t_msh *msh); -- cgit v1.2.3