-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstiter.c
34 lines (31 loc) · 1.18 KB
/
ft_lstiter.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fvon-nag <fvon-nag@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/21 14:47:53 by fvon-nag #+# #+# */
/* Updated: 2022/12/21 14:54:36 by fvon-nag ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
#include <stdio.h>
void ft_lstiter(t_list *lst, void (*f)(void *))
{
t_list *current;
if (lst == NULL)
return ;
current = lst;
while (current != NULL)
{
f(current->content);
if (current->next != NULL)
current = current->next;
else
{
return ;
}
}
}