libft
ft_lstadd.c
Go to the documentation of this file.
1 /* ************************************************************************** */
3 /* */
4 /* ::: :::::::: */
5 /* ft_lstadd.c :+: :+: :+: */
6 /* +:+ +:+ +:+ */
7 /* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8 /* +#+#+#+#+#+ +#+ */
9 /* Created: 2019/09/05 16:50:06 by unite #+# #+# */
10 /* Updated: 2020/07/16 03:03:56 by unite ### ########.fr */
11 /* */
12 /* ************************************************************************** */
13 
14 #include "libft.h"
15 
22 void ft_lstadd(t_list **alst, t_list *new)
23 {
24  if (!alst || !new)
25  return ;
26  new->next = *alst;
27  *alst = new;
28 }
ft_lstadd
void ft_lstadd(t_list **alst, t_list *new)
Adds an element at the beginning of a list.
Definition: ft_lstadd.c:22
s_list
A link in a multi-purpose linked list.
Definition: libft.h:34
libft.h