-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstiter.c
33 lines (30 loc) · 1.23 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rdragan <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/06 10:58:55 by rdragan #+# #+# */
/* Updated: 2022/11/06 11:10:27 by rdragan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
Iterates the list lst and applies the function f
to the content of each node.
@param lst: address of the pointer to the node
@param f: function to apply on each node content
*/
void ft_lstiter(t_list *lst, void (*f)(void *))
{
t_list *temp;
if (!lst)
return ;
temp = lst;
while (temp)
{
f(temp->content);
temp = temp->next;
}
}