aboutsummaryrefslogtreecommitdiff
path: root/src/ht/ft_htdelone.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-30 22:26:36 +0200
committerCharles <sircharlesaze@gmail.com>2020-03-30 22:26:36 +0200
commit901402c99018422c994bdb297e3ba404969c88ea (patch)
tree98602c73a00af57fb7efcb36e4e3cbae2c0ce3a8 /src/ht/ft_htdelone.c
parent40ed37c023627726a5c9c6928284e9f042dc0fa4 (diff)
downloadlibft-901402c99018422c994bdb297e3ba404969c88ea.tar.gz
libft-901402c99018422c994bdb297e3ba404969c88ea.tar.bz2
libft-901402c99018422c994bdb297e3ba404969c88ea.zip
Added documentation for ht and lst
Diffstat (limited to 'src/ht/ft_htdelone.c')
-rw-r--r--src/ht/ft_htdelone.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ht/ft_htdelone.c b/src/ht/ft_htdelone.c
index e3bb355..3672b23 100644
--- a/src/ht/ft_htdelone.c
+++ b/src/ht/ft_htdelone.c
@@ -13,13 +13,17 @@
#include "libft.h"
#include "libft_ht.h"
-/*
-** Delete one hash table entry at `key`.
+/**
+** \brief Delete one hash table entry
+** \param key Key of entry to delete
+** \param del Function to destroy the entry
+** \warning The del function HAS to free the key
+** \note Do nothing if their is to entry which correspond to key
*/
-void ft_htdelone(t_ftht *ht, char *key, void (*del)(t_ftht_content*))
+void ft_htdelone(t_ftht *ht, char *key, void (*del)(t_ftht_entry*))
{
- ft_lstremove_if(ht->entries + ft_hthash(ht, key),
+ ft_lstremove_if(ht->buckets + ft_hthash(ht, key),
ft_inter_htkey_cmp, key,
(void (*)(void*))del);
}