-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_list_foreach.c
27 lines (24 loc) · 1.11 KB
/
ft_list_foreach.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_list_foreach.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: igarbuz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/18 22:40:21 by igarbuz #+# #+# */
/* Updated: 2018/11/18 23:01:08 by igarbuz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_list_foreach(t_list *begin_list, void (*f)(void *))
{
t_list *mylst;
if (!begin_list || !f)
return ;
mylst = begin_list;
while (begin_list)
{
(*f)(begin_list->content);
begin_list = begin_list->next;
}
}