2022-09-27 11:25:41 -04:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
2022-10-04 08:21:55 -04:00
|
|
|
/* ft_lstnew.c :+: :+: :+: */
|
2022-09-27 11:25:41 -04:00
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
2022-10-04 08:21:55 -04:00
|
|
|
/* Created: 2022/09/29 23:41:40 by cchauvet #+# #+# */
|
|
|
|
/* Updated: 2022/09/29 23:47:50 by cchauvet ### ########.fr */
|
2022-09-27 11:25:41 -04:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#include "libft.h"
|
|
|
|
|
2022-10-04 08:21:55 -04:00
|
|
|
t_list *ft_lstnew(void *content)
|
2022-09-27 11:25:41 -04:00
|
|
|
{
|
2022-10-04 08:21:55 -04:00
|
|
|
t_list *new;
|
2022-09-27 11:25:41 -04:00
|
|
|
|
2022-10-04 08:21:55 -04:00
|
|
|
new = malloc(sizeof(t_list));
|
|
|
|
if (new == NULL)
|
|
|
|
return (NULL);
|
|
|
|
new->next = NULL;
|
|
|
|
new->content = content;
|
|
|
|
return (new);
|
2022-09-27 11:25:41 -04:00
|
|
|
}
|