From 8131a5d26441c5152ab151b4bb49b561e5ca6e81 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 31 Jan 2020 10:44:30 +0100 Subject: hash table unit testing, norming --- src/ht/ft_htget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ht/ft_htget.c') diff --git a/src/ht/ft_htget.c b/src/ht/ft_htget.c index 76e4fb2..1562eb0 100644 --- a/src/ht/ft_htget.c +++ b/src/ht/ft_htget.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/30 08:33:21 by cacharle #+# #+# */ -/* Updated: 2020/02/19 01:44:41 by cacharle ### ########.fr */ +/* Updated: 2020/02/28 12:21:09 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ -- cgit From 2a9133a87109f9430e4827a858ff86596c5f98d5 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 4 Mar 2020 12:49:31 +0100 Subject: Added hash table documentation --- src/ht/ft_htget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ht/ft_htget.c') diff --git a/src/ht/ft_htget.c b/src/ht/ft_htget.c index 1562eb0..94a4164 100644 --- a/src/ht/ft_htget.c +++ b/src/ht/ft_htget.c @@ -13,9 +13,14 @@ #include "libft.h" #include "libft_ht.h" +/* +** Retrieve a value with associated key. +** Returns NULL if there is no value at `key`. +*/ + void *ft_htget(t_ftht *ht, char *key) { - + t_ftht_digest digest; t_ftlst *found; -- 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_htget.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/ht/ft_htget.c') diff --git a/src/ht/ft_htget.c b/src/ht/ft_htget.c index 94a4164..6b5df48 100644 --- a/src/ht/ft_htget.c +++ b/src/ht/ft_htget.c @@ -13,9 +13,11 @@ #include "libft.h" #include "libft_ht.h" -/* -** Retrieve a value with associated key. -** Returns NULL if there is no value at `key`. +/** +** \brief Retrieve a value with a key +** \param ht Hash table where key is searched +** \param key Searched key +** \return Value void pointer at key or NULL if not found */ void *ft_htget(t_ftht *ht, char *key) @@ -27,8 +29,8 @@ void *ft_htget(t_ftht *ht, char *key) if (ht == NULL || key == NULL) return (NULL); digest = ft_hthash(ht, key); - found = ft_lstlfind(ht->entries[digest], ft_inter_htkey_cmp, key); + found = ft_lstlfind(ht->buckets[digest], ft_inter_htkey_cmp, key); if (found == NULL) return (NULL); - return (((t_ftht_content*)found->content)->value); + return (((t_ftht_entry*)found->data)->value); } -- 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_htget.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ht/ft_htget.c') diff --git a/src/ht/ft_htget.c b/src/ht/ft_htget.c index 6b5df48..a6383fe 100644 --- a/src/ht/ft_htget.c +++ b/src/ht/ft_htget.c @@ -6,14 +6,14 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/30 08:33:21 by cacharle #+# #+# */ -/* Updated: 2020/02/28 12:21:09 by cacharle ### ########.fr */ +/* Updated: 2020/04/01 18:02:57 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" #include "libft_ht.h" -/** +/* ** \brief Retrieve a value with a key ** \param ht Hash table where key is searched ** \param key Searched key @@ -22,7 +22,6 @@ void *ft_htget(t_ftht *ht, char *key) { - t_ftht_digest digest; t_ftlst *found; -- cgit