norm: splitted functions in main into appropriate file

Moved lstdelenvelem & env2lst to ms_env.c
Normed out files
This commit is contained in:
Tanguy MAZE
2019-09-20 12:06:44 +02:00
parent 852248636f
commit cf62dae53b
124 changed files with 4850 additions and 30 deletions

29
libft/srcs/ft_lstaddend.c Normal file
View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstaddend.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/17 20:55:26 by tmaze #+# #+# */
/* Updated: 2018/11/26 12:30:30 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstaddend(t_list **alst, t_list *new)
{
t_list *tmp;
if (new == NULL)
return (NULL);
if (ft_lstsize(*alst) == 0)
ft_lstadd(alst, new);
else if (ft_lstsize(*alst) > 0)
{
tmp = ft_lstgetlast(*alst);
ft_lstadd(&(tmp->next), new);
}
return (*alst);
}