42_libft/ft_lstiter.c

25 lines
1.0 KiB
C
Raw Normal View History

2022-09-27 11:25:41 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
2022-10-04 08:21:55 -04:00
/* ft_lstiter.c :+: :+: :+: */
2022-09-27 11:25:41 -04:00
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
2022-10-04 08:21:55 -04:00
/* Created: 2022/09/30 00:05:43 by cchauvet #+# #+# */
2022-10-05 15:04:45 -04:00
/* Updated: 2022/10/05 20:58:18 by cchauvet ### ########.fr */
2022-09-27 11:25:41 -04:00
/* */
/* ************************************************************************** */
#include "libft.h"
2022-10-04 08:21:55 -04:00
void ft_lstiter(t_list *lst, void (*f)(void *))
2022-09-27 11:25:41 -04:00
{
2022-10-05 15:04:45 -04:00
if (f == NULL)
return ;
while (lst != NULL)
2022-10-04 08:21:55 -04:00
{
2022-10-05 15:04:45 -04:00
f(lst->content);
2022-10-04 08:21:55 -04:00
lst = lst->next;
}
2022-09-27 11:25:41 -04:00
}