diff options
author | joe <rbousset@42lyon.fr> | 2020-11-30 18:58:08 +0100 |
---|---|---|
committer | joe <rbousset@42lyon.fr> | 2020-11-30 18:58:08 +0100 |
commit | cb1b766ec085ad051d1c2402476089a47606912c (patch) | |
tree | 8863133ade31deac025ec03c24e12a360dff9156 | |
parent | Hey at least I tried (diff) | |
download | 42-minishell-cb1b766ec085ad051d1c2402476089a47606912c.tar.gz 42-minishell-cb1b766ec085ad051d1c2402476089a47606912c.tar.bz2 42-minishell-cb1b766ec085ad051d1c2402476089a47606912c.tar.xz 42-minishell-cb1b766ec085ad051d1c2402476089a47606912c.tar.zst 42-minishell-cb1b766ec085ad051d1c2402476089a47606912c.zip |
Not quite done
-rw-r--r-- | src/c_init.c | 2 | ||||
-rw-r--r-- | src/c_keys_next.c | 30 | ||||
-rw-r--r-- | src/c_keys_next.h | 3 |
3 files changed, 28 insertions, 7 deletions
diff --git a/src/c_init.c b/src/c_init.c index 84f91db..1ab6743 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -91,7 +91,7 @@ static short return (c_ctrl_l(line, tcaps, msh)); else if (((*((unsigned int *)buf)) == UP_K) || ((*((unsigned int *)buf)) == CTRL_P)) - return (c_key_up(tcaps)); + return (c_key_up(tcaps, msh)); else if ((*((unsigned int *)buf)) == CTRL_D && line[0] == '\0') { diff --git a/src/c_keys_next.c b/src/c_keys_next.c index 68b2a3a..99f01b9 100644 --- a/src/c_keys_next.c +++ b/src/c_keys_next.c @@ -11,15 +11,35 @@ /* ************************************************************************** */ #include <libft.h> +#include <stddef.h> #include <term.h> #include "c_init.h" +#include "d_define.h" +#include "s_struct.h" -short c_key_up(t_caps *tcaps) +short c_key_up(t_caps *tcaps, t_msh *msh) { - tputs("qwe", 1, ft_putchar); - tcaps->cpos = 3; - tcaps->lpos = 1; - /* ft_dprintf(0, "qwe"); */ + /* static char *ptr; */ + /* static t_bool set = TRUE; */ + /* */ + /* if (set == TRUE) */ + /* { */ + /* ptr = msh->curr_hist_ptr + ft_strlen(msh->curr_hist_ptr); */ + /* set = FALSE; */ + /* } */ + /* while (ptr - msh->curr_hist_ptr != 0 && *ptr != '\n') */ + /* { */ + /* ft_printf("{%c}\n", *ptr); */ + /* ptr--; */ + /* } */ + /* ptr += 1; */ + /* ft_dprintf(1, "[%s]\n", ptr); */ + (void)msh; + (void)tcaps; + ft_dprintf(0, "qwe"); + /* tcaps->cpos = 0; */ + /* tcaps->lpos = 0; */ + /* tputs(tgetstr("nd", NULL), 1, ft_putchar); */ return (1); } diff --git a/src/c_keys_next.h b/src/c_keys_next.h index f71ff5c..fc76ecf 100644 --- a/src/c_keys_next.h +++ b/src/c_keys_next.h @@ -14,7 +14,8 @@ # define C_KEYS_NEXT_H #include "c_init.h" +#include "s_struct.h" -short c_key_up(t_caps *tcaps); +short c_key_up(t_caps *tcaps, t_msh *msh); #endif |