From 32fb33b2dea95c00dc37efd14d34c799b23d09cf Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 11 Sep 2020 18:07:48 +0200 Subject: In progress --- src/b_alias.c | 19 +++++++++++++++++++ src/b_alias.h | 1 + src/e_builtins.c | 3 +++ src/m_loop.c | 1 - 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/b_alias.c b/src/b_alias.c index 6848b68..3b70a02 100644 --- a/src/b_alias.c +++ b/src/b_alias.c @@ -13,9 +13,28 @@ #include #include "s_struct.h" +#include "u_utils.h" + +static void + b_print_alias_list(t_msh *msh) +{ + (void)msh; +} uint8_t b_alias(char *args[], t_msh *msh) +{ + const uint64_t argc = u_builtins_get_argc((const char**)args); + + if (argc == 0) + { + b_print_alias_list(msh); + } + return (0); +} + +uint8_t + b_alias_mute(char *args[], t_msh *msh) { (void)args; (void)msh; diff --git a/src/b_alias.h b/src/b_alias.h index a4aa1d8..2c80ffc 100644 --- a/src/b_alias.h +++ b/src/b_alias.h @@ -18,5 +18,6 @@ #include "s_struct.h" uint8_t b_alias(char *args[], t_msh *msh); +uint8_t b_alias_mute(char *args[], t_msh *msh); #endif diff --git a/src/e_builtins.c b/src/e_builtins.c index f4b363b..fb7b0ba 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -16,6 +16,7 @@ #include #include +#include "b_builtins.h" #include "b_export_next.h" #include "b_export_mute.h" #include "m_loop.h" @@ -76,6 +77,8 @@ static void b_export_mute(ptr->argv + 1, msh); else if (bu_id == FT_ID_UNSET) msh->bu_ptr[bu_id](ptr->argv + 1, msh); + else if (bu_id == FT_ID_ALIAS) + b_alias_mute(ptr->argv + 1, msh); else if (bu_id == FT_ID_EXIT) { if (msh->fd == STDIN_FILENO) diff --git a/src/m_loop.c b/src/m_loop.c index bd4fb1c..50357eb 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -26,7 +26,6 @@ #include "s_lpipes.h" #include "s_line.h" #include "u_vars.h" -#include "u_alias.h" static void m_parse_and_run_line(char line[], t_msh *msh) -- cgit v1.2.3