-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstiter.c
28 lines (25 loc) · 1.05 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mesafi <mesafi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/06 04:31:51 by mesafi #+# #+# */
/* Updated: 2020/01/20 13:29:13 by mesafi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstiter(t_list *lst, void (*f)(t_list *elem))
{
t_list *next;
if (lst && f)
{
while (lst)
{
next = lst->next;
f(lst);
lst = next;
}
}
}