diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-30 22:26:36 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-30 22:26:36 +0200 |
| commit | 901402c99018422c994bdb297e3ba404969c88ea (patch) | |
| tree | 98602c73a00af57fb7efcb36e4e3cbae2c0ce3a8 /src/ht/ft_htnew.c | |
| parent | 40ed37c023627726a5c9c6928284e9f042dc0fa4 (diff) | |
| download | libft-901402c99018422c994bdb297e3ba404969c88ea.tar.gz libft-901402c99018422c994bdb297e3ba404969c88ea.tar.bz2 libft-901402c99018422c994bdb297e3ba404969c88ea.zip | |
Added documentation for ht and lst
Diffstat (limited to 'src/ht/ft_htnew.c')
| -rw-r--r-- | src/ht/ft_htnew.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ht/ft_htnew.c b/src/ht/ft_htnew.c index 465eabf..e28b544 100644 --- a/src/ht/ft_htnew.c +++ b/src/ht/ft_htnew.c @@ -13,10 +13,10 @@ #include "libft.h" #include "libft_ht.h" -/* -** Create a new hash table. -** `size` is the size of the underlying array of linked list (buckets) -** Return NULL is an allocation failed. +/** +** \brief Create a new hash table. +** \param size Size of the underlying array of linked list (buckets) +** \return Created hash table or NULL is an allocation failed */ t_ftht *ft_htnew(t_ftsize size) @@ -27,8 +27,8 @@ t_ftht *ft_htnew(t_ftsize size) return (NULL); if ((ht = (t_ftht*)malloc(sizeof(t_ftht))) == NULL) return (NULL); - ht->entries = (t_ftht_entry*)ft_calloc(size, sizeof(t_ftht_entry)); - if (ht->entries == NULL) + ht->buckets = (t_ftht_bucket*)ft_calloc(size, sizeof(t_ftht_entry)); + if (ht->buckets == NULL) { free(ht); return (NULL); |
