Projet de l'école 42 : Libft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

3 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
3 years ago
/* ft_add.c :+: :+: :+: */
3 years ago
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
3 years ago
/* Created: 2022/03/24 10:46:25 by narnaud #+# #+# */
/* Updated: 2022/03/25 14:15:13 by narnaud ### ########.fr */
3 years ago
/* */
/* ************************************************************************** */
#include "../libft.h"
3 years ago
t_dlist *ft_dlst_add(t_dlist *prev, void *content)
3 years ago
{
3 years ago
t_dlist *new;
3 years ago
3 years ago
if (!content)
return (prev);
new = ft_calloc(1, sizeof(t_dlist));
if (prev)
prev->next = new;
new->previous = prev;
new->content = content;
return (new);
3 years ago
}