From 23ad79e8b41c25bb4992d103d29a17612a52e351 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 21 Jul 2019 15:26:32 +0200 Subject: c10 done, c11 on going, rush02 probably finished, bsq start --- c12/ex09/ft_list.h | 4 +--- c12/ex09/ft_list_foreach.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'c12/ex09') diff --git a/c12/ex09/ft_list.h b/c12/ex09/ft_list.h index 08a22a5..8f3a487 100644 --- a/c12/ex09/ft_list.h +++ b/c12/ex09/ft_list.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/09 14:33:17 by cacharle #+# #+# */ -/* Updated: 2019/07/17 17:11:04 by cacharle ### ########.fr */ +/* Updated: 2019/07/19 08:27:40 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,6 +19,4 @@ typedef struct s_list void *data; } t_list; -t_list *ft_create_elem(void *data); - #endif diff --git a/c12/ex09/ft_list_foreach.c b/c12/ex09/ft_list_foreach.c index e69de29..2c9705f 100644 --- a/c12/ex09/ft_list_foreach.c +++ b/c12/ex09/ft_list_foreach.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_list_foreach.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/07/19 08:29:57 by cacharle #+# #+# */ +/* Updated: 2019/07/19 08:31:03 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +void ft_list_foreach(t_list *begin_list, void (*f)(void *)) +{ + while (begin_list != NULL) + { + (*f)(begin_list->data); + begin_list = begin_list->next; + } +} -- cgit