summaryrefslogtreecommitdiffstats
path: root/src/ft_m_loop.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 17:04:59 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 17:04:59 +0200
commit386c44e541af7aa1ba594d2f0a9665199b3dffb4 (patch)
treecf5ef3cfeca4348c76aa97ffa5c00849ef9ee24a /src/ft_m_loop.c
parentGood (diff)
download42-minishell-386c44e541af7aa1ba594d2f0a9665199b3dffb4.tar.gz
42-minishell-386c44e541af7aa1ba594d2f0a9665199b3dffb4.tar.bz2
42-minishell-386c44e541af7aa1ba594d2f0a9665199b3dffb4.tar.xz
42-minishell-386c44e541af7aa1ba594d2f0a9665199b3dffb4.tar.zst
42-minishell-386c44e541af7aa1ba594d2f0a9665199b3dffb4.zip
Nice prompt
Diffstat (limited to 'src/ft_m_loop.c')
-rw-r--r--src/ft_m_loop.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c
new file mode 100644
index 0000000..1e2efc0
--- /dev/null
+++ b/src/ft_m_loop.c
@@ -0,0 +1,33 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_m_loop.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 <stdint.h>
+#include <unistd.h>
+#include "ft_d_enum.h"
+#include "ft_m_loop.h"
+#include "ft_m_prompt.h"
+
+int32_t
+ ft_m_loop(t_msh *msh)
+{
+ int8_t gnl;
+ char *line;
+
+ gnl = 1;
+ while (gnl > 0)
+ {
+ ft_m_prompt(msh);
+ gnl = get_next_line(STDIN_FILENO, &line);
+ }
+ return (FT_RET_FINE);
+}