diff options
-rw-r--r-- | src/m_loop.c | 17 | ||||
-rw-r--r-- | src/m_loop.h | 8 | ||||
-rw-r--r-- | src/m_loop_next.c | 10 | ||||
-rw-r--r-- | src/m_loop_next.h | 2 |
4 files changed, 20 insertions, 17 deletions
diff --git a/src/m_loop.c b/src/m_loop.c index 8912284..fe4a4b8 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -29,8 +29,7 @@ #include "u_parse.h" #include "u_vars.h" -static void - m_parse_and_run_line(char line[], t_msh *msh) +static void m_parse_and_run_line(char line[], t_msh *msh) { t_line_block *ptr; uint8_t previf; @@ -56,8 +55,7 @@ static void s_line_clear(&msh->curr); } -void - m_dump_hist(char hist[], t_msh *msh) +void m_dump_hist(char hist[], t_msh *msh) { char histfile[PATH_MAX]; int32_t fd; @@ -77,8 +75,7 @@ void } } -static void - m_handle_hist(char hist[], char line[], t_msh *msh) +static void m_handle_hist(char hist[], char line[], t_msh *msh) { static uint16_t hist_i = 0; @@ -121,8 +118,7 @@ static void m_delete_comments(char line[]) } } -uint8_t - m_loop(int32_t fd, t_msh *msh) +uint8_t m_loop(int32_t fd, t_msh *msh) { static char hist[255 * 4096]; char *line; @@ -138,10 +134,7 @@ uint8_t m_delete_comments(line); if (line[0] != C_NUL) { - line = m_check_multi_backslash(fd, line, msh); - line = m_check_multi_pipe(fd, line, msh); - line = m_check_multi_and(fd, line, msh); - line = m_check_multi_quotes(fd, line, msh); + line = m_check_multis(fd, line, msh); if (fd == STDIN_FILENO) m_handle_hist(hist, line, msh); m_parse_and_run_line(line, msh); diff --git a/src/m_loop.h b/src/m_loop.h index 1f60744..c74a5f9 100644 --- a/src/m_loop.h +++ b/src/m_loop.h @@ -10,12 +10,12 @@ /* */ /* ************************************************************************** */ -#ifndef M_LOOP -#define M_LOOP +#ifndef FT_M_LOOP +# define FT_M_LOOP -#include <stdint.h> +# include <stdint.h> -#include "s_struct.h" +# include "s_struct.h" void m_dump_hist(t_msh *msh); uint8_t m_loop(int32_t fd, t_msh *msh); diff --git a/src/m_loop_next.c b/src/m_loop_next.c index d138206..b312c0b 100644 --- a/src/m_loop_next.c +++ b/src/m_loop_next.c @@ -230,3 +230,13 @@ char } return (line); } + +char *m_check_multis(int32_t fd, char line[], t_msh *msh) +{ + line = m_check_multi_backslash(fd, line, msh); + line = m_check_multi_pipe(fd, line, msh); + line = m_check_multi_and(fd, line, msh); + line = m_check_multi_quotes(fd, line, msh); + + return (line); +} diff --git a/src/m_loop_next.h b/src/m_loop_next.h index b4ca62c..b400e76 100644 --- a/src/m_loop_next.h +++ b/src/m_loop_next.h @@ -21,6 +21,6 @@ char *m_check_multi_backslash(int32_t fd, char line[], t_msh *msh); char *m_check_multi_pipe(int32_t fd, char line[], t_msh *msh); char *m_check_multi_and(int32_t fd, char line[], t_msh *msh); char *m_check_multi_quotes(int32_t fd, char line[], t_msh *msh); - +char *m_check_multis(int32_t fd, char line[], t_msh *msh); #endif |