/ libft / ft_lstnew.c
ft_lstnew.c
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   ft_lstnew.c                                        :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <marvin@42.fr>                      +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2022/07/12 13:56:47 by gychoi            #+#    #+#             */
 9  /*   Updated: 2022/07/12 14:27:16 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include "libft.h"
14  
15  t_list	*ft_lstnew(void	*content)
16  {
17  	t_list	*new;
18  
19  	new = malloc(sizeof(t_list));
20  	if (!new)
21  		return (NULL);
22  	new->content = content;
23  	new->next = NULL;
24  	return (new);
25  }