From c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 11 Oct 2020 15:52:52 +0200 Subject: Removing libft/minishell_test submodules, Removing subject/README/etc --- libft/src/lst/ft_lstnew.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libft/src/lst/ft_lstnew.c (limited to 'libft/src/lst/ft_lstnew.c') diff --git a/libft/src/lst/ft_lstnew.c b/libft/src/lst/ft_lstnew.c new file mode 100644 index 0000000..1616b71 --- /dev/null +++ b/libft/src/lst/ft_lstnew.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/09 09:01:16 by cacharle #+# #+# */ +/* Updated: 2019/11/20 04:01:35 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_lst.h" + +/* +** \brief Create a list node +** \param data Pointer to data of node +*/ + +t_ftlst *ft_lstnew(void const *data) +{ + t_ftlst *elem; + + if ((elem = (t_ftlst*)malloc(sizeof(t_ftlst))) == NULL) + return (NULL); + elem->data = (void*)data; + elem->next = NULL; + return (elem); +} -- cgit