-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstiter.c
More file actions
32 lines (30 loc) · 1.27 KB
/
ft_lstiter.c
File metadata and controls
32 lines (30 loc) · 1.27 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jowagner <jowagner@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/03 19:26:41 by jowagner #+# #+# */
/* Updated: 2024/12/18 22:25:43 by jowagner ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Iterates the list ’lst’ and applies the function ’f’ on the content of
* each node.
*
* @param lst The address of a pointer to a node.
* @param f The address of the function used to iterate on the list.
* @return Nothing.
*/
void ft_lstiter(t_list *lst, void (*f)(void *))
{
if (!lst || !f)
return ;
while (lst)
{
f(lst->content);
lst = lst->next;
}
}