libft/ft_lst2add.c
2018-09-30 18:45:17 +02:00

26 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lst2add.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/09/30 17:07:48 by tmaze #+# #+# */
/* Updated: 2018/09/30 18:44:55 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lst2add(t_list2 **alst, t_list2 *new)
{
if (*alst != NULL)
new->next = (*alst)->next;
(*alst)->next = new;
if (*alst != NULL)
{
new->prev = *alst;
new->next->prev = new;
}
}