/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_list_find.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/19 08:35:32 by cacharle #+# #+# */ /* Updated: 2019/07/23 15:43:57 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "ft_list.h" t_list *ft_list_find(t_list *begin_list, void *data_ref, int (*cmp)()) { while (begin_list != NULL) { if ((*cmp)(begin_list->data, data_ref) == 0) break ; begin_list = begin_list->next; } return (begin_list); }