Files
42_INT_10_cube3d/libs/libft/srcs/ft_lstcreate.c
2022-05-04 14:38:34 +02:00

31 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstcreate.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/24 13:12:50 by simplonco #+# #+# */
/* Updated: 2022/05/04 14:17:46 by pblagoje ### ########.fr */
/* */
/* ************************************************************************** */
/*
* create a new two-way list
*/
#include "libft.h"
t_list *ft_lstcreate(void *content)
{
t_list *lst;
lst = (t_list *)malloc(sizeof(*lst));
if (!lst)
return (NULL);
lst->content = content;
lst->prev = NULL;
lst->next = NULL;
return (lst);
}