From e3958afc911de2c628aa336893123ac871da3817 Mon Sep 17 00:00:00 2001 From: salad Date: Wed, 16 Dec 2020 13:13:50 +0100 Subject: c_keys_next is now c_utils_next --- src/c_utils_next.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/c_utils_next.c (limited to 'src/c_utils_next.c') diff --git a/src/c_utils_next.c b/src/c_utils_next.c new file mode 100644 index 0000000..c57ab1d --- /dev/null +++ b/src/c_utils_next.c @@ -0,0 +1,42 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* c_utils_next.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include + +#include "c_init.h" +#include "c_keys.h" +#include "d_define.h" + +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, char *ptr) +{ + char tmp[ARG_MAX]; + + 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); +} -- cgit v1.2.3