diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_s_lcom.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ft_s_lcom.c b/src/ft_s_lcom.c new file mode 100644 index 0000000..9189113 --- /dev/null +++ b/src/ft_s_lcom.c @@ -0,0 +1,23 @@ +#include <libft.h> +#include <stdlib.h> +#include "ft_s_struct.h" + +t_lcom + *ft_lcom_lstnew(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); +} |