summaryrefslogtreecommitdiffstats
path: root/src/c_utils_next.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/c_utils_next.c (renamed from src/c_keys_next.c)28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/c_keys_next.c b/src/c_utils_next.c
index ec063d3..27a88db 100644
--- a/src/c_keys_next.c
+++ b/src/c_utils_next.c
@@ -1,7 +1,7 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* c_keys_next.c :+: :+: :+: */
+/* c_utils_next.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
@@ -16,16 +16,40 @@
#include "c_init.h"
#include "c_keys.h"
+#include "c_utils.h"
#include "d_define.h"
-void c_key_up_down(char *line[], t_caps *tcaps, char *ptr)
+short c_set_key(char *buf)
+{
+ if (((*((unsigned int *)buf)) == UP_K) ||
+ ((*((unsigned int *)buf)) == CTRL_P))
+ return (-1);
+ else
+ return (1);
+}
+
+t_msh *c_get_msh(int mode, t_msh *src)
+{
+ static t_msh *msh;
+
+ if (mode == 1)
+ {
+ msh = src;
+ }
+ return (msh);
+}
+
+void c_key_up_down(char *line[], t_caps *tcaps, t_msh *msh)
{
char tmp[ARG_MAX];
+ char *ptr;
+ ptr = c_set_ptr(FALSE, tcaps->key, msh);
c_home_key(tcaps->plen, tcaps);
ft_substr_s(tmp, ptr, 0, ft_strclen(ptr, '\n'));
ft_memdel((void*)&(*line));
tputs(tgetstr("ce", NULL), 1, ft_putchar);
*line = ft_strdup(tmp);
tcaps->cpos = ft_strlen(*line);
+ c_redraw_line(*line, tcaps);
}