tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_lstiter_bonus.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstiter_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/10/28 01:46:44 by tgrekov #+# #+# */
9
/* Updated: 2023/11/20 19:21:04 by tgrekov ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
20
#include "
libft.h
"
21
30
void
ft_lstiter
(
t_list
*lst,
void
(*f)(
void
*))
31
{
32
if
(!f)
33
return ;
34
while
(lst)
35
{
36
f(lst->
content
);
37
lst = lst->
next
;
38
}
39
}
ft_lstiter
void ft_lstiter(t_list *lst, void(*f)(void *))
Iterates over a list and applies the function f over each node.
Definition
ft_lstiter_bonus.c:30
libft.h
s_list
Linked list node.
Definition
libft.h:44
s_list::next
struct s_list * next
Pointer to the next node.
Definition
libft.h:46
s_list::content
void * content
void* to the node's contents.
Definition
libft.h:45
ft_lstiter_bonus.c