libft/srcs/slist/ft_slist_new.c

16 lines
No EOL
238 B
C

#if USE_SLIST
#include "libft.h"
t_slist *ft_slist_new(void *data)
{
t_slist *node = (t_slist *)malloc(sizeof(t_slist));
if (!node)
return (NULL);
node->data = data;
node->next = NULL;
return node;
}
#endif