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

24
srcs/ft_lst_find.bak Normal file
View File

@@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstfind.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/23 22:48:47 by simplonco #+# #+# */
/* Updated: 2022/03/23 22:49:16 by simplonco ### ########.fr */
/* */
/* ************************************************************************** */
/*
* find an element with the comp function, and return a pointer to it
*/
#include "libft.h"
t_list *ft_lstfind(t_list *lst, void *to_find, int (*comp)(void*, void *))
{
while (lst && (!comp(to_find, lst->content)))
lst = lst->next;
return (lst);
}