diff options
Diffstat (limited to 'test_mini/libft/src/lst/ft_lstiter.c')
| -rw-r--r-- | test_mini/libft/src/lst/ft_lstiter.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test_mini/libft/src/lst/ft_lstiter.c b/test_mini/libft/src/lst/ft_lstiter.c new file mode 100644 index 0000000..e46b507 --- /dev/null +++ b/test_mini/libft/src/lst/ft_lstiter.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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; + } +} |
