aboutsummaryrefslogtreecommitdiff
path: root/ft_lstnew.c
blob: d4f53bcd871115d74d69aec6171b1fb84e7425e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdlib.h>
#include "libft.h"

t_list * ft_lstnew(void const *content, size_t content_size)
{
    t_list  *elem;

    if ((elem = (t_list*)malloc(sizeof(t_list))) == NULL)
        return (NULL);
    elem->content = (void*)content;
    elem->content_size = content_size;
    elem->next = NULL;
    return (elem);
}