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 --- Makefile | 2 +- src/c_ctrls.c | 2 +- src/c_init.c | 2 +- src/c_keys_next.c | 42 ------------------------------------------ src/c_keys_next.h | 21 --------------------- src/c_utils_next.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/c_utils_next.h | 21 +++++++++++++++++++++ src/m_loop.c | 2 +- 8 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 src/c_keys_next.c delete mode 100644 src/c_keys_next.h create mode 100644 src/c_utils_next.c create mode 100644 src/c_utils_next.h diff --git a/Makefile b/Makefile index fb85687..29adfde 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ SRCS_NAME += c_ctrls SRCS_NAME += c_init SRCS_NAME += c_input SRCS_NAME += c_keys -SRCS_NAME += c_keys_next +SRCS_NAME += c_utils_next SRCS_NAME += c_utils SRCS_NAME += e_builtins SRCS_NAME += e_externs diff --git a/src/c_ctrls.c b/src/c_ctrls.c index 3dca13e..0bea322 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -17,7 +17,7 @@ #include #include "c_ctrls.h" -#include "c_keys_next.h" +#include "c_utils_next.h" #include "c_utils.h" #include "m_prompt.h" #include "m_loop.h" diff --git a/src/c_init.c b/src/c_init.c index 472ee75..0001660 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -20,7 +20,7 @@ #include "c_ctrls.h" #include "c_init.h" #include "c_keys.h" -#include "c_keys_next.h" +#include "c_utils_next.h" #include "c_input.h" #include "c_utils.h" #include "d_define.h" diff --git a/src/c_keys_next.c b/src/c_keys_next.c deleted file mode 100644 index 58c8946..0000000 --- a/src/c_keys_next.c +++ /dev/null @@ -1,42 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* c_keys_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); -} diff --git a/src/c_keys_next.h b/src/c_keys_next.h deleted file mode 100644 index 1149f38..0000000 --- a/src/c_keys_next.h +++ /dev/null @@ -1,21 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* c_keys_next.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: rbousset +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ -/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ -/* */ -/* ************************************************************************** */ - -#ifndef C_KEYS_NEXT_H -# define C_KEYS_NEXT_H - -# include "c_init.h" - -void c_key_up_down(char *line[], t_caps *tcaps, char *ptr); -t_msh *c_get_msh(int mode, t_msh *src); - -#endif 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); +} diff --git a/src/c_utils_next.h b/src/c_utils_next.h new file mode 100644 index 0000000..60681d6 --- /dev/null +++ b/src/c_utils_next.h @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* c_utils_next.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef C_UTILS_NEXT_H +# define C_UTILS_NEXT_H + +# include "c_init.h" + +void c_key_up_down(char *line[], t_caps *tcaps, char *ptr); +t_msh *c_get_msh(int mode, t_msh *src); + +#endif diff --git a/src/m_loop.c b/src/m_loop.c index fd6df37..017c5af 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -22,7 +22,7 @@ #endif #include "c_init.h" -#include "c_keys_next.h" +#include "c_utils_next.h" #include "c_ctrls.h" #include "d_define.h" #include "e_line.h" -- cgit v1.2.3