change fonctions pour list avec nouvelles fonctions pour listes a deux sens
This commit is contained in:
27
srcs/ft_lstinsert.c
Normal file
27
srcs/ft_lstinsert.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstinsert.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/03/24 15:22:46 by simplonco #+# #+# */
|
||||
/* Updated: 2022/03/24 15:31:52 by simplonco ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/*
|
||||
* insert an element in two-way list just after the one in parameter
|
||||
* and rejoin the list
|
||||
*/
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_lstinsert(t_list *lst, t_list *new)
|
||||
{
|
||||
new->next = lst->next;
|
||||
lst->next = new;
|
||||
new->next->prev = new;
|
||||
new->prev = lst;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user