-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstiter.c
executable file
·31 lines (27 loc) · 1.11 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ngouy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/11 17:50:52 by ngouy #+# #+# */
/* Updated: 2015/11/04 16:12:33 by ngouy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** apply the fonction f() for each link of the list
*/
#include "libft.h"
void ft_lstiter(t_list *lst, void (*f)(t_list *elem))
{
t_list *tmp;
if (!lst || !f)
return ;
tmp = lst;
while (tmp)
{
f(tmp);
tmp = tmp->next;
}
}