aboutsummaryrefslogtreecommitdiff
path: root/src/lst/ft_lstiter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lst/ft_lstiter.c')
-rw-r--r--src/lst/ft_lstiter.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lst/ft_lstiter.c b/src/lst/ft_lstiter.c
index 9b2895b..e46b507 100644
--- a/src/lst/ft_lstiter.c
+++ b/src/lst/ft_lstiter.c
@@ -1,7 +1,7 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* ft_lstiter_bonus.c :+: :+: :+: */
+/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
@@ -10,16 +10,20 @@
/* */
/* ************************************************************************** */
-#include "libft.h"
#include "libft_lst.h"
+/*
+** \brief Iterate of list
+** \param f Funtion applied to data of each node
+*/
+
void ft_lstiter(t_ftlst *lst, void (*f)(void *))
{
if (f == NULL)
return ;
while (lst != NULL)
{
- (*f)(lst->content);
+ (*f)(lst->data);
lst = lst->next;
}
}