From c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 11 Oct 2020 15:52:52 +0200 Subject: Removing libft/minishell_test submodules, Removing subject/README/etc --- libft/src/lst/ft_lstiter.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libft/src/lst/ft_lstiter.c (limited to 'libft/src/lst/ft_lstiter.c') diff --git a/libft/src/lst/ft_lstiter.c b/libft/src/lst/ft_lstiter.c new file mode 100644 index 0000000..e46b507 --- /dev/null +++ b/libft/src/lst/ft_lstiter.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/09 09:03:22 by cacharle #+# #+# */ +/* Updated: 2019/11/20 04:01:39 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#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->data); + lst = lst->next; + } +} -- cgit