/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_s_lcom.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include "ft_s_struct.h" t_lcom *ft_lcom_new(const char word[]) { t_lcom *nlcom; char **words; if (!(nlcom = (t_lcom*)malloc(sizeof(t_lcom)))) { return (NULL); } if (!(words = ft_split(word, ' '))) { return (NULL); } nlcom->com = words[0]; nlcom->args = words + 1; nlcom->next = NULL; return (nlcom); }