feat: added more lst functionality

This commit is contained in:
Zoëy Noort 2025-05-31 19:48:39 +02:00
parent 2708a86b5f
commit 0863951787
7 changed files with 100 additions and 0 deletions

12
srcs/lst/ft_lstfind.c Normal file
View file

@ -0,0 +1,12 @@
#include "libft.h"
t_list *ft_lstfind(t_list *lst, void *data, int (*cmp)(void *, void *))
{
while (lst)
{
if (cmp(lst->data, data) == 0)
return (lst);
lst = lst->next;
}
return (NULL);
}