-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstnew.c
29 lines (26 loc) · 1.18 KB
/
ft_lstnew.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rodrodri <[email protected] > +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/30 14:41:03 by rodrodri #+# #+# */
/* Updated: 2021/11/13 20:05:10 by rodrodri ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void const *content, size_t content_size)
{
t_list *new;
new = (t_list *)malloc(sizeof(*new));
if (!new)
return (NULL);
new->content = (void *)content;
if (new->content)
new->content_size = content_size;
else
new->content_size = 0;
new->next = NULL;
return (new);
}