-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstnew.c
33 lines (30 loc) · 1.21 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
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rlechapt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/04/02 03:02:29 by rlechapt #+# #+# */
/* Updated: 2015/04/02 07:23:23 by rlechapt ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void const *content, size_t content_size)
{
t_list *new;
if ((new = (t_list*)malloc(sizeof(*new))) == 0)
return (NULL);
if (!content)
{
new->content = NULL;
new->content_size = 0;
}
else
{
new->content = (void*)content;
new->content_size = content_size;
}
new->next = NULL;
return (new);
}