change fonctions pour list avec nouvelles fonctions pour listes a deux sens

This commit is contained in:
hugogogo
2022-03-24 16:49:59 +01:00
parent bc53060626
commit 60af4e44b0
27 changed files with 484 additions and 13 deletions

25
srcs/ft_lstbegin.c Normal file
View File

@@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstbegin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/24 15:05:21 by simplonco #+# #+# */
/* Updated: 2022/03/24 15:10:45 by simplonco ### ########.fr */
/* */
/* ************************************************************************** */
/*
* return a pointer to the first element of a two-way list
*/
#include "libft.h"
t_list *ft_lstbegin(t_list *lst)
{
while (lst->prev)
lst = lst->prev;
return (lst);
}