summaryrefslogtreecommitdiffstats
path: root/src/ft_s_lcom.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 18:46:17 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 18:46:17 +0200
commit3349e8a37a9fdf78b82d6df1d310e39c78fcebb2 (patch)
tree88ec7499dbdd45293ae63b5b353c849e50c166e8 /src/ft_s_lcom.c
parentCool funptr (diff)
download42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.gz
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.bz2
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.xz
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.zst
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.zip
Trying linked lists
Diffstat (limited to 'src/ft_s_lcom.c')
-rw-r--r--src/ft_s_lcom.c23
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);
+}