summaryrefslogtreecommitdiff
path: root/libft/ft_lstiter.c
diff options
context:
space:
mode:
Diffstat (limited to 'libft/ft_lstiter.c')
-rw-r--r--libft/ft_lstiter.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libft/ft_lstiter.c b/libft/ft_lstiter.c
new file mode 100644
index 0000000..4f66050
--- /dev/null
+++ b/libft/ft_lstiter.c
@@ -0,0 +1,24 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_lstiter.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2022/09/29 03:30:19 by kdx #+# #+# */
+/* Updated: 2022/09/29 03:31:30 by kdx ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft.h"
+
+void ft_lstiter(t_list *lst, void (*f)(void *))
+{
+ if (f == NULL)
+ return ;
+ while (lst != NULL)
+ {
+ f(lst->content);
+ lst = lst->next;
+ }
+}