25 lines
1.1 KiB
C
25 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_list_find.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/07/03 18:26:03 by whaffman #+# #+# */
|
|
/* Updated: 2024/07/03 18:30:38 by whaffman ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_list.h"
|
|
|
|
t_list *ft_list_find(t_list *begin_list, void *data_ref, int (*cmp)())
|
|
{
|
|
while (begin_list)
|
|
{
|
|
if (!cmp(begin_list->data, data_ref))
|
|
return (begin_list);
|
|
begin_list = begin_list->next;
|
|
}
|
|
return (begin_list);
|
|
}
|