/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstfind.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: simplonco +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); }