-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstiter.c
executable file
·34 lines (30 loc) · 1.27 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: jchoy-me <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/20 13:44:21 by jchoy-me #+# #+# */
/* Updated: 2023/07/21 12:43:32 by jchoy-me ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
DESCRIPTION:
Iterates the list ’lst’ and applies the function ’f’ on the content of
each node.
PARAMETERS:
lst: The address of a pointer to a node.
f: The address of the function used to iterate on the list.
*/
void ft_lstiter(t_list *lst, void (*f)(void *))
{
if (lst == NULL || f == NULL)
return ;
while (lst != NULL)
{
f(lst->content);
lst = lst->next;
}
}