diff options
Diffstat (limited to '')
-rw-r--r-- | src/s_lpipes.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/s_lpipes.c b/src/s_lpipes.c index cb78df3..9d10849 100644 --- a/src/s_lpipes.c +++ b/src/s_lpipes.c @@ -14,7 +14,8 @@ #include <stdlib.h> #include <stdint.h> -#include "s_lcom.h" +#include "s_com.h" +#include "s_line.h" #include "s_lpipes.h" #include "s_struct.h" @@ -53,7 +54,7 @@ void while (tmp) { renext = tmp->next; - lcom_clear(&tmp->one); + s_com_destroy(&tmp->com); ft_memdel((void*)&tmp); tmp = renext; } @@ -62,14 +63,14 @@ void struct s_lpipes *lpipes_new(const char pipedword[], - t_msh *msh) + t_msh *msh) { struct s_lpipes *link; if (!(link = (struct s_lpipes*)malloc(sizeof(struct s_lpipes)))) return (NULL); - link->one = NULL; - if (!(link->one = lcom_new(pipedword, msh))) + link->com = NULL; + if ((link->com = s_com_new(pipedword, msh)) == NULL) { return (NULL); } @@ -79,8 +80,8 @@ struct s_lpipes struct s_lpipes *split_pipes(const char word[], - t_lcom *lcom, - t_msh *msh) + t_line *line, + t_msh *msh) { struct s_lpipes *lpipes; char **words; @@ -89,15 +90,13 @@ struct s_lpipes if (!(words = ft_split(word, '|'))) return (NULL); i = 0; - if (!(lpipes = (struct s_lpipes*)malloc(sizeof(struct s_lpipes)))) - return (NULL); while (words[i]) { if (!(lpipes = lpipes_new(words[i], msh))) { return (NULL); } - lpipes_add_back(&lcom->pipes, lpipes); + lpipes_add_back(&line->pipes, lpipes); i++; } ft_delwords(words); |