From e792d0a3ff1c1da456c241530571263df0b887b5 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 4 Mar 2020 16:19:05 +0100 Subject: Added ft_htiter.c --- src/ht/ft_htiter.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/ht/ft_htiter.c (limited to 'src/ht/ft_htiter.c') diff --git a/src/ht/ft_htiter.c b/src/ht/ft_htiter.c new file mode 100644 index 0000000..5473412 --- /dev/null +++ b/src/ht/ft_htiter.c @@ -0,0 +1,17 @@ +#include "libft_ht.h" + +/* +** Iterate function `f` over every pair in `ht`. +*/ + +void ft_htiter(t_ftht *ht, void (*f)(t_ftht_content*)) +{ + size_t i; + + i = 0; + while (i < ht->size) + { + ft_lstiter(ht->entries[i], (void (*)(void*))f); + i++; + } +} -- cgit From 901402c99018422c994bdb297e3ba404969c88ea Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Mar 2020 22:26:36 +0200 Subject: Added documentation for ht and lst --- src/ht/ft_htiter.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ht/ft_htiter.c') diff --git a/src/ht/ft_htiter.c b/src/ht/ft_htiter.c index 5473412..e5ab2eb 100644 --- a/src/ht/ft_htiter.c +++ b/src/ht/ft_htiter.c @@ -1,17 +1,19 @@ #include "libft_ht.h" -/* -** Iterate function `f` over every pair in `ht`. +/** +** \brief Iterate over entry of hash table +** \param ht Iterated hash table +** \param f Function applied to each entry */ -void ft_htiter(t_ftht *ht, void (*f)(t_ftht_content*)) +void ft_htiter(t_ftht *ht, void (*f)(t_ftht_entry*)) { size_t i; i = 0; while (i < ht->size) { - ft_lstiter(ht->entries[i], (void (*)(void*))f); + ft_lstiter(ht->buckets[i], (void (*)(void*))f); i++; } } -- cgit From 9316f2063255bd4a0abd5c38d4c065969a8980bb Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 1 Apr 2020 18:10:36 +0200 Subject: Norm compliant comment format, dirty script for doxygen comments --- src/ht/ft_htiter.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/ht/ft_htiter.c') diff --git a/src/ht/ft_htiter.c b/src/ht/ft_htiter.c index e5ab2eb..b854993 100644 --- a/src/ht/ft_htiter.c +++ b/src/ht/ft_htiter.c @@ -1,6 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_htiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/01 18:02:24 by charles #+# #+# */ +/* Updated: 2020/04/01 18:02:32 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft_ht.h" -/** +/* ** \brief Iterate over entry of hash table ** \param ht Iterated hash table ** \param f Function applied to each entry -- cgit