summaryrefslogtreecommitdiffstats
path: root/src/m_funptr.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-04 15:52:47 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-04 15:52:47 +0200
commit5cb3373a2e5a5109a5d3b72ef45978b98f885706 (patch)
tree11a0a6f467da3ddf227d2eaf6824c4509242025e /src/m_funptr.c
parentok nice (diff)
parent$? fix (diff)
download42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.gz
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.bz2
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.xz
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.zst
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.zip
Merge branch 'master' into fix-pwd
Diffstat (limited to 'src/m_funptr.c')
-rw-r--r--src/m_funptr.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/m_funptr.c b/src/m_funptr.c
new file mode 100644
index 0000000..3bd0969
--- /dev/null
+++ b/src/m_funptr.c
@@ -0,0 +1,37 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* m_funptr.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+#include <stdlib.h>
+
+#include "d_enum.h"
+#include "b_builtins.h"
+#include "f_fail.h"
+#include "m_funptr.h"
+#include "s_struct.h"
+
+void
+ init_buptr(t_msh *msh)
+{
+ msh->bu_ptr[0] = b_echo;
+ msh->bu_ptr[1] = b_cd;
+ msh->bu_ptr[2] = b_pwd;
+ msh->bu_ptr[3] = b_export;
+ msh->bu_ptr[4] = b_unset;
+ msh->bu_ptr[5] = b_env;
+ msh->bu_ptr[6] = b_exit;
+ msh->bu_ptr[7] = b_type;
+ if (!(msh->bu_ref = ft_split(FT_BUILTINS, '|')))
+ {
+ f_fail_alloc(msh);
+ }
+}