-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_htnew.c
31 lines (28 loc) · 1.15 KB
/
ft_htnew.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_htnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thakala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/25 22:19:48 by thakala #+# #+# */
/* Updated: 2021/12/26 13:45:16 by thakala ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
t_ht *ft_htnew(size_t pens)
{
t_ht *ht;
ht = (t_ht *)malloc(sizeof(t_ht));
if (!ht)
return (NULL);
ht->t = (t_list **)ft_memalloc(sizeof(t_list *) * pens);
if (!ht->t)
{
free(ht);
return (NULL);
}
ht->size = pens;
return (ht);
}