/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstadd_front.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/12 11:40:16 by rparodi #+# #+# */ /* Updated: 2024/10/31 17:30:01 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" /** * @brief Add the list new to the front of chained list of lst * * @param lst first element of the list * @param new The element to add at the start */ void ft_lstadd_front(t_list **lst, t_list *new) { if (*lst == NULL) { *lst = new; return ; } new->next = *lst; *lst = new; }