aboutsummaryrefslogtreecommitdiff
path: root/src/lst/ft_lstiter.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-02 11:05:33 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-02 11:05:33 +0200
commit5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde (patch)
tree80911dc3c32e9f230750e7e1042d413dfb6efab2 /src/lst/ft_lstiter.c
parentee32953ea79616e72f5428cdf40c834714a891c9 (diff)
parentb96b82194ccad2cddbb46b77aa1962a57c47ff44 (diff)
downloadlibft-5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde.tar.gz
libft-5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde.tar.bz2
libft-5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde.zip
Merge branch 'master' into ft_ssl
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;
}
}